Fixed Nabi Issues: 53721,53372,53761,53768
[apps/osp/Internet.git] / src / IntSettingToggleCustomItem.cpp
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 //!Internet SettingToggleCustomItem class
19 /*@file:         SettingToggleCustomItem.cpp
20  *@brief:        The SettingToggleCustomItem
21  *
22  */
23
24 #include <FUiControls.h>
25
26 #include "IntCommonLib.h"
27 #include "IntSettingToggleCustomItem.h"
28
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::Graphics;
32 using namespace Tizen::Ui::Controls;
33
34 static const int IDA_FORMAT_STRING = 101;
35
36 SettingToggleCustomItem::SettingToggleCustomItem(void)
37 {
38         __text = L"";
39         __width = 0 ;
40         __height = 0 ;
41 }
42
43 SettingToggleCustomItem::~SettingToggleCustomItem(void)
44 {
45
46 }
47
48 result
49 SettingToggleCustomItem::Construct(int width, int height)
50 {
51         result r = E_FAILURE;
52
53         __fontSize = CommonUtil::GetFontSize();
54         __width = width;
55         __height = height;
56         const Dimension dim(width, height);
57         r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_ONOFF_SLIDING);
58
59         return r;
60 }
61
62 void
63 SettingToggleCustomItem::SetText(Tizen::Base::String& text)
64 {
65         __text = text;
66 }
67
68 String
69 SettingToggleCustomItem::GetText(void)
70 {
71         return __text;
72 }
73
74 result
75 SettingToggleCustomItem::Make(void)
76 {
77         const Color textColor = CUSTOM_COLOR_TRANSPARENT;
78         const Color pressedTextColor = CUSTOM_COLOR_TRANSPARENT;
79         const int X_Margin = 26;
80         const int Y_Margin = 26;
81         const int textSize = 40;
82
83         AddElement(Rectangle(X_Margin, Y_Margin, __width - 195, 60 + (__fontSize - 44)), IDA_FORMAT_STRING, __text, __fontSize, textColor, pressedTextColor, pressedTextColor, true);
84 //      SetElementSelectionEnabled(IDA_FORMAT_STRING, false);
85
86         return E_SUCCESS;
87 }