Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_WindowImpl.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        FUi_WindowImpl.h
19  * @brief       This is the header file for the _WindowImpl class.
20  *
21  * This header file contains the declarations of the %_WindowImpl class.
22  */
23
24 #ifndef _FUI_INTERNAL_WINDOW_IMPL_H_
25 #define _FUI_INTERNAL_WINDOW_IMPL_H_
26
27 #include <FUiWindow.h>
28 #include "FUi_ContainerImpl.h"
29 #include "FUi_Window.h"
30
31 namespace Tizen { namespace Ui { namespace Animations {
32 class DisplayContext;
33 }}} // Tizen::Ui::Animations
34
35 namespace Tizen { namespace Ui
36 {
37
38 class _OSP_EXPORT_ _WindowImpl
39         : public _ContainerImpl
40 {
41 public:
42 // Constants
43         static WindowState GetErrorWindowState(void);
44
45 public:
46 // Life Cycle
47         void Initialize(Window* pPublic, _Window* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout);
48         static _WindowImpl* CreateWindowImplN(Window* pPublic, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
49         virtual ~_WindowImpl(void);
50
51         static _WindowImpl* GetInstance(Window& window);
52         static const _WindowImpl* GetInstance(const Window& window);
53         virtual const char* GetPublicClassName(void) const;
54         virtual const Window& GetPublic(void) const;
55         virtual Window& GetPublic(void);
56         virtual const _Window& GetCore(void) const;
57         virtual _Window& GetCore(void);
58
59 // Public Event Listeners
60         void AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
61         void RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener);
62
63         virtual void OnActivated(void);
64         virtual void OnNativeWindowActivated(void);
65         virtual void OnDeactivated(void);
66
67
68 #if !defined(MULTI_WINDOW)
69         virtual void Rotate(_ControlRotation rotation);
70 #else
71         virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
72         virtual void OnRotated(_ControlRotation rotation);
73 #endif
74
75 // Operations
76         result Open(bool drawAndShow = true);
77         void Close(void);
78         WindowState GetWindowState(void) const;
79         void SetWindowState(WindowState windowState); // [ToDo] Failed if the window is opened.
80         Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const;
81
82         result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup);
83         _Control* GetOwner(void) const;
84         void SetOwner(Tizen::Ui::Control *pControl);
85
86         NativeWindowHandle GetNativeHandle(void) const;
87
88 protected:
89         _WindowImpl(Window* pPublic, _Window* pCore, const Layout* pPublicPortraitLayout = null, const Layout* pPublicLandscapeLayout = null);
90         _WindowImpl(Window* pPublic, _Window* pCore, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
91 private:
92         _WindowImpl(const _WindowImpl& rhs);
93         _WindowImpl& operator =(const _WindowImpl& rhs);
94
95 private:
96         PublicEventListenerList* __pPublicWindowEventListeners;
97         class WindowImplDelegate;
98         WindowImplDelegate* __pImplDelegate;
99
100 }; // _WindowImpl
101
102 }} // Tizen::Ui
103
104 #endif // _FUI_INTERNAL_WINDOW_IMPL_H_