2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file JSPendingOperation.h
18 * @author Pete Cole (peter.cole@partner.samsung.com)
20 * 0.2 k.majewski@samsung.com
21 * @brief Declaration of the JSPendingOperation class
24 #ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDINGOPERATION_H_
25 #define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDINGOPERATION_H_
27 #include <JavaScriptCore/JavaScript.h>
28 #include <dpl/shared_ptr.h>
29 #include <Commons/IEvent.h>
30 #include <CommonsJavaScript/PrivateObject.h>
31 #include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
33 namespace WrtDeviceApis {
34 namespace CommonsJavaScript {
35 //typedef Commons::PrivateObjectT<IJSPendingOperationPrivateObject*>::Type PendingOperationPrivateObject;
37 class JSPendingOperation
41 * This initializes this JS class in the JS Engine.
43 static JSClassRef getClassRef();
47 * The callback invoked when an object is first created.
49 static void initialize(JSContextRef context,
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 structure describes a statically declared function property.
65 static JSStaticFunction m_functions[];
67 static JSClassRef m_classRef;
70 * Cancel the pending operation, if it has yet not completed.
72 static JSValueRef cancel(JSContextRef context,
74 JSObjectRef thisObject,
76 const JSValueRef arguments[],
77 JSValueRef* exception);
79 } // CommonsJavaScript
82 #endif // _JS_WAC_PENDINGOPERATION_H_