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.
18 * @file FUi_ContainerImpl.h
19 * @brief This is the header file for the _ContainerImp interface.
21 * This header file contains the declarations of the %_ContainerImp interface.
24 #ifndef _FUI_INTERNAL_CONTAINER_IMPL_H_
25 #define _FUI_INTERNAL_CONTAINER_IMPL_H_
27 #include <FUiContainer.h>
28 #include "FUi_ControlImpl.h"
29 #include "FUi_SharedPtr.h"
31 namespace Tizen { namespace Ui
36 class _OSP_EXPORT_ _ContainerImpl
41 void Initialize(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout);
42 static _ContainerImpl* CreateContainerImplN(Container* pPublic);
43 static _ContainerImpl* CreateContainerImplN(Container* pPublic, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
44 virtual ~_ContainerImpl(void);
46 static _ContainerImpl* GetInstance(Container& container);
47 static const _ContainerImpl* GetInstance(const Container& container);
49 // [ToDo] Must consider transforOwnership flags.
50 result AddChild(_ControlImpl* pChild, bool transferOwnership = true);
51 result RemoveChild(_ControlImpl* pChild, bool deallocate = true);
52 result RemoveChild(int index);
53 void RemoveAllChildren(bool detachSystemChild = true);
54 result MoveChildToTop(const _ControlImpl& child);
55 result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child);
58 result SetControlAlwaysOnTop(Control& control, bool alwaysOnTop);
59 result SetControlAlwaysAtBottom(Control& control, bool alwaysAtBottom);
60 bool IsControlAlwaysAtBottom(const Control& control) const;
61 bool IsControlAlwaysOnTop(const Control& control) const;
64 virtual const char* GetPublicClassName(void) const;
65 virtual const Container& GetPublic(void) const;
66 virtual Container& GetPublic(void);
68 Tizen::Base::Collection::IList* GetChildrenPublic(void) const;
69 _ControlImpl* GetChild(int index) const;
71 _ControlImpl* SearchControlByName(const Tizen::Base::String& name, bool recursive, bool searchMyself = false) const;
73 int GetChildIndex(const _ControlImpl* pChild) const;
74 int GetChildCount(void) const;
76 // [ToDo] It's returning public class instance. OK?
77 Layout* GetPublicPortraitLayoutN(void) const;
78 Layout* GetPublicLandscapeLayoutN(void) const;
79 Layout* GetPublicLayoutN(void) const;
81 result SetChildAt(const _ControlImpl* pChild, int index);
82 bool IsAncestorOf(const _ControlImpl* pChild) const;
85 virtual void OnDraw(void);
86 virtual void OnChangeLayout(_ControlOrientation orientation);
87 virtual void OnVisibleStateChanging(void);
88 virtual void OnVisibleStateChanged(void);
89 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
90 virtual void OnBoundsChanged(void);
91 virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize);
93 void CallOnDraw(void);
96 _ContainerImpl(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout = null, const Layout* pPublicLandscapeLayout = null);
97 _ContainerImpl(Control* pPublic, _Control* pCore, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable);
100 _ContainerImpl(const _ContainerImpl& rhs);
101 _ContainerImpl& operator =(const _ContainerImpl& rhs);
103 virtual bool IsChildAttachable(_ControlImpl& child) const;
104 result SetLayout(_Control& core, _ControlOrientation orientation, const Layout* pPublicLayout);
107 Tizen::Base::Collection::LinkedList __controlPublics;
108 _SharedPtr <Tizen::Ui::_LayoutImpl> __portraitLayout;
109 _SharedPtr <Tizen::Ui::_LayoutImpl> __landscapeLayout;
114 #endif // _FUI_INTERNAL_CONTAINER_IMPL_H_