Modify SMACK manifest according three domain model
[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.1 (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 #include "FIo_IpcCommonDataTypes.h"
35
36 namespace Tizen { namespace Base
37 {
38 class ByteBuffer;
39 } }
40
41 namespace Tizen { namespace Base { namespace Collection
42 {
43 class HashMap;
44 } } }
45
46 /**
47  * @class       NfcMessageRegisterService
48  * @brief       This class represents NFC service of the Connectivity service daemon.
49  *
50  * @since 2.1
51  *
52  * This class represents NFC service of the Connectivity service daemon.
53  */
54 class NfcMessageRegisterService
55         : public Tizen::App::Package::IPackageInstallationEventListener
56 {
57 public:
58         NfcMessageRegisterService(void);
59         virtual ~NfcMessageRegisterService(void);
60
61         result Construct(void);
62
63         result RegisterPushMessage(const Tizen::Base::String& appPkgId,
64                         const Tizen::Base::ByteBuffer& pushMessageBuffer, const Tizen::Base::String& description);
65         result UnregisterPushMessage(const Tizen::Base::String& appPkgId);
66         result GetReservedPushCandidates(Tizen::Io::_StringMap* pCandidates);
67         result PickReservedPushMessage(const Tizen::Base::String& ownerAppId);
68
69         // From IPackageInstallationEventListener;
70         virtual void OnPackageInstallationCompleted(const Tizen::App::PackageId& packageId,
71                         Tizen::App::Package::PackageInstallationResult installationResult) {}
72         virtual void OnPackageUninstallationCompleted(const Tizen::App::PackageId& packageId, bool uninstallationResult);
73         virtual void OnPackageInstallationInProgress(const Tizen::App::PackageId& packageId, int progress) {}
74
75 private:
76         result InitializeAppIdList(void);
77         result SetSelectedMessageAppId(const Tizen::Base::String& appId);
78
79 public:
80         static const wchar_t* _SELECTED_APP_ID_NONE;
81         static const wchar_t* _META_DATA_DB_NAME;
82         static const wchar_t* _PUSH_MESSAGE_DIRECTORY;
83         static const wchar_t* _PUSH_MESSAGE_EXT_NAME;
84
85 private:
86         Tizen::Io::Database __rsvdPushDb;
87         Tizen::Base::Runtime::Mutex __listMutex;
88         Tizen::Base::Collection::LinkedListT<Tizen::Base::String> __reserverList;
89
90 };
91
92 #endif // _NFC_MESSAGE_REGISTER_SERVICE_H_