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
36 // PendingOperationPrivateObject;
38 class JSPendingOperation
42 * This initializes this JS class in the JS Engine.
44 static JSClassRef getClassRef();
48 * The callback invoked when an object is first created.
50 static void initialize(JSContextRef context,
54 * The callback invoked when an object is finalized.
56 static void finalize(JSObjectRef object);
59 * This structure contains properties and callbacks that define a type of
62 static JSClassDefinition m_classInfo;
65 * This structure describes a statically declared function property.
67 static JSStaticFunction m_functions[];
69 static JSClassRef m_classRef;
72 * Cancel the pending operation, if it has yet not completed.
74 static JSValueRef cancel(JSContextRef context,
76 JSObjectRef thisObject,
78 const JSValueRef arguments[],
79 JSValueRef* exception);
81 } // CommonsJavaScript
84 #endif // _JS_WAC_PENDINGOPERATION_H_