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 * @file FUi_ContainerImpl.h
20 * @brief This is the header file for the _ContainerImp interface.
22 * This header file contains the declarations of the %_ContainerImp interface.
25 #ifndef _FUI_INTERNAL_CONTAINER_IMPL_H_
26 #define _FUI_INTERNAL_CONTAINER_IMPL_H_
28 #include <FBaseColArrayList.h>
29 #include <FUiContainer.h>
30 #include "FUi_ControlImpl.h"
31 #include "FUi_SharedPtr.h"
33 namespace Tizen { namespace Ui
38 class _OSP_EXPORT_ _ContainerImpl
43 void Initialize(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout);
44 static _ContainerImpl* CreateContainerImplN(Container* pPublic);
45 static _ContainerImpl* CreateContainerImplN(Container* pPublic, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
46 static _ContainerImpl* CreateContainerImplN(Container* pPublic, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
47 virtual ~_ContainerImpl(void);
49 static _ContainerImpl* GetInstance(Container& container);
50 static const _ContainerImpl* GetInstance(const Container& container);
52 // [ToDo] Must consider transforOwnership flags.
53 virtual result Destroy(void);
54 result AddChild(_ControlImpl* pChild, bool transferOwnership = true);
55 result RemoveControl(_ControlImpl* pChild, bool deallocate = true);
56 result RemoveChild(_ControlImpl* pChild, bool deallocate = true);
57 result RemoveControl(int index);
58 result RemoveChild(int index);
59 void DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild = true, Tizen::Base::Collection::ArrayList* pChildrenList = null);
60 void RemoveAllChildren(bool detachSystemChild = true, bool callOnDetachingFromMainTree = false);
61 result MoveChildToTop(const _ControlImpl& child);
62 result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child);
65 result SetControlAlwaysOnTop(Control& control, bool alwaysOnTop);
66 result SetControlAlwaysAtBottom(Control& control, bool alwaysAtBottom);
67 bool IsControlAlwaysAtBottom(const Control& control) const;
68 bool IsControlAlwaysOnTop(const Control& control) const;
71 virtual const char* GetPublicClassName(void) const;
72 virtual const Container& GetPublic(void) const;
73 virtual Container& GetPublic(void);
75 Tizen::Base::Collection::IList* GetChildrenPublic(void) const;
76 _ControlImpl* GetChild(int index) const;
78 _ControlImpl* SearchControlByName(const Tizen::Base::String& name, bool recursive, bool searchMyself = false) const;
80 int GetChildIndex(const _ControlImpl* pChild) const;
81 int GetChildCount(void) const;
83 // [ToDo] It's returning public class instance. OK?
84 Layout* GetPublicPortraitLayoutN(void) const;
85 Layout* GetPublicLandscapeLayoutN(void) const;
86 Layout* GetPublicLayoutN(void) const;
88 result SetChildAt(const _ControlImpl* pChild, int index);
89 bool IsAncestorOf(const _ControlImpl* pChild) const;
92 virtual void OnDraw(void);
93 virtual void OnChangeLayout(_ControlOrientation orientation);
94 virtual void OnVisibleStateChanging(void);
95 virtual void OnVisibleStateChanged(void);
96 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
97 virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
98 virtual void OnBoundsChanged(void);
99 virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize);
100 virtual bool OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize);
102 void CallOnDraw(void);
105 _ContainerImpl(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout = null, const Layout* pPublicLandscapeLayout = null);
106 _ContainerImpl(Control* pPublic, _Control* pCore, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
107 _ContainerImpl(Control* pPublic, _Control* pCore, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
110 _ContainerImpl(const _ContainerImpl& rhs);
111 _ContainerImpl& operator =(const _ContainerImpl& rhs);
113 virtual bool IsChildAttachable(_ControlImpl& child) const;
114 result SetLayout(_Control& core, _ControlOrientation orientation, const Layout* pPublicLayout);
117 Tizen::Base::Collection::LinkedList __controlPublics;
118 _SharedPtr <Tizen::Ui::_LayoutImpl> __portraitLayout;
119 _SharedPtr <Tizen::Ui::_LayoutImpl> __landscapeLayout;
124 #endif // _FUI_INTERNAL_CONTAINER_IMPL_H_