tizen 2.3.1 release
[framework/web/mobile/wrt-plugins-tizen.git] / src / Application / JSApplicationCert.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #ifndef TIZENAPIS_TIZEN_JS_APPLICATION_CERT_H_
20 #define TIZENAPIS_TIZEN_JS_APPLICATION_CERT_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <memory>
25
26 namespace DeviceAPI {
27 namespace Application {
28
29 #define TIZEN_INTERFACE_APPLICATION_CERT "ApplicationCert"
30
31 #define TIZEN_APPLICATION_CERT_TYPE     "type"
32 #define TIZEN_APPLICATION_CERT_VALUE    "value"
33
34
35 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<ApplicationCertPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSApplicationCertPriv;
36
37 class JSApplicationCert {
38 public:
39     /*
40     * This initializes this JS class in the JS Engine.
41     */
42     static JSClassRef getClassRef();
43
44     static bool isObjectOfClass(JSContextRef context, JSValueRef value);
45
46 private:
47    /**
48     * The callback invoked when an object is first created.
49     */
50     static void initialize(JSContextRef context, JSObjectRef object);
51
52    /**
53     * The callback invoked when an object is finalized.
54     */
55     static void finalize(JSObjectRef object);
56
57    /**
58     * This structure contains properties and callbacks that define a type of object.
59     */
60     static JSClassDefinition m_classInfo;
61
62     /**
63      * This member variable contains the initialization values for the static properties of this class.
64      * The values are given according to the data structure JSPropertySpec
65      */
66     static JSStaticValue m_property[];
67
68     static JSClassRef m_classRef;
69
70     static ApplicationCertPtr getPrivData(JSObjectRef object);
71
72     static JSValueRef getProperty(JSContextRef context,
73         JSObjectRef object,
74         JSStringRef propertyName,
75         JSValueRef* exception);
76
77 };
78
79 }
80 }
81 #endif