98eed0320f68717ad05a39ff601e1f9597bbbee5
[framework/web/wrt-plugins-common.git] / src / modules / API / Messaging / IMessaging.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  * @file       IMessaging.h
20  * @author     Pawel Misiak (p.misiak@samsung.com)
21  * @version    0.1
22  * @brief
23  */
24 #ifndef IMESSAGING_H
25 #define IMESSAGING_H
26
27 #include <dpl/shared_ptr.h>
28 #include "IMessagingTypes.h"
29 #include "ISms.h"
30 #include "IBinarySms.h"
31 #include "IMms.h"
32 #include "IEmail.h"
33 #include "VirtualMessage.h"
34 #include "MessageFactory.h"
35 #include "IEmailAccount.h"
36 #include "MessageFilter.h"
37 #include "EmitterMessageReceived.h"
38
39 namespace WrtDeviceApis {
40 namespace Messaging {
41 namespace Api {
42 class IMessaging : private DPL::Noncopyable,
43     public IEmailAccount
44 {
45   public:
46     static IMessaging& getInstance();
47
48   public:
49     virtual ~IMessaging() = 0;
50
51     virtual void getNumberOfMessages(MessageType msgType,
52             FolderType folder,
53             int* readed,
54             int* unReaded) = 0;
55
56     virtual std::vector<IMessagePtr> findMessages(
57             const std::vector<MessageType>& msgTypes,
58             FolderType folder,
59             const Api::MessageFilterPtr& filter) = 0;
60
61     virtual std::vector<IMessagePtr> findMessages(
62             const std::vector<MessageType>& msgTypes,
63             const std::string &folder,
64             const Api::MessageFilterPtr& filter) = 0;
65
66     virtual std::vector<std::string> getMessageIds(MessageType msgType,
67             FolderType folder) = 0;
68
69     virtual void createFolder(MessageType msgType,
70             const std::string& userFolder) = 0;
71
72     virtual void deleteFolder(MessageType msgType,
73             const std::string& userFolder) = 0;
74
75     virtual std::vector<std::string> getFolderNames(MessageType msgType) = 0;
76
77     virtual void addOnMessageReceived(const EmitterMessageReceivedPtr& emitter)
78         = 0;
79
80     virtual void removeOnMessageReceived(EmitterMessageReceived::IdType id) = 0;
81
82     virtual void fetchEmailHeaders() = 0;
83 };
84 }
85 }
86 }
87 #endif