summaryrefslogtreecommitdiff
path: root/src/standards/Tizen/NFC/ResponseDispatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/standards/Tizen/NFC/ResponseDispatcher.h')
-rwxr-xr-xsrc/standards/Tizen/NFC/ResponseDispatcher.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/standards/Tizen/NFC/ResponseDispatcher.h b/src/standards/Tizen/NFC/ResponseDispatcher.h
new file mode 100755
index 0000000..0a482e9
--- /dev/null
+++ b/src/standards/Tizen/NFC/ResponseDispatcher.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef WRTPLUGINS_TIZEN10_NFC_RESPONSEDISPATCHER_H_
+#define WRTPLUGINS_TIZEN10_NFC_RESPONSEDISPATCHER_H_
+
+#include <JavaScriptCore/JavaScript.h>
+#include <Commons/EventReceiver.h>
+#include <Commons/EventListener.h>
+#include <API/NFC/EventTagAction.h>
+#include <API/NFC/EventTagMifareClassicAction.h>
+#include <API/NFC/EventTagMifareUltraAction.h>
+#include <API/NFC/EventTargetAction.h>
+
+using namespace TizenApis::Api::NFC;
+using namespace WrtDeviceApis::Commons;
+namespace TizenApis {
+namespace Tizen1_0 {
+
+typedef EventAnswerReceiver< EventTagActionRead > readNDEFAnswerReceiver;
+typedef EventAnswerReceiver< EventTagActionWrite > writeNDEFAnswerReceiver;
+typedef EventAnswerReceiver< EventTagActionTransceive > transceiveAnswerReceiver;
+typedef EventAnswerReceiver< EventTagActionFormat > formatAnswerReceiver;
+
+typedef EventAnswerReceiver< EventTagMifareClassicAuthenticateWithKeyA > mifareClassicAuthenticateWithKeyAAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicAuthenticateWithKeyB > mifareClassicAuthenticateWithKeyBAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicReadBlock > mifareClassicReadBlockAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicWriteBlock > mifareClassicWriteBlockAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicIncrementBlockValue > mifareClassicIncrementBlockValueAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicDecrementBlockValue > mifareClassicDecrementBlockValueAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicTransfer > mifareClassicTransferAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareClassicRestore > mifareClassicRestoreAnswerReceiver;
+
+typedef EventAnswerReceiver< EventTagMifareUltraReadPage > mifareUltraReadPageAnswerReceiver;
+typedef EventAnswerReceiver< EventTagMifareUltraWritePage > mifareUltraWritePageAnswerReceiver;
+
+typedef EventAnswerReceiver< EventTargetActionSend > TargetSendNdefAnswerReceiver;
+typedef EventListener< EventTargetActionReceive > TargetReceiveNdefListener;
+
+class NFCResponseDispatcher :
+ public readNDEFAnswerReceiver,
+ public writeNDEFAnswerReceiver,
+ public transceiveAnswerReceiver,
+ public formatAnswerReceiver,
+ public mifareClassicAuthenticateWithKeyAAnswerReceiver,
+ public mifareClassicAuthenticateWithKeyBAnswerReceiver,
+ public mifareClassicReadBlockAnswerReceiver,
+ public mifareClassicWriteBlockAnswerReceiver,
+ public mifareClassicIncrementBlockValueAnswerReceiver,
+ public mifareClassicDecrementBlockValueAnswerReceiver,
+ public mifareClassicTransferAnswerReceiver,
+ public mifareClassicRestoreAnswerReceiver,
+ public mifareUltraReadPageAnswerReceiver,
+ public mifareUltraWritePageAnswerReceiver,
+ public TargetSendNdefAnswerReceiver,
+ public TargetReceiveNdefListener
+
+{
+public:
+ static NFCResponseDispatcher& getInstance();
+private:
+ NFCResponseDispatcher();
+ virtual ~NFCResponseDispatcher();
+protected:
+ void OnAnswerReceived(const EventTagActionReadPtr &event);
+ void OnAnswerReceived(const EventTagActionWritePtr &event);
+ void OnAnswerReceived(const EventTagActionTransceivePtr &event);
+ void OnAnswerReceived(const EventTagActionFormatPtr &event);
+
+ void OnAnswerReceived(const EventTagMifareClassicAuthenticateWithKeyAPtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicAuthenticateWithKeyBPtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicReadBlockPtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicWriteBlockPtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicIncrementBlockValuePtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicDecrementBlockValuePtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicTransferPtr &event);
+ void OnAnswerReceived(const EventTagMifareClassicRestorePtr &event);
+
+ void OnAnswerReceived(const EventTagMifareUltraReadPagePtr &event);
+ void OnAnswerReceived(const EventTagMifareUltraWritePagePtr &event);
+
+ void OnAnswerReceived(const EventTargetActionSendPtr &event);
+ void onAnswerReceived(const EventTargetActionReceivePtr &event);
+};
+
+}
+}
+
+#endif \ No newline at end of file