Git Init
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / NFC / NdefRecord.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18
19 #ifndef _NDEFRECORD_H_
20 #define _NDEFRECORD_H_
21
22 #include <vector>
23 #include <API/NFC/INdefRecord.h>
24 #include <nfc.h>
25
26 using namespace TizenApis::Api::NFC;
27
28 namespace TizenApis {
29 namespace Platform {
30 namespace NFC {
31
32 class NdefRecord : public INdefRecord
33 {
34         friend class  NFCFactory;
35     public:
36                 NdefRecord(const NdefRecordProperties &ndefRecordProperties, std::vector<unsigned char> payload);
37                 NdefRecord(void *recordhandle);
38                 NdefRecord(const std::string &text, const std::string &langCode, const short encodeType);
39                 NdefRecord(const std::string &uri);
40                 NdefRecord(const std::string &mimeType, const std::vector<unsigned char> data);
41         virtual  ~NdefRecord();
42         virtual void *getHandle();
43         virtual NdefRecordProperties getNDEFRecordProperties();
44         virtual std::vector<unsigned char> getPayload();
45         virtual bool getText(char **text);
46         virtual bool getLangCode(char **landCode);
47         virtual bool getEncodeType(nfcTextEncodeUTF *encodeType);
48         virtual bool getUri(char **uri);
49         virtual bool getMimeType(char **mimeType);
50
51     private:
52         nfc_ndef_record_h handle;
53         nfc_encode_type_e _convertToEncodeType(const nfcTextEncodeUTF type);
54         nfcTextEncodeUTF _convertToNfcEncodeType(const nfc_encode_type_e type);
55 };
56
57 }
58 }
59 }
60
61 #endif /* _NDEFRECORD_H_ */