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"
32 InfoPopup::InfoPopup() :
36 void InfoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
39 std::string title = PopupSerializer::getStringArg(*data);
40 std::string message = PopupSerializer::getStringArg(*data);
41 std::string button = PopupSerializer::getStringArg(*data);
42 Assert(data->Empty());
43 LogDebug("title: " << title << " message: " << message);
47 Renderer::CtrlPopupPtr popup =
48 Renderer::PopupControllerSingleton::Instance().CreatePopup();
50 popup->SetTitle(title);
51 popup->Append(new Renderer::PopupObject::Label(message));
53 popup->Append(new Renderer::PopupObject::Button(button, 0));
55 ListenForAnswer(popup);
57 Renderer::ShowPopupEventShort event(popup,
60 &InfoPopup::responseCallback));
62 CONTROLLER_POST_EVENT(Renderer::PopupController,
69 void InfoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
71 DPL::BinaryQueue retValue;
72 PopupSerializer::appendArg(true, retValue);
73 PopupSerializer::appendArg(answer.buttonAnswer, retValue);
74 m_parent->response(retValue);