Tizen 2.0 Release
[apps/osp/Internet.git] / inc / IntDropDownCustomItem.h
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (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 //!Internet
18 /*@file:    DropDownCustomItem
19  *@brief:       This class defines common behaviour of Drop down custom Item.
20  *
21  */
22
23 #ifndef _INT_DROPDOWN_CUSTOM_ITEM_H_
24 #define _INT_DROPDOWN_CUSTOM_ITEM_H_
25
26
27 #include <FBase.h>
28 #include <FGraphics.h>
29
30 enum DropDownItemState
31 {
32         DROP_DOWN_ITEM_STATE_OPENED = 0,
33         DROP_DOWN__ITEM_STATE_CLOSED
34 };
35
36 class DropDownCustomItem
37         : public Tizen::Ui::Controls::CustomItem
38 {
39
40 public:
41         /**
42          * Initializes this instance of DropDownCustomItem.
43          */
44         result Construct(int width);
45
46
47         /**
48          * @brief The Default constructor
49          */
50         DropDownCustomItem(void);
51
52
53         /**
54          * @brief The Default Destructor
55          */
56         virtual ~DropDownCustomItem(void);
57
58         //getter and setter methods for Main Text
59
60         /**
61          * @brief The method used to get the Title text of CustomItem
62          */
63         DropDownItemState GetCurState(void);
64
65         /**
66          * @brief The method used to get the Title text of CustomItem
67          */
68         Tizen::Base::String GetMainText(void);
69
70         /**
71          * @brief The method used to get the Sub text of CustomItem
72          */
73         Tizen::Base::String GetSubText(void);
74
75         /**
76          * @brief Add all the required elements and create the Custom Item.
77          *
78          */
79         result Make(void);
80
81         /**
82          * @brief The method used to set the Title text of CustomItem
83          */
84         void SetCurState(DropDownItemState);
85
86         /**
87          * @brief The method used to set the Title text of CustomItem
88          */
89         void SetMainText(const Tizen::Base::String& text);
90
91         /**
92          * @brief The method used to set the Sub text of CustomItem
93          */
94         void SetSubText(const Tizen::Base::String& text);
95
96 protected:
97         static const int IDA_FORMAT_BITMAP;
98         static const int IDA_FORMAT_MAIN_STRING;
99         static const int IDA_FORMAT_SUB_STRING;
100         static const int IDA_FORMAT_DROPPER;
101
102 private:
103         DropDownItemState __currentState;
104         int __height;       ///Height of the SettingToggleCustomItem Instance
105         int __width;        ///Width of the SettingToggleCustomItem Instance
106
107         Tizen::Base::String __mainText;   ///The MainText for the Toggle Button
108         Tizen::Base::String __subText;    ///The SubText for the Toggle Button
109 };
110
111 #endif /* _INT_DROPDOWN_CUSTOM_ITEM_H_ */