Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Contact / JSContactManager.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 /**
18  * @file        JSContactManager.h
19  * @author      Kisub Song (kisubs.song@samsung.com)
20  * @version     0.1
21  * @brief
22  */
23
24 #ifndef _TIZEN_CONTACT_JS_CONTACT_MANAGER_H_
25 #define _TIZEN_CONTACT_JS_CONTACT_MANAGER_H_
26
27 #include <JavaScriptCore/JavaScript.h>
28 #include <CommonsJavaScript/PrivateObject.h>
29 #include <API/Contact/IContactManager.h>
30
31 namespace TizenApis {
32 namespace Tizen1_0 {
33 namespace Contact {
34
35 class JSContactManager
36 {
37 public:
38         static const JSClassDefinition* getClassInfo();
39
40         /**
41          * This method initializes this in the JS Engine.
42          */
43         static JSClassRef getClassRef();
44
45 private:
46         /**
47          * The callback invoked when an object is first created.
48          */
49         static void Initialize(JSContextRef context,
50                         JSObjectRef object);
51
52         /**
53          * The callback invoked when an object is finalized.
54          */
55         static void Finalize(JSObjectRef object);
56
57         /**
58          * Getter for const properties
59          */
60         static JSValueRef getConstProperty(JSContextRef context,
61                         JSObjectRef object,
62                         JSStringRef jsPropertyName,
63                         JSValueRef* exception);
64
65         /**
66          * Get Address Books.
67          */
68         static JSValueRef getAddressBooks(JSContextRef context,
69                         JSObjectRef object,
70                         JSObjectRef thisObject,
71                         size_t argumentCount,
72                         const JSValueRef arguments[],
73                         JSValueRef* exception);
74
75         /**
76          * Get Default Address Books.
77          */
78         static JSValueRef getDefaultAddressBook(JSContextRef context,
79                         JSObjectRef object,
80                         JSObjectRef thisObject,
81                         size_t argumentCount,
82                         const JSValueRef arguments[],
83                         JSValueRef* exception);
84
85         /**
86          * This structure describes a statically declared value property.
87          */
88         static JSStaticValue m_property[];
89
90         /**
91          * This structure describes a statically declared function property.
92          */
93         static JSStaticFunction m_function[];
94
95         /**
96          * This structure contains properties and callbacks that define a type of object.
97          */
98         static JSClassDefinition m_classInfo;
99
100         static JSClassRef m_classRef;
101 };
102
103 } // Contact
104 } // Tizen1_0
105 } // TizenApis
106
107 #endif //_TIZEN_CONTACT_JS_CONTACT_MANAGER_H_