2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file MailNotifier.h
18 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
21 #ifndef SRC_MODULES_TIZEN_MESSAGING_MAILNOTIFIER_H_
22 #define SRC_MODULES_TIZEN_MESSAGING_MAILNOTIFIER_H_
24 #include <dpl/thread.h>
25 #include <dpl/generic_event.h>
26 #include <dpl/event/event_support.h>
27 #include <dpl/event/event_listener.h>
28 #include <API/Messaging/IMessage.h>
29 #include <DBus/Connection.h>
30 #include <DBus/Message.h>
31 #include <DBus/MessageEvent.h>
33 namespace WrtDeviceApis {
36 DECLARE_GENERIC_EVENT_1(EmailReceivedEvent, int);
38 class MailNotifier : public DPL::Event::EventSupport<EmailReceivedEvent>,
39 private DPL::Event::EventListener<DBus::MessageEvent>
43 virtual ~MailNotifier();
45 void setWorkerThread(DPL::Thread* thread);
48 virtual void OnEventReceived(const DBus::MessageEvent& event);
50 virtual void onStorageChange(const DBus::MessagePtr& message);
53 DBus::ConnectionPtr m_connection;
54 std::vector<int> m_incomming;