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 * @file JSFilesystemManager.h
22 #ifndef TIZENAPIS_TIZEN_JSFILESYSTEMMANAGER_H_
23 #define TIZENAPIS_TIZEN_JSFILESYSTEMMANAGER_H_
25 #include <JavaScriptCore/JavaScript.h>
26 #include <CommonsJavaScript/PrivateObject.h>
28 #include <SecurityAccessor.h>
32 namespace Filesystem {
34 class JSFilesystemManager
37 static const JSClassDefinition* getClassInfo();
38 static const JSClassRef getClassRef();
41 static Manager* getPrivateObject(JSContextRef context, JSValueRef value);
44 * newPriv - WARNING: pointer is not owned
45 * (use for example with &Manager::getInstance())
47 static void setPrivateObject(JSObjectRef object, Manager* newPriv);
50 * The callback invoked when an object is first created.
52 static void initialize(JSContextRef context,
56 * The callback invoked when an object is finalized.
58 static void finalize(JSObjectRef object);
61 * The callback invoked when getting a property's value.
63 static JSValueRef getMaxPathLength(JSContextRef context,
65 JSStringRef propertyName,
66 JSValueRef* exception);
69 * Resolves a location to a File handle.
71 static JSValueRef resolve(JSContextRef context,
73 JSObjectRef thisObject,
75 const JSValueRef argv[],
76 JSValueRef* exception);
79 * Get information about a storage based on it's label.
81 static JSValueRef getStorage(JSContextRef context,
83 JSObjectRef thisObject,
85 const JSValueRef argv[],
86 JSValueRef* exception);
89 * List the available storages on the device.
90 * Get the list of available internal and external storage devices.
92 static JSValueRef getStorageList(JSContextRef context,
94 JSObjectRef thisObject,
96 const JSValueRef argv[],
97 JSValueRef* exception);
99 static JSValueRef addStorageStateListener(JSContextRef context,
101 JSObjectRef thisObject,
103 const JSValueRef argv[],
104 JSValueRef* exception) ;
106 static JSValueRef removeStorageStateListener(JSContextRef context,
108 JSObjectRef thisObject,
110 const JSValueRef argv[],
111 JSValueRef* exception);
115 * This structure describes a statically declared function property.
117 static JSStaticFunction m_functions[];
120 * This structure describes a statically declared value property.
122 static JSStaticValue m_properties[];
125 * This structure contains properties and callbacks that define a type of object.
127 static JSClassDefinition m_classInfo;
129 static JSClassRef m_classRef;