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.
17 #ifndef WRTPLUGINS_ACCOUNT_RESPONSEDISPATCHER_H_
18 #define WRTPLUGINS_ACCOUNT_RESPONSEDISPATCHER_H_
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>
28 using namespace TizenApis::Api::Account;
29 using namespace WrtDeviceApis::Commons;
30 //using namespace WrtDeviceApis::CommonsJavaScript;
37 typedef EventAnswerReceiver< IEventGetAccountServices >
38 GetAccountServicesEventAnswerReceiver;
40 typedef EventAnswerReceiver< IEventCreateAccount >
41 AccountEventAnswerReceiverCreate;
43 typedef EventAnswerReceiver< IEventAddAccount >
44 AccountEventAnswerReceiverAdd;
46 typedef EventAnswerReceiver< IEventDeleteAccount >
47 AccountEventAnswerReceiverDelete;
49 typedef EventAnswerReceiver< IEventUpdateAccount >
50 AccountEventAnswerReceiverUpdate;
52 typedef EventAnswerReceiver< IEventFindAccounts >
53 AccountEventAnswerReceiverFind;
56 class AccountResponseDispatcher :
57 public AccountEventAnswerReceiverCreate,
58 public AccountEventAnswerReceiverAdd,
59 public AccountEventAnswerReceiverDelete,
60 public AccountEventAnswerReceiverUpdate,
61 public AccountEventAnswerReceiverFind,
62 public GetAccountServicesEventAnswerReceiver
66 static AccountResponseDispatcher& getInstance();
68 AccountResponseDispatcher();
69 virtual ~AccountResponseDispatcher();
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);