3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * IntConfirmationPopup.cpp
20 *@file: IntConfirmationPopup.cpp
21 *@brief: Common popup to show delete confirmation
24 #include <FAppUiApp.h>
27 #include "IntCommonLib.h"
28 #include "IntConfirmationPopup.h"
29 #include "IntHistoryPresentationModel.h"
30 #include "IntSettingPresentationModel.h"
33 using namespace Tizen::Base;
34 using namespace Tizen::Graphics;
35 using namespace Tizen::Ui::Controls;
36 using namespace Tizen::Ui;
38 //static const int IDA_BUTTON_NO = 1000;
39 //static const int IDA_BUTTON_YES = 1001;
42 ConfirmationPopup::ConfirmationPopup(void)
49 ConfirmationPopup::~ConfirmationPopup(void)
55 ConfirmationPopup::Initialize(void)
57 Button* pYesButton = null;
58 Button* pNoButton = null;
59 Popup::Construct(L"IDL_CONFIRMATION_POPUP");
61 __pYesButton = static_cast< Button* >(GetControl(L"IDC_BUTTON_OK", true));
64 __pYesButton->SetActionId(IDA_BUTTON_YES);
67 __pNoButton = static_cast< Button* >(GetControl(L"IDC_BUTTON_CANCEL", true));
70 __pNoButton->SetActionId(IDA_BUTTON_NO);
73 __pPopupText = static_cast< Label* >(GetControl(L"IDC_LABEL1", true));
75 SetPropagatedKeyEventListener(this);
80 ConfirmationPopup::OnTerminating(void)
86 ConfirmationPopup::setMessage(String& str)
89 __pPopupText->SetText(str);
93 ConfirmationPopup::GetMessage(void)
99 ConfirmationPopup::AddActionListener(IActionEventListener& listener)
101 __pYesButton->AddActionEventListener(listener);
102 __pNoButton->AddActionEventListener(listener);
106 ConfirmationPopup::RemoveActionListener(IActionEventListener& listener)
108 __pYesButton->RemoveActionEventListener(listener);
109 __pNoButton->RemoveActionEventListener(listener);
113 ConfirmationPopup::OnKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
115 AppLog("ConfirmationPopup::OnKeyReleased %d",keyEventInfo.GetKeyCode());
116 if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
118 if(GetShowState() == true)