Use security_server_app_give_access() API for updating smack rule
[platform/framework/native/appfw.git] / src / app / FApp_DataControlProviderManagerImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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  * @file        FApp_DataControlProviderManagerImpl.h
19  * @brief       This is the header file for the %_DataControlProviderManagerImpl class.
20  *
21  * This header file contains the declarations of the %_DataControlProviderManagerImpl class.
22  */
23
24 #ifndef _FAPP_INTERNAL_DATACONTROL_PROVIDERMANAGER_IMPL_H_
25 #define _FAPP_INTERNAL_DATACONTROL_PROVIDERMANAGER_IMPL_H_
26
27 #include <FOspConfig.h>
28 #include <FBaseObject.h>
29 #include <FBaseDataType.h>
30 #include <FBaseColIList.h>
31 #include <FBaseColLinkedList.h>
32
33 #include "FApp_AppArg.h"
34
35 namespace Tizen { namespace Base
36 {
37 class String;
38 class ByteBuffer;
39 }}
40 namespace Tizen { namespace Io
41 {
42 class DataControlResultSet;
43 }}
44
45 namespace Tizen { namespace App
46 {
47
48 class DataControlProviderManager;
49
50 /**
51  * @class       _DataControlProviderManagerImpl
52  * @brief       This class manages all the data controls.
53  * @since 2.1
54  *
55  * The %_DataControlProviderManagerImpl class manages all the data controls.
56  */
57 class _DataControlProviderManagerImpl
58         : public Tizen::Base::Object
59 {
60
61 public:
62         result SetSqlDataControlProviderEventListener(ISqlDataControlProviderEventListener* pListener);
63
64         result SetMapDataControlProviderEventListener(IMapDataControlProviderEventListener* pListener);
65
66         result SendSqlDataControlSelectResult(RequestId reqId, Tizen::Io::IDbEnumerator* pDbEnum);
67
68         result SendSqlDataControlInsertResult(RequestId reqId, long long insertRowId);
69
70         result SendSqlDataControlUpdateDeleteResult(RequestId reqId);
71
72         result SendMapDataControlResult(RequestId reqId, Tizen::Base::Collection::IList* pResultValueList);
73
74         result SendDataControlError(RequestId reqId, const Tizen::Base::String& errorMsg);
75
76         result AllowAccess(Tizen::Base::String& appId);
77
78         /**
79         * Retrieves the data control provider manager instance.
80         *
81         * @since 2.1
82         * @return       A pointer to the DataControlProviderManager instance if it succeeded.
83         *                       else @c null
84         */
85         static DataControlProviderManager* GetInstance(void);
86
87 private:
88         /**
89         * This is the default constructor for this class.
90         *
91         * @since 2.1
92         */
93         _DataControlProviderManagerImpl(void);
94
95         /**
96         * This is the destructor for this class.
97         *
98         * @since 2.1
99         */
100         virtual ~_DataControlProviderManagerImpl(void);
101
102         /**
103         * This is the default copy constructor for this class.
104         */
105         _DataControlProviderManagerImpl(const _DataControlProviderManagerImpl& source);
106
107         /**
108         * This is the assignment operator for this class.
109         */
110         _DataControlProviderManagerImpl& operator =(const _DataControlProviderManagerImpl& source);
111
112         void Cache(Tizen::Base::String& appId);
113
114         bool IsCached(Tizen::Base::String& appId);
115
116         static result SendDataControlResult(RequestId reqId, _DataControlRequestType apiType,
117                         Tizen::Io::IDbEnumerator* pDbEnum, Tizen::Base::Collection::IList* pResultValueList, long long insertRowId,
118             bool providerResult, const Tizen::Base::String* pErrorMsg);
119
120 private:
121         Tizen::Base::Collection::LinkedList* __pProviderList;
122
123         friend class DataControlProviderManager;
124 };
125
126 }} // Tizen::App
127
128 #endif // _FAPP_INTERNAL_DATACONTROL_PROVIDERMANAGER_IMPL_H_
129