Tizen 2.1 base
[sdk/ide/native-sample.git] / samples / native / cpp / Sample / Tizen C++ / UiVisualElement / UiVisualElement / project / inc / MainForm.h
1 //
2 // Tizen C++ SDK
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://www.tizenopensource.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 #ifndef _MAIN_FORM_H_
19 #define _MAIN_FORM_H_
20
21 #include <FApp.h>
22 #include <FBase.h>
23 #include <FGraphics.h>
24 #include <FUi.h>
25 #include <FUiControls.h>
26
27 class MainForm
28         : public Osp::Ui::Controls::Form
29         , public Osp::Ui::Controls::IListViewItemEventListener
30         , public Osp::Ui::Controls::IListViewItemProvider
31 {
32 public:
33         MainForm(void);
34         virtual ~MainForm(void);
35         bool Initialize(void);
36
37         virtual result OnInitializing(void);
38
39         virtual int  GetItemCount(void);
40         virtual Osp::Ui::Controls::ListItemBase*  CreateItem (int index, int itemWidth);
41         virtual bool DeleteItem(int index, Osp::Ui::Controls::ListItemBase *pItem, int itemWidth);
42         virtual void OnListViewItemStateChanged(Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListItemStatus status);
43         virtual void OnListViewItemSwept(Osp::Ui::Controls::ListView &listView, int index, Osp::Ui::Controls::SweepDirection direction);
44         virtual void OnListViewContextItemStateChanged(Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListContextItemStatus state);
45         virtual void OnItemReordered(Osp::Ui::Controls::ListView &view, int oldIndex, int newIndex);
46
47         void InitializeListViewMainMenuNameArray(void);
48         void InitializeHeader(void);
49         void InitializeListViewMainMenu(void);
50
51 private:
52         static const int LIST_VIEW_MAIN_MENU_COUNT      = 13;
53
54         Osp::Ui::Controls::Header* __pHeader;
55         Osp::Ui::Controls::ListView* __pListViewMainMenu;
56
57         Osp::Base::String __listViewMainMenuNameArray[LIST_VIEW_MAIN_MENU_COUNT];
58 };
59
60 #endif // _MAIN_FORM_H_