summaryrefslogtreecommitdiff
path: root/src/standards/Tizen/Messaging/MessagingStorageMultiCallback.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/standards/Tizen/Messaging/MessagingStorageMultiCallback.h')
-rwxr-xr-xsrc/standards/Tizen/Messaging/MessagingStorageMultiCallback.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/standards/Tizen/Messaging/MessagingStorageMultiCallback.h b/src/standards/Tizen/Messaging/MessagingStorageMultiCallback.h
new file mode 100755
index 0000000..ea721f1
--- /dev/null
+++ b/src/standards/Tizen/Messaging/MessagingStorageMultiCallback.h
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 TIZEN_MESSAGING_STORAGE_MULTI_CALLBACK_H_
+#define TIZEN_MESSAGING_STORAGE_MULTI_CALLBACK_H_
+
+#include <dpl/shared_ptr.h>
+#include <Commons/IEvent.h>
+#include <CommonsJavaScript/JSCallbackManager.h>
+#include <JavaScriptCore/JavaScript.h>
+#include <API/Filter/IFilter.h>
+
+namespace TizenApis {
+namespace Tizen1_0 {
+
+struct OnMessagesChanged {
+ int functionIndex;
+ JSValueRef messagesAdded;
+ JSValueRef messagesUpdated;
+ JSValueRef messagesRemoved;
+
+ OnMessagesChanged()
+ :
+ functionIndex(0),
+ messagesAdded(NULL),
+ messagesUpdated(NULL),
+ messagesRemoved(NULL)
+ { }
+};
+
+enum MessageFunctionNum{
+ MESSAGES_MULTI_FUNCTION = 0,
+ CONVERSATIONS_MULTI_FUNCTION,
+ FOLDERS_MULTI_FUNCTION,
+ MESSAGING_MULTI_FUNTION_MAX
+};
+
+struct MessageFunctions {
+ const char *addedFunction;
+ const char *updatedFunction;
+ const char *removedFunction;
+};
+
+class EventOnMessagingStorageChangesPrivateData : public WrtDeviceApis::Commons::IEventPrivateData
+{
+ public:
+ EventOnMessagingStorageChangesPrivateData(const WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr& messagesAdded,
+ const WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr& messagesUpdated,
+ const WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr& messagesRemoved, const int functionIndex);
+
+ int getFunctionIndex() const;
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr getMessagesAdded() const;
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr getMessagesUpdated() const;
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr getMessagesRemoved() const;
+
+ void setFilter(const Api::Tizen::FilterPtr& filter) {
+ m_filter = filter;
+ }
+
+ Api::Tizen::FilterPtr getFilter() {
+ return m_filter;
+ }
+
+
+private:
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr m_messagesAdded;
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr m_messagesUpdated;
+ WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr m_messagesRemoved;
+ int m_functionIndex;
+ Api::Tizen::FilterPtr m_filter;
+};
+
+typedef DPL::SharedPtr<EventOnMessagingStorageChangesPrivateData> EventOnMessagingStorageChangesPrivateDataPtr;
+
+}
+}
+
+#endif