Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_Frame.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_Frame.h
19  * @brief               This is the header file for the _Frame class.
20  *
21  * This header file contains the declarations of the %_Frame class.
22  */
23 #ifndef _FUICTRL_INTERNAL_FRAME_H_
24 #define _FUICTRL_INTERNAL_FRAME_H_
25
26 #include <FUiCtrlFrameTypes.h>
27 #include "FUi_Window.h"
28
29 namespace Tizen { namespace Ui { namespace Controls {
30
31 class _FramePresenter;
32 class _FrameEvent;
33 class _IFrameEventListener;
34 class _IFormActivationChangeEventListener;
35 class _Form;
36
37 /**
38  * @class _Frame
39  * @brief
40  * @since 2.0
41  */
42
43 class _OSP_EXPORT_ _Frame
44         : public Tizen::Ui::_Window
45         , virtual public Tizen::Base::Runtime::IEventListener
46         , virtual public Tizen::Ui::_IUiEventListener
47         , virtual public Tizen::Ui::_IUiEventPreviewer
48 {
49 // Lifecycle
50 public:
51         static _Frame* CreateFrameN(void);
52         virtual ~_Frame(void);
53
54 // Callbacks
55         virtual void OnDraw(void);
56         virtual void OnActivated(void);
57         virtual void OnChildAttached(const Tizen::Ui::_Control& child);
58         virtual void OnChildDetached(const Tizen::Ui::_Control& child);
59         virtual bool OnNotifiedN(const Tizen::Ui::_Control& source, Tizen::Base::Collection::IList* pArgs);
60         virtual void OnFrameActivated(void);
61         virtual void OnFrameDeactivated(void);
62         virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
63         virtual result OnAttached(void);
64 #if !defined(MULTI_WINDOW)
65         virtual result OnAttachedToMainTree(void);
66         virtual void OnVisibleStateChanged(void);
67 #endif
68
69 // Current form
70         void SetCurrentForm(const Tizen::Ui::Controls::_Form* pForm);
71         Tizen::Ui::Controls::_Form* GetCurrentForm(void) const;
72
73 // Focus
74         virtual bool IsFocusableDescendant(const Tizen::Ui::_Control* pFocus) const;
75         virtual void SetFocusOff(Tizen::Ui::_Control* pFocus);
76
77 #if !defined(MULTI_WINDOW)
78 // Orientation
79         virtual bool IsLayoutChangable(void) const;
80 #endif
81         virtual bool IsOrientationRoot(void) const;
82
83 // Event listeners
84         void AddFrameEventListener(const Tizen::Ui::Controls::_IFrameEventListener& listener);
85         void RemoveFrameEventListener(const Tizen::Ui::Controls::_IFrameEventListener& listener);
86         void SetFormActivationChangeEventListener(const Tizen::Ui::Controls::_IFormActivationChangeEventListener* plistener);
87
88 // Floating
89         void SetFloatingBounds(const Tizen::Graphics::Rectangle& rect);
90         result SetShowMode(FrameShowMode showMode);
91         FrameShowMode GetShowMode(void) const;
92         bool IsActivated(void) const;
93
94 protected:
95         result SetPresenter(const _FramePresenter& framePresenter);
96
97 private:
98         _Frame(void);
99         _Frame(const _Frame&);
100         _Frame& operator =(const _Frame&);
101
102 // Attribute
103 private:
104         _FramePresenter* __pFramePresenter;
105         _FrameEvent* __pFrameEvent;
106         Tizen::Graphics::Rectangle __floatingBounds;
107         FrameShowMode __showMode;
108         bool __restore;
109         bool __activated;
110         _IFormActivationChangeEventListener* __pFormActivationChangeEventListener;
111 }; // _Frame
112
113 }}} // Tizen::Ui::Controls
114
115 #endif // _FUICTRL_INTERNAL_FRAME_H_