2 // Tizen Web Device API
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_NFC_NDEFRECORD_H_
19 #define __TIZEN_NFC_NDEFRECORD_H_
29 typedef std::shared_ptr<NdefRecord> NdefRecordPtr;
30 typedef std::vector<NdefRecordPtr> NdefRecordPtrVector;
31 typedef std::vector<unsigned char> UCharVector;
49 NdefRecord(const unsigned char* data, const unsigned long size);
50 NdefRecord(const short tnf,
51 const UCharVector &type,
52 const UCharVector &payload,
53 const UCharVector &id);
54 virtual ~NdefRecord();
57 UCharVector getType() const;
58 UCharVector getPayload() const;
59 UCharVector getId() const;
60 // function used for checking type of inherited record class
61 nfc_recordtype_e getRecordType() const;
62 nfc_recordstate_e getRecordState() const;
64 static NdefRecordPtr getNdefRecord(nfc_ndef_message_h message, const int index);
65 static nfc_ndef_record_h getHandle(NdefRecordPtr record_ptr);
66 static short getTnfFromHandle(nfc_ndef_record_h handle,
67 nfc_ndef_message_h message_handle = NULL);
68 static UCharVector getTypeNameFromHandle(
69 nfc_ndef_record_h handle, nfc_ndef_message_h message_handle = NULL);
70 static UCharVector getIdFromHandle(
71 nfc_ndef_record_h handle, nfc_ndef_message_h message_handle = NULL);
72 static UCharVector getPayloadFromHandle(
73 nfc_ndef_record_h handle, nfc_ndef_message_h message_handle = NULL);
74 static void removeMessageHandle(nfc_ndef_message_h message_handle);
75 static void removeRecordHandle(nfc_ndef_record_h record_handle);
79 UCharVector m_type_name;
81 UCharVector m_payload;
82 nfc_recordtype_e m_record_type;
83 nfc_recordstate_e m_record_state;
89 #endif // __TIZEN_NFC_NDEFRECORD_H_