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.
18 * @file ContactManagerController.h
19 * @author Kisub Song (kisubs.song@samsung.com)
24 #ifndef _TIZEN_CONTACT_MANAGER_CONTROLLER_H_
25 #define _TIZEN_CONTACT_MANAGER_CONTROLLER_H_
27 #include <dpl/shared_ptr.h>
28 #include <CommonsJavaScript/PrivateObject.h>
29 #include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
30 #include <API/Contact/IContactManager.h>
31 #include <API/Contact/EventContactManagerGetAddressBooks.h>
37 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<TizenApis::Api::Contact::IContactManagerPtr,
38 WrtDeviceApis::CommonsJavaScript::NoOwnership> ContactManagerPrivObject;
40 typedef WrtDeviceApis::Commons::EventAnswerReceiver<TizenApis::Api::Contact::EventContactManagerGetAddressBooks> EventContactManagerGetAddressBooksAnswerReceiver;
42 class ContactManagerController :
43 public EventContactManagerGetAddressBooksAnswerReceiver,
44 public ContactManagerPrivObject
47 ContactManagerController();
50 void OnAnswerReceived(const TizenApis::Api::Contact::EventContactManagerGetAddressBooksPtr &event);
53 ContactManagerController(JSContextRef context,
54 TizenApis::Api::Contact::IContactManagerPtr contactManager);
55 virtual ~ContactManagerController();
58 typedef DPL::SharedPtr<ContactManagerController> ContactManagerControllerPtr;
60 class ContactManagerGetAddressBooksPendingOperation : public WrtDeviceApis::CommonsJavaScript::IJSPendingOperationPrivateObject
63 ContactManagerGetAddressBooksPendingOperation(
64 DPL::SharedPtr<WrtDeviceApis::Commons::IEventController> &event) :
65 WrtDeviceApis::CommonsJavaScript::IJSPendingOperationPrivateObject(event)
68 virtual void handleCallingCallbacks();
72 class ContactManagerAsyncAnswerHandler
75 static void getAddressBooks(const TizenApis::Api::Contact::EventContactManagerGetAddressBooksPtr &event);
82 #endif // _TIZEN_CONTACT_MANAGER_CONTROLLER_H_