// // Tizen Web Device API // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifndef WRTPLUGINS_TIZEN_JS_MESSAGEFOLDER_H_ #define WRTPLUGINS_TIZEN_JS_MESSAGEFOLDER_H_ #include #include #include "IMessageFolder.h" namespace DeviceAPI { namespace Messaging { typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT::Type JSMessageFolderPriv; class JSMessageFolder { public: //@struct JSClassDefinition // @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. static const JSClassDefinition* getClassInfo(); static const JSClassRef getClassRef(); static JSObjectRef createJSObject(JSContextRef context, IMessageFolderPtr object); static IMessageFolderPtr getMessageFolder(JSContextRef context, JSValueRef value); static bool isObjectOfClass(JSContextRef context, JSValueRef value); static std::string convertMessageType(int msgType); static std::string convertFolderType(int msgType); private: /** * The callback invoked when an object is first created. */ static void initialize(JSContextRef context, JSObjectRef object); /** * The callback invoked when an object is finalized. */ static void finalize(JSObjectRef object); /** * The callback invoked when an object is used as the target of an 'instanceof' expression. */ static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception); /** * The callback invoked when determining whether an object has a property. */ static bool hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName); /** * The callback invoked when getting a property's value. */ static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); static bool setProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); static void getPropertyNames(JSContextRef context, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames); /** * This structure contains properties and callbacks that define a type of object. */ static JSClassDefinition m_classInfo; /** * This structure describes a statically declared function property. */ //static JSStaticValue m_properties[]; static JSClassRef m_jsClassRef; static const char* FOLDERID; static const char* PARENTID; static const char* ACCOUNTID; static const char* CONTENTTYPE; static const char* NAME; static const char* PATH; static const char* TYPE; static const char* SYNCHRONIZABLE; static const std::string TYPE_SMS; static const std::string TYPE_MMS; static const std::string TYPE_EMAIL; static const std::string FOLDER_INBOX; static const std::string FOLDER_OUTBOX; static const std::string FOLDER_DRAFTBOX; static const std::string FOLDER_SENTBOX; static const std::string FOLDER_NOTSTANDARD; }; } } //WrtPlugins #endif //WRTPLUGINS_TIZEN_JS_MESSAGING_SERVICE_MANAGER_H_