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 /*@file: IntNotification.cpp
20 *@brief: This defines the behaviour of the Notification Class
24 #include <FAppUiApp.h>
27 #include "IntNotificationPanel.h"
28 #include "IntSceneRegister.h"
30 using namespace Tizen::App;
31 using namespace Tizen::Base;
32 using namespace Tizen::Base::Collection;
33 using namespace Tizen::Base::Runtime;
34 using namespace Tizen::Graphics;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37 using namespace Tizen::Ui::Scenes;
40 NotificationPanel::NotificationPanel(Form& aForm)
46 Construct("IDL_NOTIFICATION_PANEL");
49 NotificationPanel::~NotificationPanel()
59 NotificationPanel::SetText(Tizen::Base::String& message)
61 __pLabel = static_cast<Label*>(GetControl(L"IDC_NOTIFICATION_LABEL"));
66 __pLabel->SetText(message);
67 __pLabel->SetTextConfig(32, LABEL_TEXT_STYLE_BOLD);
68 __pLabel->Invalidate(true);
72 NotificationPanel::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
79 NotificationPanel::ShowNotification(void)
81 SceneManager* pSceneManager = null;
82 if ( __pLabel != NULL)
84 AddControl(*__pLabel);
85 __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
87 __form.AddControl(*this);
89 SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
91 if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)
93 SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());
94 SetSize(__form.GetWidth(),GetHeight());
98 // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.
99 SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());
103 __pTimer = new (std::nothrow) Timer;
104 if (__pTimer != NULL)
106 __pTimer->Construct(*this);
107 __pTimer->Start(2000);
113 NotificationPanel::SetPositionDiff(int pos)