Merge "Add the exception handling when using manual cert mode" into tizen_2.1
[platform/framework/native/net.git] / src / FNet_NetAccountManagerImpl.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  * @file                FNet_NetAccountManagerImpl.cpp
19  * @brief               This is the implementation for the %_NetAccountManagerImpl class.
20  */
21
22 #ifndef _FNET_INTERNAL_NET_ACCOUNT_MANAGER_IMPL_H_
23 #define _FNET_INTERNAL_NET_ACCOUNT_MANAGER_IMPL_H_
24
25 #include <FBaseDataType.h>
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FNetNetTypes.h>
29 #include "FNet_NetUtility.h"
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33 class IList;
34 } } } // Tizen::Base::Collection
35
36 namespace Tizen { namespace Net
37 {
38 class NetAccountInfo;
39 class NetAccountManager;
40 class _PsSystemNetConnection;
41
42 class _NetAccountManagerImpl
43         : public Tizen::Base::Object
44 {
45 public :
46         /**
47          * This is the default constructor for this class.
48          *
49          * @remarks             After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
50          * @see                 Construct()
51          */
52         _NetAccountManagerImpl(void);
53
54         /**
55          * This is the destructor for this class.
56          */
57         ~_NetAccountManagerImpl(void);
58
59         /**
60          * @see                 NetAccountManager::Construct()
61          */
62         result Construct(void);
63
64         /**
65          * @see                 NetAccountManager::CreateNetAccount()
66          */
67         NetAccountId CreateNetAccount(NetAccountInfo& netAccountInfo);
68
69         /**
70          * @see                 NetAccountManager::DeleteNetAccount()
71          */
72         result DeleteNetAccount(NetAccountId netAccountId);
73
74         /**
75          * @see                 NetAccountManager::UpdateNetAccount()
76          */
77         result UpdateNetAccount(const NetAccountInfo& netAccountInfo);
78
79         /**
80          * @see                 NetAccountManager::GetNetAccountId()
81          */
82         NetAccountId GetNetAccountId(const Tizen::Base::String& netAccountName) const;
83
84         /**
85          * @see                 NetAccountManager::GetNetAccountId()
86          */
87         NetAccountId GetNetAccountId(NetBearerType netBearerType) const;
88
89         /**
90          * @see                 NetAccountManager::GetNetAccountInfoN()
91          */
92         NetAccountInfo* GetNetAccountInfoN(NetAccountId netAccountId) const;
93
94         /**
95          * @see                 NetAccountManager::GetNetAccountIdsN()
96          */
97         Tizen::Base::Collection::IListT<NetAccountId>* GetNetAccountIdsN(void) const;
98
99         /**
100          * @see                 NetAccountManager::GetNetAccountNamesN()
101          */
102         Tizen::Base::Collection::IList* GetNetAccountNamesN(void) const;
103
104         /**
105          * @see                 NetAccountManager::GetNetPreference()
106          */
107         NetPreferenceType GetNetPreference(void) const;
108
109         /**
110          * @see                 NetAccountManager::SetNetPreference()
111          */
112         result SetNetPreference(NetPreferenceType netPreference);
113
114 public:
115     /**
116      * Gets the Impl instance.
117      *
118      * @since 2.1
119      * @return              The pointer to _NetAccountManagerImpl
120      * @param[in]   netAccountManager            An instance of NetAccountManager
121      */
122         static _NetAccountManagerImpl* GetInstance(NetAccountManager& netAccountManager);
123
124     /**
125      * Gets the Impl instance.
126      *
127      * @since 2.1
128      * @return              The pointer to  _NetAccountManagerImpl
129      * @param[in]   netAccountManager     An instance of NetAccountManager
130      */
131         static const _NetAccountManagerImpl* GetInstance(const NetAccountManager& netAccountManager);
132
133 public:
134         static void* GetPsProfileHandleN(const Tizen::Base::String& profileName);
135         static void* GetWifiProfileHandleN(void);
136         static Tizen::Base::Collection::IList* GetAppProfileNamesN(void);
137         static Tizen::Base::Collection::IList* GetAllProfileNamesN(void);
138         static NetAccountInfo* CreateWifiNetAccountInfoN(void* pProfileInfo);
139         static NetAccountId GetInternetAccountId(void);
140         static NetAccountId GetMmsAccountId(void);
141         static void UpdateNetAccountDb(bool force = false);
142
143 private:
144         /**
145          * This is the copy constructor for this class. @n
146          * Do @b not use directly.
147          *
148          * @param[in]   rhs                     An instance of _NetAccountManagerImpl
149          */
150         _NetAccountManagerImpl(const _NetAccountManagerImpl& rhs);
151
152         /**
153          * This is the assignment operator. Do @b not use directly.
154          *
155          * @param[in]   rhs                     An instance of _NetAccountManagerImpl
156          */
157         _NetAccountManagerImpl& operator =(const _NetAccountManagerImpl& rhs);
158
159 private:
160         static bool __isNetAccountDbInitialized;
161         static NetAccountId __internetAccountId;
162         static NetAccountId __mmsAccountId;
163         static Tizen::Base::String* __pInternetProfileName;
164         static Tizen::Base::String* __pMmsProfileName;
165
166         std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
167
168         friend class NetAccountManager;
169
170 }; // _NetAccountManagerImpl
171
172 }  }  // Tizen::Net
173
174 #endif // _FNET_INTERNAL_NET_ACCOUNT_MANAGER_IMPL_H_