Fixed Nabi Issues
[apps/osp/Internet.git] / src / IntNotificationPanel.cpp
index 3ee2ff3..9b68982 100644 (file)
-//\r
-\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.0 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-\r
-// !Internet\r
-/*@file:    IntNotification.cpp\r
- *@brief:      This defines the behaviour of the Notification Class\r
- *\r
- */\r
-\r
-#include <FAppUiApp.h>\r
-#include <FUi.h>\r
-\r
-#include "IntNotificationPanel.h"\r
-#include "IntSceneRegister.h"\r
-\r
-using namespace Tizen::App;\r
-using namespace Tizen::Base;\r
-using namespace Tizen::Base::Collection;\r
-using namespace Tizen::Base::Runtime;\r
-using namespace Tizen::Graphics;\r
-using namespace Tizen::Ui;\r
-using namespace Tizen::Ui::Controls;\r
-using namespace Tizen::Ui::Scenes;\r
-\r
-\r
-NotificationPanel::NotificationPanel(Form& aForm)\r
-:__pTimer(null)\r
-,__pLabel(null)\r
-,__form(aForm)\r
-,__position(0)\r
-{\r
-       Construct("IDL_NOTIFICATION_PANEL");\r
-}\r
-\r
-NotificationPanel::~NotificationPanel()\r
-{\r
-       if (__pTimer)\r
-       {\r
-               __pTimer->Cancel();\r
-               delete __pTimer;\r
-       }\r
-}\r
-\r
-void\r
-NotificationPanel::SetText(Tizen::Base::String& message)\r
-{\r
-       __pLabel = static_cast<Label*>(GetControl(L"IDC_NOTIFICATION_LABEL"));\r
-       if (__pLabel == null)\r
-       {\r
-               return;\r
-       }\r
-       __pLabel->SetText(message);\r
-}\r
-\r
-void\r
-NotificationPanel::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)\r
-{\r
-       SetShowState(false);\r
-       Invalidate(true);\r
-}\r
-\r
-void\r
-NotificationPanel::ShowNotification(void)\r
-{\r
-       SceneManager* pSceneManager = null;\r
-       if ( __pLabel != NULL)\r
-       {\r
-               AddControl(*__pLabel);\r
-               __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);\r
-       }\r
-       __form.AddControl(*this);\r
-\r
-       SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();\r
-\r
-       if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)\r
-       {\r
-        SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());\r
-        SetSize(__form.GetWidth(),GetHeight());\r
-       }\r
-       else\r
-    {\r
-               // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.\r
-               SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());\r
-       }\r
-       Invalidate(true);\r
-\r
-       __pTimer = new (std::nothrow) Timer;\r
-       if (__pTimer != NULL)\r
-       {\r
-               __pTimer->Construct(*this);\r
-               __pTimer->Start(2000);\r
-       }\r
-\r
-}\r
-\r
-void\r
-NotificationPanel::SetPositionDiff(int pos)\r
-{\r
-       __position = pos ;\r
-}\r
+//
+
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// !Internet
+/*@file:    IntNotification.cpp
+ *@brief:      This defines the behaviour of the Notification Class
+ *
+ */
+
+#include <FAppUiApp.h>
+#include <FUi.h>
+
+#include "IntNotificationPanel.h"
+#include "IntSceneRegister.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Runtime;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+NotificationPanel::NotificationPanel(Form& aForm)
+:__pTimer(null)
+,__pLabel(null)
+,__form(aForm)
+,__position(0)
+{
+       Construct("IDL_NOTIFICATION_PANEL");
+}
+
+NotificationPanel::~NotificationPanel()
+{
+       if (__pTimer)
+       {
+               __pTimer->Cancel();
+               delete __pTimer;
+       }
+}
+
+void
+NotificationPanel::SetText(Tizen::Base::String& message)
+{
+       __pLabel = static_cast<Label*>(GetControl(L"IDC_NOTIFICATION_LABEL"));
+       if (__pLabel == null)
+       {
+               return;
+       }
+       __pLabel->SetText(message);
+       __pLabel->SetTextConfig(32, LABEL_TEXT_STYLE_BOLD);
+       __pLabel->Invalidate(true);
+}
+
+void
+NotificationPanel::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
+{
+       SetShowState(false);
+       Invalidate(true);
+}
+
+void
+NotificationPanel::ShowNotification(void)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       if ( __pLabel != NULL)
+       {
+               AddControl(__pLabel);
+               __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
+       }
+       __form.AddControl(this);
+
+       SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
+
+       if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)
+       {
+        SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());
+        SetSize(__form.GetWidth(),GetHeight());
+       }
+       else
+    {
+               // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.
+               SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());
+       }
+       Invalidate(true);
+
+       __pTimer = new (std::nothrow) Timer;
+       if (__pTimer != NULL)
+       {
+               __pTimer->Construct(*this);
+               __pTimer->Start(2000);
+       }
+
+}
+
+void
+NotificationPanel::SetPositionDiff(int pos)
+{
+       __position = pos ;
+}
+
+void
+NotificationPanel::OrientationChanged()
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
+
+       if (sceneId == IDSCN_EDIT_HISTORY_LIST || sceneId == IDSCN_EDIT_BOOKMARK_LIST /*|| sceneId == IDSCN_SETTINGS*/)
+       {
+               SetPosition(0,__form.GetClientAreaBounds().height - GetHeight());
+               SetSize(__form.GetWidth(),GetHeight());
+       }
+       else
+       {
+               // Since there is a footer panel for the Main form need to subtract __position which is equal to footer panel height.
+               SetPosition(0,__form.GetClientAreaBounds().height -__position - GetHeight());
+       }
+       Invalidate(true);
+}