update for beta universally
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Account / ResponseDispatcher.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 #ifndef WRTPLUGINS_ACCOUNT_RESPONSEDISPATCHER_H_
18 #define WRTPLUGINS_ACCOUNT_RESPONSEDISPATCHER_H_
19
20 #include <JavaScriptCore/JavaScript.h>
21 #include <API/Account/IEventCreateAccount.h>
22 #include <API/Account/IEventAddAccount.h>
23 #include <API/Account/IEventDeleteAccount.h>
24 #include <API/Account/IEventFindAccounts.h>
25 #include <API/Account/IEventUpdateAccount.h>
26 #include <API/Account/IEventGetAccountServices.h>
27
28 using namespace TizenApis::Api::Account;
29 using namespace WrtDeviceApis::Commons;
30 //using namespace WrtDeviceApis::CommonsJavaScript;
31
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Account{
36         
37 typedef EventAnswerReceiver< IEventGetAccountServices >
38 GetAccountServicesEventAnswerReceiver;
39
40 typedef EventAnswerReceiver< IEventCreateAccount >
41 AccountEventAnswerReceiverCreate;
42
43 typedef EventAnswerReceiver< IEventAddAccount >
44 AccountEventAnswerReceiverAdd;
45
46 typedef EventAnswerReceiver< IEventDeleteAccount >
47 AccountEventAnswerReceiverDelete;
48
49 typedef EventAnswerReceiver< IEventUpdateAccount >
50 AccountEventAnswerReceiverUpdate;
51
52 typedef EventAnswerReceiver< IEventFindAccounts >
53 AccountEventAnswerReceiverFind;
54
55
56 class AccountResponseDispatcher :
57     public AccountEventAnswerReceiverCreate,
58     public AccountEventAnswerReceiverAdd,
59     public AccountEventAnswerReceiverDelete,
60     public AccountEventAnswerReceiverUpdate,
61     public AccountEventAnswerReceiverFind,
62     public GetAccountServicesEventAnswerReceiver
63
64 {
65   public:
66     static AccountResponseDispatcher& getInstance();
67   private:
68     AccountResponseDispatcher();
69     virtual ~AccountResponseDispatcher();
70   protected:
71     void OnAnswerReceived(const IEventCreateAccountPtr &event);
72     void OnAnswerReceived(const IEventAddAccountPtr &event);    
73     void OnAnswerReceived(const IEventDeleteAccountPtr &event);
74     void OnAnswerReceived(const IEventUpdateAccountPtr &event);
75     void OnAnswerReceived(const IEventFindAccountsPtr &event);
76     void OnAnswerReceived(const IEventGetAccountServicesPtr &event);
77
78 };
79 }
80 }
81 }
82
83 #endif