summaryrefslogtreecommitdiff
path: root/mobile_src/Messaging/ReqReceiverMessage.h
blob: d6c29210cb17408c804d1d340c849535d8bae840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//
// 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 REQRECEIVERMESSAGE_H
#define REQRECEIVERMESSAGE_H

#include <dpl/singleton.h>

#include "EventAddDraftMessage.h"
#include "EventSendMessage.h"
#include "EventUpdateMessage.h"
//#include "EventDeleteMessage.h"
#include "EventDeleteMessages.h"
#include "EventUpdateMessages.h"
#include "EventQueryMessages.h"
#include "EventGetConversationId.h"
#include "EventQueryConversations.h"
#include "EventQueryFolders.h"
#include "EventDeleteConversations.h"
#include "EventMessagingService.h"

#include "log.h"

namespace DeviceAPI {
namespace Messaging {

typedef WrtDeviceApis::Commons::EventRequestReceiver<EventAddDraftMessage>
EventAddDraftMessageReqReceiver;
//typedef WrtDeviceApis::Commons::EventRequestReceiver<EventSendMessage>
//EventSendMessageReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventUpdateMessage>
EventUpdateMessageReqReceiver;
//typedef WrtDeviceApis::Commons::EventRequestReceiver<EventDeleteMessage>
//EventDeleteMessageReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventDeleteMessages>
EventDeleteMessagesReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventUpdateMessages>
EventUpdateMessagesReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventQueryMessages>
EventQueryMessagesReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventGetConversationId>
EventGetConversationIdReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventQueryConversations>
EventQueryConversationsReqReceiver;	
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventDeleteConversations>
EventDeleteConversationsReqReceiver;
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventQueryFolders>
EventQueryFoldersReqReceiver;	
typedef WrtDeviceApis::Commons::EventRequestReceiver<EventMessagingService>
EventMessagingServiceReqReceiver;	
class ReqReceiverMessage : public EventAddDraftMessageReqReceiver,
//  public EventSendMessageReqReceiver,	
    public EventUpdateMessageReqReceiver,
//    public EventDeleteMessageReqReceiver,
    public EventDeleteMessagesReqReceiver,
    public EventUpdateMessagesReqReceiver, 
    public EventQueryMessagesReqReceiver,
    public EventGetConversationIdReqReceiver,
    public EventQueryConversationsReqReceiver,
    public EventDeleteConversationsReqReceiver,
    public EventQueryFoldersReqReceiver,    
    public EventMessagingServiceReqReceiver
{
	private:
		bool validateFilter(const DeviceAPI::Tizen::FilterPtr& filter);

  public:
    ReqReceiverMessage();

    virtual ~ReqReceiverMessage();

    void addDraftMessage(const EventAddDraftMessagePtr& event);

//    void sendMessage(const EventSendMessagePtr& event);

    void sendMessage(const EventMessagingServicePtr& event);

    void updateMessage(const EventUpdateMessagePtr& event);

//    void deleteMessage(const EventDeleteMessagePtr& event);

    void deleteMessages(const EventDeleteMessagesPtr& event);	

    void updateMessages(const EventUpdateMessagesPtr& event);

    void queryMessages(const EventQueryMessagesPtr& event);

    void getConversationId(const EventGetConversationIdPtr& event);

    void queryConversations(const EventQueryConversationsPtr& event);

    void deleteConversations(const EventDeleteConversationsPtr& event);

    void queryFolders(const EventQueryFoldersPtr& event);

    void loadMessageBody(const EventMessagingServicePtr& event);

    void loadMessageAttachment(const EventMessagingServicePtr& event);
	
    void sync(const EventMessagingServicePtr& event);

    void syncFolder(const EventMessagingServicePtr& event);

		
  protected:

    void OnRequestReceived(const EventAddDraftMessagePtr& event);

//    void OnRequestReceived(const EventSendMessagePtr& event);

    void OnRequestReceived(const EventUpdateMessagePtr& event);

//    void OnRequestReceived(const EventDeleteMessagePtr& event);

    void OnRequestReceived(const EventDeleteMessagesPtr& event);

    void OnRequestReceived(const EventUpdateMessagesPtr& event);

    void OnRequestReceived(const EventQueryMessagesPtr& event);

    void OnRequestReceived(const EventGetConversationIdPtr& event);	

    void OnRequestReceived(const EventQueryConversationsPtr& event);

    void OnRequestReceived(const EventDeleteConversationsPtr& event);

    void OnRequestReceived(const EventQueryFoldersPtr& event);

    void OnRequestReceived(const EventMessagingServicePtr& event);	
};

typedef DPL::Singleton<ReqReceiverMessage> ReqReceiverMessageSingleton;
}
}
#endif // REQRECEIVERMESSAGE_H