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.
20 * @author Lukasz Marek (l.marek@samsung.com)
24 #ifndef _ABSTRACT_LAYER_IACCOUNT_H_
25 #define _ABSTRACT_LAYER_IACCOUNT_H_
28 #include <dpl/log/log.h>
29 #include <dpl/shared_ptr.h>
30 //#include "CalendarEvent.h"
31 //#include "EventFilter.h"
32 #include "IEventCreateAccount.h"
33 #include "IEventAddAccount.h"
34 #include "IEventDeleteAccount.h"
35 #include "IEventFindAccounts.h"
36 #include "IEventUpdateAccount.h"
37 #include "IEventGetAccountById.h"
38 #include "IEventGetServiceTypeById.h"
39 #include "IEventGetProviderById.h"
40 #include "IEventFindProviders.h"
42 #include "OnAddEventsChanged.h"
43 #include "OnUpdateEventsChanged.h"
44 #include "OnDeleteEventsChanged.h"
49 class IAccountService :
50 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteAccount >,
51 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateAccount >,
52 public WrtDeviceApis::Commons::EventRequestReceiver< IEventFindAccounts >,
53 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateAccount >,
54 public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddAccount >
70 virtual ~IAccountService();
71 virtual void createAccount(IEventCreateAccountPtr &event);
72 virtual void addAccount(IEventAddAccountPtr &event);
73 virtual void updateAccount(IEventUpdateAccountPtr &event);
74 virtual void deleteAccount(IEventDeleteAccountPtr &event);
75 virtual void findAccounts(IEventFindAccountsPtr &event);
78 virtual std::string getName() const
82 virtual void setName(const std::string &value)
86 virtual AccountType getType() const
90 virtual void setType(const AccountType value)
94 virtual int getId() const
98 virtual void setId(const int value)
103 //TODO: check the meaning of emitters as below.
104 virtual OnAddEventsChangedEmitterPtr getAddEmitter() const
108 virtual void setAddEmitter(OnAddEventsChangedEmitterPtr value)
110 m_addEmitter = value;
112 virtual OnUpdateEventsChangedEmitterPtr getUpdateEmitter() const
114 return m_updateEmitter;
116 virtual void setUpdateEmitter(OnUpdateEventsChangedEmitterPtr value)
118 m_updateEmitter = value;
120 virtual OnDeleteEventsChangedEmitterPtr getDeleteEmitter() const
122 return m_deleteEmitter;
124 virtual void setDeleteEmitter(OnDeleteEventsChangedEmitterPtr value)
126 m_deleteEmitter = value;
132 OnAddEventsChangedEmitterPtr m_addEmitter;
133 OnUpdateEventsChangedEmitterPtr m_updateEmitter;
134 OnDeleteEventsChangedEmitterPtr m_deleteEmitter;
136 virtual void OnRequestReceived(const IEventDeleteAccountPtr &event) = 0;
137 virtual void OnRequestReceived(const IEventUpdateAccountPtr &event) = 0;
138 virtual void OnRequestReceived(const IEventFindAccountsPtr &event) = 0;
139 virtual void OnRequestReceived(const IEventCreateAccountPtr &event) = 0;
140 virtual void OnRequestReceived(const IEventAddAccountPtr &event) = 0;
143 typedef DPL::SharedPtr<IAccountService> IAccountServicePtr;
148 #endif /* _ABSTRACT_LAYER_IACCOUNT_H_ */