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