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 #ifndef WRTPLUGINS_API_GET_MESSAGING_SERVICE_EVENT_MESSAGING_H_
18 #define WRTPLUGINS_API_GET_MESSAGING_SERVICE_EVENT_MESSAGING_H_
21 #include <Commons/IEvent.h>
22 #include <dpl/shared_ptr.h>
23 #include <Commons/Exception.h>
25 #include "IMessagingService.h"
26 #include "IMessagingTypes.h"
31 class EventGetMessagingService: public WrtDeviceApis::Commons::IEvent<EventGetMessagingService>
35 static const int MESSAGING_SERVICE_MANAGER_EVENT_TYPE_ALL = 1;
36 static const int MESSAGING_SERVICE_MANAGER_EVENT_TYPE_ACCOUNT = 2;
41 int m_messagingServiceType;
44 std::vector< IMessagingServicePtr > m_messagingServices;
47 void setAccountID(long value) {
48 //ToDo : check vailded Account, now temporary
50 m_eventType = MESSAGING_SERVICE_MANAGER_EVENT_TYPE_ACCOUNT; //if set account, type will be changed as account type
53 long getAccountID() const {
57 void setEventType(int type) {
61 int getEventType() const{
65 void setMessagingServiceType(int type) {
66 m_messagingServiceType = type;
69 int getMessagingServiceType() const {
70 return m_messagingServiceType;
73 void setMessagingServicesRef(const std::vector< IMessagingServicePtr > &msgServices)
75 m_messagingServices = msgServices;
78 std::size_t getNumberOfMessagingService()
80 return m_messagingServices.size();
83 IMessagingServicePtr getMessagingService(std::size_t index)
85 if (index >= m_messagingServices.size() || m_messagingServices.size() == 0) {
86 Throw(WrtDeviceApis::Commons::InvalidArgumentException);
89 return m_messagingServices[index];
92 std::vector<IMessagingServicePtr> getMessagingServices()
94 return m_messagingServices;
97 EventGetMessagingService()
100 m_eventType = MESSAGING_SERVICE_MANAGER_EVENT_TYPE_ALL;
104 typedef DPL::SharedPtr<EventGetMessagingService> EventGetMessagingServicePtr;
109 #endif //WRTPLUGINS_API_GET_MESSAGING_SERVICE_EVENT_MESSAGING_H_