3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Flora License, Version 1.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://floralicense.org/license/
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an AS IS BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
19 /*@file: IntNotification.cpp
\r
20 *@brief: This defines the behaviour of the Notification Class
\r
24 #include <FAppUiApp.h>
\r
27 #include "IntNotificationPanel.h"
\r
28 #include "IntSceneRegister.h"
\r
30 using namespace Tizen::App;
\r
31 using namespace Tizen::Base;
\r
32 using namespace Tizen::Base::Collection;
\r
33 using namespace Tizen::Base::Runtime;
\r
34 using namespace Tizen::Graphics;
\r
35 using namespace Tizen::Ui;
\r
36 using namespace Tizen::Ui::Controls;
\r
37 using namespace Tizen::Ui::Scenes;
\r
40 NotificationPanel::NotificationPanel(Form& aForm)
\r
46 Construct("IDL_NOTIFICATION_PANEL");
\r
49 NotificationPanel::~NotificationPanel()
\r
59 NotificationPanel::SetText(Tizen::Base::String& message)
\r
61 __pLabel = static_cast<Label*>(GetControl(L"IDC_NOTIFICATION_LABEL"));
\r
62 if (__pLabel == null)
\r
66 __pLabel->SetText(message);
\r
70 NotificationPanel::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
\r
72 SetShowState(false);
\r
77 NotificationPanel::ShowNotification(void)
\r
79 SceneManager* pSceneManager = null;
\r
80 if ( __pLabel != NULL)
\r
82 AddControl(*__pLabel);
\r
83 __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
\r
85 __form.AddControl(*this);
\r
87 SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
\r
89 if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)
\r
91 SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());
\r
92 SetSize(__form.GetWidth(),GetHeight());
\r
96 // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.
\r
97 SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());
\r
101 __pTimer = new (std::nothrow) Timer;
\r
102 if (__pTimer != NULL)
\r
104 __pTimer->Construct(*this);
\r
105 __pTimer->Start(2000);
\r
111 NotificationPanel::SetPositionDiff(int pos)
\r