2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef TIZENAPIS_TIZEN_JS_APPLICATION_CERT_H_
20 #define TIZENAPIS_TIZEN_JS_APPLICATION_CERT_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <dpl/shared_ptr.h>
27 namespace Application {
29 #define TIZEN_INTERFACE_APPLICATION_CERT "ApplicationCert"
31 #define TIZEN_APPLICATION_CERT_TYPE "type"
32 #define TIZEN_APPLICATION_CERT_VALUE "value"
35 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<ApplicationCertPtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSApplicationCertPriv;
37 class JSApplicationCert {
40 * This initializes this JS class in the JS Engine.
42 static JSClassRef getClassRef();
44 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
48 * The callback invoked when an object is first created.
50 static void initialize(JSContextRef context, JSObjectRef object);
53 * The callback invoked when an object is finalized.
55 static void finalize(JSObjectRef object);
58 * This structure contains properties and callbacks that define a type of object.
60 static JSClassDefinition m_classInfo;
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
66 static JSStaticValue m_property[];
68 static JSClassRef m_classRef;
70 static ApplicationCertPtr getPrivData(JSObjectRef object);
72 static JSValueRef getProperty(JSContextRef context,
74 JSStringRef propertyName,
75 JSValueRef* exception);