diff options
Diffstat (limited to 'wearable_src/Tizen/JSTizen.h')
-rw-r--r-- | wearable_src/Tizen/JSTizen.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/wearable_src/Tizen/JSTizen.h b/wearable_src/Tizen/JSTizen.h new file mode 100644 index 0000000..ae93ce4 --- /dev/null +++ b/wearable_src/Tizen/JSTizen.h @@ -0,0 +1,131 @@ +// +// Tizen Web Device API +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file JSTizen.h + * @author + * @version 0.1 + * @brief + */ + +#ifndef _WRT_PLUGIN_JS_DEVICE_APIS_H_ +#define _WRT_PLUGIN_JS_DEVICE_APIS_H_ + +#include <JavaScriptCore/JavaScript.h> +#include <CommonsJavaScript/PrivateObject.h> +#include "PluginOnDemandPriv.h" + + +namespace DeviceAPI {
namespace Tizen { + +/** + * @class JSBondi + * @brief This class is javascript extenstion + * + */ + +typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<PluginOnDemandPrivPtr>::Type TizenPrivate; + + +class JSTizen { +public: + /** + * This method initializes this in the JS Engine. + */ + static JSClassRef getClassRef(); + + /** + * Gets object's class description. + */ + static const JSClassDefinition* getClassInfo(); + +private: + /** + * The callback invoked when an object is first created. + */ + static void initialize(JSContextRef context, JSObjectRef object); + + /** + * The callback invoked when an object is finalized. + */ + static void finalize(JSObjectRef object); + + /** + * The callback invoked when determining whether an object has a property. + */ + static bool hasProperty(JSContextRef context, + JSObjectRef object, JSStringRef propertyName); + + /** + * The callback invoked when getting a property's value. + */ + static JSValueRef getProperty(JSContextRef context, JSObjectRef object, + JSStringRef propertyName, JSValueRef* exception); + + /** + * The callback invoked when setting a property's value. + */ + static bool setProperty(JSContextRef context, JSObjectRef object, + JSStringRef propertyName, JSValueRef value, JSValueRef* exception); + + /** + * The callback invoked when deleting a property. + */ + static bool deleteProperty(JSContextRef context, JSObjectRef object, + JSStringRef propertyName, JSValueRef* exception); + + /** + * The callback invoked when collecting the names of an object's properties. + */ + static void getPropertyNames(JSContextRef ctx, JSObjectRef object, + JSPropertyNameAccumulatorRef propertyNames); + + /** + * The callback invoked when an object is used as the target of an 'instanceof' expression. + */ + static bool hasInstance(JSContextRef ctx, JSObjectRef constructor, + JSValueRef possibleInstance, JSValueRef* exception); + + /** + * The callback invoked when converting an object to a particular JavaScript type. + */ + static JSValueRef convertToType(JSContextRef ctx, JSObjectRef object, + JSType type, JSValueRef* exception); + + /** + * This structure describes a statically declared value property. + */ + static JSStaticValue m_properties[]; + + /** + * This structure contains properties and callbacks that define a type of object. + */ + static JSClassDefinition m_classInfo; + + /** + * This structure describes a statically declared function. + */ + static JSStaticFunction m_functions[]; + + static JSClassRef m_classRef; +}; + +} // Tizen +} // DeviceAPI + + +#endif // _WRT_PLUGIN_JS_XXX_H_ |