ad47391ddb7b9086f7b5c95891ced2ce45dcfe11
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Account / AccountWrapper.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  * @file        AccountWrapper.h
20  * @author      Jihwa Park (jh7979.park@samsung.com)
21  * @author      Sangtai Kim
22  * @version     0.1
23  */
24
25 #ifndef _TIZEN_ACCOUNT_WRAPPER_H_
26 #define _TIZEN_ACCOUNT_WRAPPER_H_
27
28 #include <string>
29 #include <dpl/shared_ptr.h>
30 #include <API/Account/EventAccount.h>
31 #include <API/Account/AccountServiceTypeProperty.h>
32 #include <API/Account/AccountServiceProviderProperty.h>
33 #include "account.h"
34
35
36 using namespace TizenApis::Api::Account;
37 using namespace WrtDeviceApis::Commons;
38
39
40 namespace TizenApis {
41 namespace Platform {
42 namespace Account{
43
44 class AccountWrapper
45 {
46         public:
47                 AccountWrapper();
48                 explicit AccountWrapper(const EventAccountPtr &event);
49                 virtual ~AccountWrapper();
50                 char  *convertAbstractAccountToPlatformAccount();
51                 EventAccountPtr convertPlatformAccountToAbstractAccount();
52                 EventAccountPtr convertPlatformAccountToAbstractAccount(account_h account_info);
53
54                 char  *getPlatformAccount() const;
55                 EventAccountPtr getAbstractAccount() const;
56                 void        freePlatformAccount();
57                 void        saveAccount();
58                 void        loadAccount(int id);
59                 void        deleteAccount();
60                 void            getAccountbyId();
61                 void            getServiceTypebyId();
62                 void            getProviderbyId();
63                 void            findProviders();
64 void findServiceTypes();
65
66                 //dummy method
67                 void setDummyServices();
68                 AccountServiceTypePropertyPtr     getDummyAccountServiceType();
69                 AccountServiceProviderPropertyPtr getDummyAccountServiceProviderProperty();
70
71         protected:
72                 int  getIDFromPlatformAccount() const;
73
74                 void setIDFromPlatformAccount();
75                 void setIDToPlatformAccount();
76
77                 void setDisplayNameFromPlatformAccount();
78                 void setDisplayNameToPlatformAccount();
79
80                 void setIconPathFromPlatformAccount();
81                 void setIconPathToPlatformAccount();
82
83                 void setProviderNameFromPlatformAccount();
84                 void setProviderNameToPlatformAccount();
85
86                 void setEmailAddressFromPlatformAccount();
87                 void setEmailAddressToPlatformAccount();
88
89                 void setDomainNameFromPlatformAccount();
90                 void setDomainNameToPlatformAccount();
91
92                 void setAccountServices();
93                 void getAccountServices();
94
95         private:
96                 void displayAbstractAccount();     //only for debugging
97                 void displayPlatformAccount();     //only for debugging
98
99                 account_h m_platformAccount;
100                 EventAccountPtr m_abstractAccount;
101
102 //              static std::map<std::string, std::string> attrSvcMap;
103
104 };
105
106 typedef DPL::SharedPtr<AccountWrapper> AccountWrapperPtr;
107 }
108 }
109 }
110 #endif