|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __DEVICELIWRESULT_H |
|
20 #define __DEVICELIWRESULT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <object.h> |
|
24 |
|
25 /** |
|
26 * Device |
|
27 * |
|
28 * @lib jsdevice.dll |
|
29 * @since 5.0 |
|
30 */ |
|
31 |
|
32 |
|
33 namespace KJS |
|
34 { |
|
35 class DeviceLiwResultPrivate; |
|
36 class DeviceLiwResult: public JSObject |
|
37 { |
|
38 |
|
39 public: // constructor and destructor |
|
40 |
|
41 /** |
|
42 * Constructor |
|
43 * @return none |
|
44 * @since 5.0 |
|
45 **/ |
|
46 DeviceLiwResult( JSValue* proto); |
|
47 |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 * @return none |
|
52 * @since 5.0 |
|
53 **/ |
|
54 virtual ~DeviceLiwResult(); |
|
55 |
|
56 |
|
57 public: // From JSObject |
|
58 |
|
59 /** |
|
60 * getOwnPropertySlot |
|
61 * @return bool |
|
62 * @since 5.0 |
|
63 **/ |
|
64 bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot); |
|
65 /** |
|
66 * getValueProperty |
|
67 * @return JSValue* |
|
68 * @since 5.0 |
|
69 **/ |
|
70 JSValue* getValueProperty(KJS::ExecState* exec, int token) const; |
|
71 |
|
72 /** |
|
73 * class info |
|
74 * @return const ClassInfo* |
|
75 * @since 5.0 |
|
76 **/ |
|
77 const ClassInfo* classInfo() const { return &info; } |
|
78 |
|
79 /** |
|
80 * whether this object is valid |
|
81 * @return boolean |
|
82 * @since 5.0 |
|
83 */ |
|
84 const bool isValid() const { return m_valid; } |
|
85 |
|
86 /** |
|
87 * close jsobject array |
|
88 * @return |
|
89 * @since 5.0 |
|
90 **/ |
|
91 void Close(ExecState* exec, bool unmark ); |
|
92 |
|
93 /** |
|
94 * close jsobject array |
|
95 * @return |
|
96 * @since 5.0 |
|
97 **/ |
|
98 void quickClose(); |
|
99 |
|
100 static const ClassInfo info; |
|
101 |
|
102 |
|
103 /** |
|
104 * toString |
|
105 * @return UString |
|
106 * @since 5.0 |
|
107 **/ |
|
108 virtual UString toString( ExecState* exec ) const; |
|
109 |
|
110 enum |
|
111 { |
|
112 close |
|
113 }; |
|
114 |
|
115 private: |
|
116 |
|
117 DeviceLiwResultPrivate* m_privateData; // private object to hold data |
|
118 bool m_valid; // bject is valid or not |
|
119 |
|
120 |
|
121 }; |
|
122 |
|
123 class DeviceLiwResultPrivate |
|
124 { |
|
125 friend class DeviceLiwResult; |
|
126 friend class DeviceLiwResultFunc; |
|
127 public: |
|
128 DeviceLiwResultPrivate(); |
|
129 ~DeviceLiwResultPrivate() { Close(); } |
|
130 void Close(); |
|
131 Identifier m_propName; |
|
132 }; |
|
133 |
|
134 class DeviceLiwResultFunc : public JSObject |
|
135 { |
|
136 public: // constructor and destructor |
|
137 |
|
138 /** |
|
139 * Constructor |
|
140 * @return none |
|
141 * @since 5.0 |
|
142 **/ |
|
143 DeviceLiwResultFunc( ExecState* exec, int token ); |
|
144 |
|
145 /** |
|
146 * Destructor |
|
147 * @return none |
|
148 * @since 5.0 |
|
149 **/ |
|
150 virtual ~DeviceLiwResultFunc() {} |
|
151 |
|
152 public: // From ObjectImp JSObject |
|
153 |
|
154 /** |
|
155 * Whether implements the call |
|
156 * @return bool |
|
157 * @since 5.0 |
|
158 **/ |
|
159 bool implementsCall() const { return true; } |
|
160 |
|
161 /** |
|
162 * Call the function |
|
163 * @return Value |
|
164 * @since 5.0 |
|
165 **/ |
|
166 JSValue* callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); |
|
167 |
|
168 private: |
|
169 int m_func; |
|
170 }; |
|
171 |
|
172 } |
|
173 #include "DeviceLiwResult.lut.h" |
|
174 #endif //__DEVICE_H |