Fixed to decide the position of the mini App
[platform/framework/native/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 Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0/
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.1
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 void OnFrameMinimized(void);
63         virtual void OnFrameRestored(void);
64         virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
65         virtual result OnAttached(void);
66         virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor);
67
68 // Current form
69         void SetCurrentForm(const Tizen::Ui::Controls::_Form* pForm);
70         Tizen::Ui::Controls::_Form* GetCurrentForm(void) const;
71
72 // Orientation
73         virtual bool IsOrientationRoot(void) const;
74         void SetRotation(bool rotation);
75
76 // Event listeners
77         void AddFrameEventListener(const Tizen::Ui::Controls::_IFrameEventListener& listener);
78         void RemoveFrameEventListener(const Tizen::Ui::Controls::_IFrameEventListener& listener);
79         void SetFormActivationChangeEventListener(const Tizen::Ui::Controls::_IFormActivationChangeEventListener* plistener);
80
81 // Floating
82         void SetFloatingBounds(const Tizen::Graphics::Rectangle& rect);
83         void SetFloatingBounds(const Tizen::Graphics::FloatRectangle& rect);
84         void SetFloatingOrientation(Tizen::Ui::_ControlOrientation orientation);
85         result SetShowMode(FrameShowMode showMode);
86         FrameShowMode GetShowMode(bool minimize = true) const;
87         bool IsActivated(void) const;
88
89 // Focus Ui
90         virtual void ResetFocusList(void);
91         virtual Tizen::Base::Collection::IListT<_Control*>* GetFocusList(void) const;
92         virtual _Control* GetFocusTraversalControl(_Control* pControl) const;
93         virtual void SetFocusTraversalControl(_Control* pControl);
94
95 // Focus
96         virtual _Control* GetFocusControl(const _Control* pControl) const;
97         virtual _Control* GetCurrentFocusControl(void) const;
98         virtual void SetFocusControl(const _Control* pControl, bool on);
99
100 // Internal
101         void SetChangingBoundsEnabled(bool enable);
102
103 protected:
104         result SetPresenter(const _FramePresenter& framePresenter);
105
106 private:
107         _Frame(void);
108         _Frame(const _Frame&);
109         _Frame& operator =(const _Frame&);
110
111 // Attribute
112 private:
113         _FramePresenter* __pFramePresenter;
114         _FrameEvent* __pFrameEvent;
115         Tizen::Graphics::FloatRectangle __floatingBounds;
116         Tizen::Ui::_ControlOrientation __floatingOrientation;
117         FrameShowMode __showMode;
118         bool __restore;
119         bool __minimized;
120         bool __activated;
121         bool __constructed;
122         bool __rotation;
123         bool __changingBoundsEnabled;
124         _IFormActivationChangeEventListener* __pFormActivationChangeEventListener;
125 }; // _Frame
126
127 }}} // Tizen::Ui::Controls
128
129 #endif // _FUICTRL_INTERNAL_FRAME_H_