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.
19 * @file EventSendMessage.h
20 * @author Pawel Misiak (p.misiak@samsung.com)
24 #ifndef EVENTSENDMESSAGE_H
25 #define EVENTSENDMESSAGE_H
29 #include <dpl/shared_ptr.h>
31 #include <Commons/IEvent.h>
32 #include "IMessaging.h"
34 namespace WrtDeviceApis {
37 class EventSendMessage;
39 typedef DPL::SharedPtr<EventSendMessage> EventSendMessagePtr;
41 class EventSendMessage :
42 public WrtDeviceApis::Commons::IEvent<EventSendMessage>
45 struct RecipientSendResult
47 RecipientSendResult(const std::string& recipient, bool send)
48 : recipient(recipient),
51 std::string recipient;
55 explicit EventSendMessage(const IMessagePtr& message)
60 IMessagePtr getMessage() const
70 void setStore(bool store)
75 void addRecipientSendResult(const std::string& recipient, bool send)
77 m_results.push_back(RecipientSendResult(recipient, send));
80 void addRecipientsSendResult(const std::vector<std::string>& recipients,
83 for_each(recipients.begin(),
85 [&m_results, &send](const std::string& recipient)
87 m_results.push_back(RecipientSendResult(recipient, send));
91 std::vector<RecipientSendResult> getRecipientSendResults() const
97 IMessagePtr m_message;
99 std::vector<RecipientSendResult> m_results;