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.
18 #ifndef WRTPLUGINS_TIZEN_JS_MESSAGING_SERVICE_MANAGER_H_
19 #define WRTPLUGINS_TIZEN_JS_MESSAGING_SERVICE_MANAGER_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
24 #include "IMessagingServiceManager.h"
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<DeviceAPI::Messaging::IMessagingServiceManagerPtr>::Type JSMessagingServiceManagerPrivObject;
31 class JSMessagingServiceManagerPriv :
32 public JSMessagingServiceManagerPrivObject,
33 public DeviceAPI::Common::SecurityAccessor
36 JSMessagingServiceManagerPriv(JSContextRef context, IMessagingServiceManagerPtr messagingServiceManager) :
37 JSMessagingServiceManagerPrivObject(context, messagingServiceManager),
38 DeviceAPI::Common::SecurityAccessor()
42 virtual ~JSMessagingServiceManagerPriv()
47 class JSMessagingServiceManager {
49 //@struct JSClassDefinition
50 // @abstract This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL.
51 static const JSClassDefinition* getClassInfo();
52 static const JSClassRef getClassRef();
56 * The callback invoked when an object is first created.
58 static void initialize(JSContextRef context, JSObjectRef object);
61 * The callback invoked when an object is finalized.
63 static void finalize(JSObjectRef object);
66 * The callback invoked when an object is used as the target of an 'instanceof' expression.
68 static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
72 * The callback invoked when determining whether an object has a property.
74 static bool hasProperty(JSContextRef context,
76 JSStringRef propertyName);
79 * The callback invoked when getting a property's value.
82 static JSValueRef getProperty(JSContextRef context,
84 JSStringRef propertyName,
85 JSValueRef* exception);
87 static JSValueRef getMessagingServices(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
88 const JSValueRef arguments[], JSValueRef* exception);
90 static JSValueRef getMessagingService(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
91 const JSValueRef arguments[], JSValueRef* exception);
94 * This structure contains properties and callbacks that define a type of object.
96 static JSClassDefinition m_classInfo;
99 * This structure describes a statically declared function property.
101 static JSStaticFunction m_function[];
102 static JSStaticValue m_property[];
103 static JSClassRef m_jsClassRef;
107 GET_MESSAGING_SERVICE_ALL = 1,
108 GET_MESSAGING_SERVICE_ACOUNT = 2
116 #endif //WRTPLUGINS_TIZEN_JS_MESSAGING_SERVICE_MANAGER_H_