Arrange code
[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.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
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 /**
18  *@file:    DropDownCustomItem
19  *@brief:       This class defines common behaviour of Drop down custom Item.
20  *
21  */
22
23 #ifndef _GL_DROPDOWN_CUSTOM_ITEM_H_
24 #define _GL_DROPDOWN_CUSTOM_ITEM_H_
25
26 #include <FUi.h>
27
28 enum DropDownItemState
29 {
30         DROP_DOWN_ITEM_STATE_OPENED = 0,
31         DROP_DOWN_ITEM_STATE_CLOSED
32 };
33
34 class DropDownCustomItem
35         : public Tizen::Ui::Controls::CustomItem
36 {
37 public:
38         DropDownCustomItem(void);
39         virtual ~DropDownCustomItem(void);
40
41         result Construct(int width, int height);
42
43         DropDownItemState GetCurState(void) const;
44         Tizen::Base::String GetMainText(void) const;
45         Tizen::Base::String GetSubText(void) const;
46         result Make(int fontsize, int itemHeight);
47         void SetCurState(const DropDownItemState);
48         void SetMainText(const Tizen::Base::String& text);
49         void SetSubText(const Tizen::Base::String& text);
50
51  protected:
52         static const int IDA_FORMAT_BITMAP;
53         static const int IDA_FORMAT_MAIN_STRING;
54         static const int IDA_FORMAT_SUB_STRING;
55         static const int IDA_FORMAT_DROPPER;
56
57  private:
58         DropDownItemState __currentState;
59         int __height;
60         int __width;
61         Tizen::Base::String __mainText;
62         Tizen::Base::String __subText;
63  };
64
65 #endif /* _GL_DROPDOWN_CUSTOM_ITEM_H_ */