Add DRAFT stubs for Vehicle plugin
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Messaging / JSMessageFolder.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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. 
15 */
16
17
18  
19
20 #ifndef WRTPLUGINS_TIZEN_JS_MESSAGEFOLDER_H_
21 #define WRTPLUGINS_TIZEN_JS_MESSAGEFOLDER_H_
22
23 #include <JavaScriptCore/JavaScript.h>
24 #include <CommonsJavaScript/PrivateObject.h>
25 #include <API/Messaging/IMessageFolder.h>
26
27 namespace TizenApis {
28 namespace Tizen1_0 {
29
30
31 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<Api::Messaging::IMessageFolderPtr>::Type JSMessageFolderPriv;
32
33 class JSMessageFolder {
34 public:
35 //@struct JSClassDefinition
36 //      @abstract This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL.
37         static const JSClassDefinition* getClassInfo();
38         static const JSClassRef getClassRef();
39         static JSObjectRef createJSObject(JSContextRef context, Api::Messaging::IMessageFolderPtr object);
40         static Api::Messaging::IMessageFolderPtr getMessageFolder(JSContextRef context, JSValueRef value);
41         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
42         static std::string convertMessageType(int msgType);
43         static std::string convertFolderType(int msgType);
44
45 private:
46         /**
47          * The callback invoked when an object is first created.
48          */
49         static void initialize(JSContextRef context, JSObjectRef object);
50
51         /**
52          * The callback invoked when an object is finalized.
53          */
54         static void finalize(JSObjectRef object);
55
56         /**
57          * The callback invoked when an object is used as the target of an 'instanceof' expression.
58          */
59         static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
60
61
62           /**
63           * The callback invoked when determining whether an object has a property.
64           */
65          static bool hasProperty(JSContextRef context,
66                          JSObjectRef object,
67                          JSStringRef propertyName);
68   
69          /**
70           * The callback invoked when getting a property's value.
71           */
72
73         static JSValueRef getProperty(JSContextRef context,
74                          JSObjectRef object,
75                          JSStringRef propertyName,
76                          JSValueRef* exception);
77
78         static bool setProperty(JSContextRef context,
79                         JSObjectRef object,
80                         JSStringRef propertyName,
81                         JSValueRef value,
82                         JSValueRef* exception);
83
84         /**
85          * This structure contains properties and callbacks that define a type of object.
86          */
87         static JSClassDefinition m_classInfo;
88
89         /**
90          * This structure describes a statically declared function property.
91          */
92         static JSStaticValue m_properties[];
93         static JSClassRef m_jsClassRef;
94
95
96         
97         static const char* FOLDERID;
98         static const char* PARENTID;
99         static const char* ACCOUNTID;
100         static const char* CONTENTTYPE;
101         static const char* NAME;
102         static const char* PATH;
103         static const char* TYPE;
104         static const char* SYNCHRONIZABLE;
105
106         static const std::string TYPE_SMS;
107         static const std::string TYPE_MMS;
108         static const std::string TYPE_EMAIL;
109
110         static const std::string FOLDER_INBOX;
111         static const std::string FOLDER_OUTBOX;
112         static const std::string FOLDER_DRAFTBOX;
113         static const std::string FOLDER_SENTBOX;
114         static const std::string FOLDER_NOTSTANDARD;    
115
116
117 };
118
119
120 } //WrtPlugins
121
122 #endif //WRTPLUGINS_TIZEN_JS_MESSAGING_SERVICE_MANAGER_H_
123
124