Tizen 2.1 base
[platform/framework/native/connectivity-service.git] / inc / NfcMessageRegisterService.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file        NfcMessageRegisterService.h
20  * @brief       This is the header file for the %NfcMessageRegisterService class.
21  *
22  * This header file contains the declarations of the %NfcMessageRegisterService class.
23  */
24
25 #ifndef _NFC_MESSAGE_REGISTER_SERVICE_H_
26 #define _NFC_MESSAGE_REGISTER_SERVICE_H_
27
28 #include <FBaseResult.h>
29 #include <FBaseRtMutex.h>
30 #include <FBaseString.h>
31 #include <FBaseColLinkedListT.h>
32 #include <FIoDatabase.h>
33 #include <FAppPkgIPackageInstallationEventListener.h>
34
35 // forward declarations
36 namespace Tizen { namespace Base
37 {
38 class ByteBuffer;
39 } }
40
41 /**
42  * @class       NfcMessageRegisterService
43  * @brief       This class represents NFC service of the Connectivity service daemon.
44  *
45  * @since 2.1
46  *
47  * This class represents NFC service of the Connectivity service daemon.
48  */
49 class NfcMessageRegisterService
50         : public Tizen::App::Package::IPackageInstallationEventListener
51 {
52 public:
53         NfcMessageRegisterService(void);
54         virtual ~NfcMessageRegisterService(void);
55
56         result Construct(void);
57
58         result RegisterPushMessage(const Tizen::Base::String& appId, const Tizen::Base::ByteBuffer& pushMessageBuffer,
59                         const Tizen::Base::String& description);
60         result UnregisterPushMessage(const Tizen::Base::String& appId);
61
62         // From IPackageInstallationEventListener;
63         virtual void OnPackageInstallationCompleted(const Tizen::App::PackageId& packageId, Tizen::App::Package::PackageInstallationResult installationResult) {}
64         virtual void OnPackageUninstallationCompleted(const Tizen::App::PackageId& packageId, bool uninstallationResult);
65         virtual void OnPackageInstallationInProgress(const Tizen::App::PackageId& packageId, int progress) {}
66
67 private:
68         result InitializeAppIdList(void);
69
70 public:
71         static const wchar_t* _META_DATA_DB_NAME;
72         static const wchar_t* _PUSH_MESSAGE_DIRECTORY;
73         static const wchar_t* _PUSH_MESSAGE_EXT_NAME;
74
75 private:
76         Tizen::Io::Database __rsvdPushDb;
77         Tizen::Base::Runtime::Mutex __appIdListMutex;
78         Tizen::Base::Collection::LinkedListT<Tizen::Base::String> __reserverAppIdList;
79
80 };
81
82 #endif // _NFC_MESSAGE_REGISTER_SERVICE_H_