Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_Panel.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 /**
19  * @file                FUiCtrl_Panel.h
20  * @brief               This is the header file for the _Panel class.
21  *
22  * This header file contains the declarations of the _Panel class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_PANEL_H_
26 #define _FUI_CTRL_INTERNAL_PANEL_H_
27
28 #include <FUiCtrlGroupTypes.h>
29 #include "FUi_Control.h"
30 #include "FUiCtrl_PanelPresenter.h"
31
32 namespace Tizen { namespace Graphics
33 {
34
35 class Bitmap;
36
37 }} // Tizen::Graphics
38
39 namespace Tizen { namespace Ui { namespace Controls
40 {
41
42 enum _PanelBackgroundBitmapHorizontalAlign
43 {
44         PANEL_BACKGROUND_BITMAP_HORIZONTAL_ALIGN_LEFT,
45         PANEL_BACKGROUND_BITMAP_HORIZONTAL_ALIGN_CENTER,
46         PANEL_BACKGROUND_BITMAP_HORIZONTAL_ALIGN_RIGHT
47 };
48
49 enum _PanelBackgroundBitmapVerticalAlign
50 {
51         PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_TOP,
52         PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_MIDDLE,
53         PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_BOTTOM
54 };
55
56 class _OSP_EXPORT_ _Panel
57         : public _Control
58         , virtual public Tizen::Base::Runtime::IEventListener
59         , virtual public _IUiEventListener
60         , virtual public _IUiEventPreviewer
61 {
62 // Lifecycle
63 public:
64         virtual ~_Panel(void);
65
66 // Operations
67 public:
68         static _Panel* CreatePanelN(const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE);
69
70         virtual void OnDraw(void);
71
72         // Accessor
73         void SetBackgroundColor(const Tizen::Graphics::Color& color);
74
75         GroupStyle GetGroupStyle(void) const;
76         void SetGroupStyle(GroupStyle groupStyle);
77
78         Tizen::Graphics::Bitmap* GetGroupStyleBitmap(void) const;
79         Tizen::Graphics::Bitmap* GetGroupStyleBackgroundBitmap(void) const;
80
81         bool IsBackgroundBitmapStretch(void) const;
82         void SetBackgroundBitmapStretch(bool stretch);
83
84         _PanelBackgroundBitmapHorizontalAlign GetBackgroundBitmapHorizontalAlign(void) const;
85         void SetBackgroundBitmapHorizontalAlign(_PanelBackgroundBitmapHorizontalAlign align);
86
87         _PanelBackgroundBitmapVerticalAlign GetBackgroundBitmapVerticalAlign(void) const;
88         void SetBackgroundBitmapVerticalAlign(_PanelBackgroundBitmapVerticalAlign align);
89
90         void SetBackgroundBitmapAlign(_PanelBackgroundBitmapHorizontalAlign horizontalAlign, _PanelBackgroundBitmapVerticalAlign verticalAlign);
91
92         Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const;
93         void SetBackgroundBitmap(Tizen::Graphics::Bitmap* bitmap);
94
95 protected:
96         // Lifecycle
97         _Panel(void);
98
99         virtual result Initialize(const _PanelPresenter& presenter);
100
101         // Accessor
102         virtual result SetPanelPresenter(const _PanelPresenter* presenter);
103
104 // Copy constructor
105 private:
106         /**
107          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
108          *
109          * @since 2.0
110          *
111          */
112         _Panel(const _Panel& rhs);
113
114         /**
115          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
116          *
117          * @since 2.0
118          *
119          */
120         _Panel& operator =(const _Panel& rhs);
121
122 // Attribute
123 private:
124         _PanelPresenter* __pPanelPresenter;
125
126         GroupStyle __groupStyle;
127         Tizen::Graphics::Bitmap* __pGroupStyleBitmap;
128         Tizen::Graphics::Bitmap* __pGroupStyleBackgroundBitmap;
129
130         bool __backgroundBitmapStretch;
131         _PanelBackgroundBitmapHorizontalAlign __backgroundBitmapHorizontalAlign;
132         _PanelBackgroundBitmapVerticalAlign __backgroundBitmapVerticalAlign;
133         Tizen::Graphics::Bitmap* __pBackgroundBitmap;
134 }; // _Panel
135
136
137 }}} // Tizen::Ui::Controls
138
139 #endif // _FUI_CTRL_INTERNAL_PANEL_H_
140