2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @brief This is the header file for the _Window class.
21 * This header file contains the declarations of the %_Window class.
24 #ifndef _FUI_INTERNAL_WINDOW_H_
25 #define _FUI_INTERNAL_WINDOW_H_
27 #include <FUiWindow.h>
28 #include "FUi_Control.h"
30 namespace Tizen { namespace Ui { namespace Animations {
32 // #if defined(MULTI_WINDOW)
33 class _RootVisualElement;
36 }}} // Tizen::Ui::Animations
38 namespace Tizen { namespace Ui
41 class _IWindowDelegate
44 virtual ~_IWindowDelegate(void){}
46 virtual void OnActivated(void) = 0;
47 virtual void OnNativeWindowActivated(void) = 0;
48 virtual void OnDeactivated(void) = 0;
49 }; // _IWindowDelegate
51 class _OSP_EXPORT_ _Window // Temp: export only for test
53 , public _IWindowDelegate
54 , virtual public Tizen::Base::Runtime::IEventListener
55 , virtual public _IUiEventListener
56 , virtual public _IUiEventPreviewer
59 static _Window* CreateWindowN(void);
60 virtual ~_Window(void);
61 void SetWindowDelegate(_IWindowDelegate& delegate);
62 void ResetWindowDelegate(void);
63 virtual bool IsActivatedOnOpen(void) const;
64 bool IsAttached(void) const;
65 bool IsActivated(void) const;
66 WindowState GetWindowState(void) const;
67 void SetWindowState(WindowState windowState);
68 result Open(bool drawAndShow = true);
70 _Control* GetOwner(void) const;
71 void SetOwner(_Control* pOwner);
72 #if defined(MULTI_WINDOW)
73 result CreateRootVisualElement(void);
74 virtual result CreateLayer(void);
77 virtual bool IsFocusableDescendant(const _Control* pFocus) const;
80 virtual void OnActivated(void);
81 virtual void OnNativeWindowActivated(void);
82 virtual void OnDeactivated(void);
83 virtual void OnVisibleStateChanged(void);
84 virtual bool OnNotifiedN(const Tizen::Ui::_Control& source, Tizen::Base::Collection::IList* pArgs);
85 #if defined(MULTI_WINDOW)
86 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
87 virtual result OnAttachingToMainTree(const _Control* pParent);
88 virtual result OnDetachingFromMainTree(void);
90 virtual bool IsLayoutChangable(void) const;
93 #if defined(MULTI_WINDOW)
94 void SetActivationEnabled(bool enable);
95 bool IsActivationEnabled(void);
97 Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const;
99 virtual Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const;
101 NativeWindowHandle GetNativeHandle(void) const;
103 // Internal: Only necessary for implementing _Window. Never override this callback except for _Window.
104 virtual void OnChangeLayout(_ControlOrientation orientation);
106 Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const;
108 result SetZOrderGroup(int windowZOrderGroup);
109 bool IsSystemWindow(void) const;
113 _IWindowDelegate& GetWindowDelegate(void) const;
114 virtual Tizen::Base::String GetDescription(void) const;
116 #if defined(MULTI_WINDOW)
117 void SetRootVisualElement(const Tizen::Ui::Animations::_RootVisualElement& rootVisualElement);
120 void SetSystemWindow(bool systemWindow);
123 _Window(const _Window& rhs);
124 _Window& operator =(const _Window& rhs);
127 void Deactivate(void);
130 WindowState __windowState;
132 _IWindowDelegate* __pWindowDelegate;
136 Tizen::Ui::Animations::_RootVisualElement* __pRootVisualElement;
137 Tizen::Ui::Animations::_NativeLayer* __pLayer;
139 mutable Tizen::Ui::Animations::DisplayContext* __pDisplayContext;
142 bool __isInitialized;
144 friend class _ControlManager;
149 #endif // _FUI_INTERNAL_WINDOW_H_