Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_OptionMenuImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 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 /**
18  * @file                FUiCtrl_OptionMenuImpl.h
19  * @brief               This is the header file for the _OptionMenuImpl class.
20  */
21
22 #ifndef _FUI_CTRL_INTERNAL_OPTION_MENU_IMPL_H_
23 #define _FUI_CTRL_INTERNAL_OPTION_MENU_IMPL_H_
24
25 #include <FUiCtrlOptionMenu.h>
26
27 #include "FUiCtrl_OptionMenu.h"
28 #include "FUiCtrl_IActionEventListener.h"
29 #include "FUi_WindowImpl.h"
30
31 namespace Tizen { namespace Ui { namespace Controls
32 {
33
34 class _PublicActionEvent;
35
36 class _OptionMenuImpl
37         : public Tizen::Ui::_WindowImpl
38         , public _IActionEventListener
39         , virtual public Tizen::Base::Runtime::IEventListener
40 {
41 public:
42         result AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
43
44         result RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
45
46         result AddItem(const Tizen::Base::String& text, int actionId);
47
48         result InsertItemAt(int mainIndex, const Tizen::Base::String& text, int actionId);
49
50         result SetItemAt(int mainIndex, const Tizen::Base::String& text, int actionId);
51
52         result RemoveItemAt(int mainIndex);
53
54         int GetItemCount(void) const;
55
56         int GetItemIndexFromActionId(int actionId) const;
57
58         int GetItemActionIdAt(int mainIndex) const;
59
60         result AddSubItem(int mainIndex, const Tizen::Base::String& text, int actionId);
61
62         result InsertSubItemAt(int mainIndex, int subIndex, const Tizen::Base::String& text, int actionId);
63
64         result SetSubItemAt(int mainIndex, int subIndex, const Tizen::Base::String& text, int actionId);
65
66         result RemoveSubItemAt(int mainIndex, int subIndex);
67
68         int GetSubItemCount(int mainIndex) const;
69
70         int GetSubItemIndexFromActionId(int actionId) const;
71
72         int GetSubItemActionIdAt(int mainIndex, int subIndex) const;
73
74         virtual const char* GetPublicClassName(void) const;
75
76         virtual const OptionMenu& GetPublic(void) const;
77
78         virtual OptionMenu& GetPublic(void);
79
80         virtual const _OptionMenu& GetCore(void) const;
81
82         virtual _OptionMenu& GetCore(void);
83
84         virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
85
86         virtual ~_OptionMenuImpl(void);
87
88         static _OptionMenuImpl* GetInstance(OptionMenu& optionMenu);
89
90         static const _OptionMenuImpl* GetInstance(const OptionMenu& optionMenu);
91
92         static _OptionMenuImpl* CreateOptionMenuImplN(OptionMenu& control);
93
94         virtual result OnAttachedToMainTree(void);
95
96 private:
97         _OptionMenuImpl(OptionMenu* pPublic, _OptionMenu* pCore);
98
99         _OptionMenuImpl(const _OptionMenuImpl&);
100
101         _OptionMenuImpl& operator =(const _OptionMenuImpl&);
102
103 private:
104         _PublicActionEvent* __pPublicActionEvent;
105 }; // _OptionMenuImpl
106
107 }}} // Tizen::Ui::Controls
108
109 #endif  // _FUI_CTRL_INTERNAL_OPTION_MENU_IMPL_H_