3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (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);
70 NotificationPanel::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
77 NotificationPanel::ShowNotification(void)
79 SceneManager* pSceneManager = null;
80 if ( __pLabel != NULL)
82 AddControl(*__pLabel);
83 __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
85 __form.AddControl(*this);
87 SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
89 if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)
91 SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());
92 SetSize(__form.GetWidth(),GetHeight());
96 // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.
97 SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());
101 __pTimer = new (std::nothrow) Timer;
102 if (__pTimer != NULL)
104 __pTimer->Construct(*this);
105 __pTimer->Start(2000);
111 NotificationPanel::SetPositionDiff(int pos)