Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_FrameImpl.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 #ifndef _FUICTRL_INTERNAL_FRAME_IMPL_H_
18 #define _FUICTRL_INTERNAL_FRAME_IMPL_H_
19
20 #include <FUiCtrlFrame.h>
21 #include "FUi_WindowImpl.h"
22 #include "FUiCtrl_Frame.h"
23 #include "FUiCtrl_IFrameEventListener.h"
24
25 namespace Tizen { namespace Ui {
26 class _OrientationAgent;
27 } } // Tizen::Ui
28
29 namespace Tizen { namespace Ui { namespace Animations {
30 class FrameAnimator;
31 } } } // Tizen::Ui::Animations
32
33 namespace Tizen { namespace Ui { namespace Controls {
34
35 class _FormImpl;
36 class _PublicFrameEvent;
37 class IFrameEventListener;
38
39 class _FrameImpl
40         : public _WindowImpl
41         , public _IFrameEventListener
42 {
43 // Lifecycle
44 public:
45         static _FrameImpl* CreateFrameImplN(Frame* pControl);
46         virtual ~_FrameImpl();
47
48 // Common
49         virtual const char* GetPublicClassName(void) const;
50         virtual const Frame& GetPublic(void) const;
51         virtual Frame& GetPublic(void);
52         virtual const _Frame& GetCore(void) const;
53         virtual _Frame& GetCore(void);
54
55 // Form managing
56         result SetCurrentForm(const _FormImpl& formImpl);
57         _FormImpl* GetCurrentForm(void) const;
58
59 // Event listeners
60         void AddOrientationEventListener(Tizen::Ui::IOrientationEventListener& listener);
61         void AddFrameEventListener(Tizen::Ui::Controls::IFrameEventListener& listener);
62         void RemoveOrientationEventListener(Tizen::Ui::IOrientationEventListener& listener);
63         void RemoveFrameEventListener(Tizen::Ui::Controls::IFrameEventListener& listener);
64
65 // Orientation
66         Tizen::Ui::Orientation GetOrientation(void) const;
67         Tizen::Ui::OrientationStatus GetOrientationStatus(void) const;
68         void SetOrientation(Tizen::Ui::Orientation orientation);
69         void UpdateOrientationStatus(void);
70
71 // Callback
72         virtual void OnDraw(void);
73         virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
74         virtual void OnChildDetaching(const _Control& child);
75         virtual void OnChildDetached(const _Control& child);
76         virtual void OnFrameActivated(const _Frame& source);
77         virtual void OnFrameDeactivated(const _Frame& source);
78         virtual void OnBoundsChanged(void);
79
80 // Animator
81         Tizen::Ui::Animations::FrameAnimator* GetFrameAnimator(void) const;
82
83 // Drawing
84         virtual bool IsOpaque(void) const;
85
86 // Floating
87         void SetFloatingBounds(const Tizen::Graphics::Rectangle& rect);
88         result SetShowMode(FrameShowMode showMode);
89         FrameShowMode GetShowMode(void) const;
90
91         static const _FrameImpl* GetInstance(const Frame& frame);
92         static _FrameImpl* GetInstance(Frame& frame);
93
94 protected:
95         _FrameImpl(Frame* pPublic, _Frame* pCore);
96         void Dispose(void);
97
98 private:
99         virtual bool IsChildAttachable(Tizen::Ui::_ControlImpl& child) const;
100
101 // Attribute
102 private:
103         _PublicFrameEvent* __pFrameEvent;
104         Tizen::Ui::Animations::FrameAnimator* __pFrameAnimator;
105         Tizen::Ui::_OrientationAgent* __pOrientationAgent;
106 }; // _FrameImpl
107
108 }}}     // Tizen::Ui::Controls
109
110 #endif // _FUICTRL_INTERNAL_FRAME_IMPL_H_