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.
19 #ifndef TIZENAPIS_TIZEN_JS_STORAGE_H_
20 #define TIZENAPIS_TIZEN_JS_STORAGE_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
25 #include "StorageProperties.h"
28 namespace Filesystem {
30 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<StorageProperties*>::Type JSStoragePriv;
48 static const JSClassDefinition* getClassInfo();
50 static const JSClassRef getClassRef();
53 * create an JSObject for callback function(onAnswerReceived).
55 static JSObjectRef createJSObject(JSContextRef context,
56 const StorageProperties &storages);
60 * The callback invoked when an object is first created.
62 static void initialize(JSContextRef context,
66 * The callback invoked when an object is finalized.
68 static void finalize(JSObjectRef object);
71 * The callback invoked when getting a property's value.
73 static JSValueRef getProperty(JSContextRef context,
75 JSStringRef propertyName,
76 JSValueRef* exception);
79 * The callback invoked when an object is used as the target of an 'instanceof' expression.
81 static bool hasInstance(JSContextRef context,
82 JSObjectRef constructor,
83 JSValueRef possibleInstance,
84 JSValueRef* exception);
87 * This structure contains properties and callbacks that define a type of object.
89 static JSClassDefinition m_classInfo;
92 * This structure describes a statically declared value property.
94 static JSStaticValue m_property[];
96 static JSClassRef m_jsClassRef;