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.
18 * @author Lukasz Marek(l.marek@samsung.com)
20 * @brief Popup that displays information. Inplementation
23 #include "InfoPopup.h"
26 #include "popup_manager.h"
28 #include "PopupSerializer.h"
33 void InfoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
36 std::string title = PopupSerializer::getStringArg(*data);
37 std::string message = PopupSerializer::getStringArg(*data);
38 std::string button = PopupSerializer::getStringArg(*data);
39 Assert(data->Empty());
40 LogDebug("title: " << title << " message: " << message);
44 Renderer::CtrlPopupPtr popup =
45 Renderer::PopupControllerSingleton::Instance().CreatePopup();
47 popup->SetTitle(title);
48 popup->Append(new Renderer::PopupObject::Label(message));
50 popup->Append(new Renderer::PopupObject::Button(button, 0));
52 ListenForAnswer(popup);
54 Renderer::ShowPopupEventShort event(popup,
57 &InfoPopup::responseCallback));
59 CONTROLLER_POST_EVENT(Renderer::PopupController,
66 void InfoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
68 DPL::BinaryQueue retValue;
69 PopupSerializer::appendArg(answer.buttonAnswer, retValue);
70 m_parent->response(retValue);