Update change log and spec for wrt-plugins-tizen_0.4.22
[framework/web/wrt-plugins-tizen.git] / src / Tizen / JSFeatureParam.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  * @file        JSFeatureParam.h
20  * @author
21  * @version     0.1
22  * @brief
23  */
24
25 #ifndef _WRT_PLUGIN_JS_FEATURE_PARAM_H_
26 #define _WRT_PLUGIN_JS_FEATURE_PARAM_H_
27
28 #include <string>
29 #include <utility>
30 #include <CommonsJavaScript/PrivateObject.h>
31 #include <JavaScriptCore/JavaScript.h>
32
33 namespace DeviceAPI {\rnamespace Tizen {
34
35 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<std::pair<std::string, std::string>, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSFeatureParamPrivObject;
36
37 /**
38  * @class JSFeatureParam
39  * @brief This class is javascript extenstion
40  *
41  */
42 class JSFeatureParam
43 {
44 public:
45     /**
46      * This method initializes this in the JS Engine.
47      */
48     static JSClassRef getClassRef();
49
50     /**
51      * Gets object's class description.
52      */
53     static const JSClassDefinition* getClassInfo();
54
55 private:
56     /**
57      * The callback invoked when an object is first created.
58      */
59     static void initialize(JSContextRef context, JSObjectRef object);
60
61     /**
62      * The callback invoked when an object is finalized.
63      */
64     static void finalize(JSObjectRef object);
65
66     /**
67      * The callback invoked when getting a property's value.
68      */
69     static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
70         JSStringRef propertyName, JSValueRef* exception);
71
72     /**
73      * This structure describes a statically declared value property.
74      */
75     static JSStaticValue m_properties[];
76
77     /**
78      * This structure contains properties and callbacks that define a type of object.
79      */
80     static JSClassDefinition m_classInfo;
81
82     static JSClassRef m_classRef;
83
84 };
85
86 } // Tizen
87 } // DeviceAPI
88
89
90 #endif //  _WRT_PLUGIN_JS_FEATURE_PARAM_H_