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