2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file StWifiDirectAboutForm.cpp
19 * @brief This is the implementation file for WifiDirectAboutForm class.
22 #include "StResourceManager.h"
24 #include "StWifiDirectAboutForm.h"
26 using namespace Tizen::Base;
27 using namespace Tizen::Graphics;
28 using namespace Tizen::Ui;
29 using namespace Tizen::Ui::Controls;
30 using namespace Tizen::Ui::Scenes;
32 static const int ID_MAX_ITEM_COUNT = 0;
33 static const int ID_ITEM_COUNT = 3;
34 static const int XYH_BASE_POINT = 0;
36 WifiDirectAboutForm::WifiDirectAboutForm(void)
40 WifiDirectAboutForm::~WifiDirectAboutForm(void)
45 WifiDirectAboutForm::Initialize(void)
47 Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
53 WifiDirectAboutForm::CreateHeader(const Tizen::Base::String& textTitle)
55 Header* pHeader = GetHeader();
57 pHeader->SetStyle(HEADER_STYLE_TITLE);
58 pHeader->SetTitleText(textTitle);
62 WifiDirectAboutForm::CreateFooter(void)
64 Footer* pFooter = GetFooter();
67 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
68 pFooter->AddActionEventListener(*this);
70 SetFormBackEventListener(this);
74 WifiDirectAboutForm::CreateHelpText(const Rectangle& bounds)
77 Rectangle helpTitleRect;
78 Rectangle HelpContentsRect;
82 helpTitleRect = bounds;
83 helpTitleRect.height = H_HELP_TEXT_LINE;
85 HelpContentsRect = helpTitleRect;
86 HelpContentsRect.y = XYH_BASE_POINT;
87 HelpContentsRect.height = XYH_BASE_POINT;
89 itemHelp = ResourceManager::GetString(L"IDS_ST_BODY_WI_FI_DIRECT_HELP_MSG");
91 pLabel = new (std::nothrow) Label();
92 pLabel->Construct(bounds, itemHelp);
93 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
94 pLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
95 pLabel->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_BOLD);
96 pLabel->SetTextColor(COLOR_MAIN_TEXT);
102 WifiDirectAboutForm::CreateHelpTextView(void)
104 Rectangle bounds = GetClientAreaBounds();
105 bounds.x = X_HELP_TEXT_PAGE;
106 bounds.y = Y_HELP_TEXT_PAGE;
107 bounds.width -= (bounds.x * WIDTH_GAP);
109 CreateHelpText(bounds);
113 WifiDirectAboutForm::OnInitializing(void)
115 CreateHeader(ResourceManager::GetString(L"IDS_WIFI_BODY_ABOUT_WI_FI_DIRECT_ABB"));
116 CreateHelpTextView();
118 AppLogDebug("ENTER");
124 WifiDirectAboutForm::OnTerminating(void)
126 SetFormBackEventListener(null);
131 WifiDirectAboutForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
136 WifiDirectAboutForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
141 WifiDirectAboutForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
143 SceneManager* pSceneManager = SceneManager::GetInstance();
144 AppAssert(pSceneManager);
146 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);