fixed compile issues
[profile/ivi/wrt-plugins-ivi.git] / JSVehicle.h
1 #ifndef JSVEHICLE_H
2 #define JSVEHICLE_H
3
4 #include "Vehicle.h"
5 #include <dpl/shared_ptr.h>
6 #include <JavaScriptCore/JavaScript.h>
7 #include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
8 #include <CommonsJavaScript/PrivateObject.h>
9
10 namespace DeviceAPI {
11 namespace Vehicle {
12
13 typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<VehiclePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> VehiclePrivObject;
14
15 class JSVehicle
16 {
17 public:
18         static const JSClassDefinition* getClassInfo();
19
20         static const JSClassRef getClassRef();
21
22 private:
23         /**
24                 * The callback invoked when an object is first created.
25                 */
26         static void initialize(JSContextRef context,
27                                                    JSObjectRef object);
28
29         /**
30                 * The callback invoked when an object is finalized.
31                 */
32         static void finalize(JSObjectRef object);
33
34         /**
35                 * The callback invoked when an object is used as the target of an 'instanceof' expression.
36                 */
37         static bool hasInstance(JSContextRef ctx,
38                                                         JSObjectRef constructor,
39                                                         JSValueRef possibleInstance,
40                                                         JSValueRef* exception);
41
42         static JSValueRef get(JSContextRef context,
43                                 JSObjectRef object,
44                                 JSObjectRef thisObject,
45                                 size_t argumentCount,
46                                 const JSValueRef arguments[],
47                                 JSValueRef* exception);
48
49         /**
50                  * This structure contains properties and callbacks that define a type of object.
51                  */
52         static JSClassDefinition m_classInfo;
53
54         /**
55                  * This structure describes a statically declared function.
56                  */
57         static JSStaticFunction m_function[];
58
59         static JSClassRef m_jsClassRef;
60 };
61
62 }
63 }
64
65 #endif // JSVEHICLE_H