2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file AccountWrapper.h
20 * @author Jihwa Park (jh7979.park@samsung.com)
25 #ifndef _TIZEN_ACCOUNT_WRAPPER_H_
26 #define _TIZEN_ACCOUNT_WRAPPER_H_
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 <API/Account/AccountServiceFilterProperty.h>
37 using namespace TizenApis::Api::Account;
38 using namespace WrtDeviceApis::Commons;
46 char* AccountServiceProviderId;
47 unsigned long credentialId;
48 GList* services; // AccountService_t
60 explicit AccountWrapper(const EventAccountPtr &event);
61 virtual ~AccountWrapper();
62 char *convertAbstractAccountToPlatformAccount();
63 EventAccountPtr convertPlatformAccountToAbstractAccount();
64 EventAccountPtr convertPlatformAccountToAbstractAccount(account_h account_info);
66 char *getPlatformAccount() const;
67 EventAccountPtr getAbstractAccount() const;
68 void freePlatformAccount();
70 void loadAccount(int id);
72 void getAccountbyId();
73 AccountServiceProviderPropertyArrayPtr findProviders(std::string serviceTypeId);
74 AccountServiceTypePropertyArrayPtr findServiceTypes();
75 void setTags(std::vector<std::string> &tagsVector, GList* tags_list);
77 AccountServiceTypePropertyPtr getAccountServiceTypebyId();
78 AccountServiceProviderPropertyPtr getAccountServiceProviderProperty();
80 EventAccountListPtr findAccountsByFilter(AccountServiceFilterPropertyPtr filterPropertyPtr);
81 AccountServicesArrayPtr findServiceByFilter(AccountServiceFilterPropertyPtr filterPropertyPtr);
84 void setDummyServices();
87 int getIDFromPlatformAccount() const;
89 void setIDFromPlatformAccount();
90 void setIDToPlatformAccount();
92 void setDisplayNameFromPlatformAccount();
93 void setDisplayNameToPlatformAccount();
95 void setIconPathFromPlatformAccount();
96 void setIconPathToPlatformAccount();
98 void setProviderNameFromPlatformAccount();
99 void setProviderNameToPlatformAccount();
101 void setEmailAddressFromPlatformAccount();
102 void setEmailAddressToPlatformAccount();
104 void setDomainNameFromPlatformAccount();
105 void setDomainNameToPlatformAccount();
107 void setAccountServices();
108 void getAccountServices();
111 void displayAbstractAccount(); //only for debugging
112 void displayPlatformAccount(); //only for debugging
114 account_h m_platformAccount;
115 EventAccountPtr m_abstractAccount;
117 UserAccount_t* account;
119 // static std::map<std::string, std::string> attrSvcMap;
123 typedef DPL::SharedPtr<AccountWrapper> AccountWrapperPtr;