Updated all header files to new format
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / navigation-view / navigation-view-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H
2 #define DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/actors/layer.h>
23 #include <list>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
27 #include <dali-toolkit/public-api/controls/control-impl.h>
28
29 namespace Dali
30 {
31 namespace Toolkit
32 {
33 class NavigationView;
34
35 namespace Internal
36 {
37 class NavigationBar;
38
39 /**
40  * @brief
41  *
42  * NavigationView implements a controller than manages the navigation of hierarchical contents.
43  */
44
45 class NavigationView : public Control
46 {
47 public:
48   /**
49    * Create an initialized NavigationView.
50    * @return A handle to a newly allocated Dali resource
51    */
52   static Toolkit::NavigationView New();
53
54   /**
55    * @copydoc Dali::Toolkit::NavigationView::Push()
56    */
57   void Push(Actor& actor);
58
59   /**
60    * @copydoc Dali::Toolkit::NavigationView::Pop()
61    */
62   Actor Pop();
63
64   /**
65    * Performs actions as requested using the action name.
66    * @param[in] object The object on which to perform the action.
67    * @param[in] actionName The action to perform.
68    * @param[in] properties The properties with which to perform this action.
69    * @return true if action has been accepted by this control
70    */
71   //static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& properties );
72
73 private: // override functions from Control
74   /**
75    * @copydoc Constrol::OnInitialize
76    */
77   virtual void OnInitialize() override;
78
79   /**
80    * @copydoc Control::OnSceneConnection( int depth  )
81    */
82   void OnSceneConnection(int depth) override;
83
84   /**
85    * @copydoc Control::OnRelayout()
86    */
87   //virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
88
89 protected:
90   /**
91    * Constructor.
92    * It initializes the NavigationView members
93    */
94   NavigationView();
95
96   /**
97    * A reference counted object may only be deleted by calling Unreference()
98    */
99   virtual ~NavigationView();
100
101 private:
102   // Undefined
103   NavigationView(const NavigationView&);
104
105   // Undefined
106   NavigationView& operator=(const NavigationView& rhs);
107
108 private:
109   std::vector<Actor> mContentStack;
110 };
111
112 } // namespace Internal
113
114 // Helpers for public-api forwarding methods
115
116 inline Toolkit::Internal::NavigationView& GetImpl(Toolkit::NavigationView& navigationView)
117 {
118   DALI_ASSERT_ALWAYS(navigationView);
119
120   Dali::RefObject& handle = navigationView.GetImplementation();
121
122   return static_cast<Toolkit::Internal::NavigationView&>(handle);
123 }
124
125 inline const Toolkit::Internal::NavigationView& GetImpl(const Toolkit::NavigationView& navigationView)
126 {
127   DALI_ASSERT_ALWAYS(navigationView);
128
129   const Dali::RefObject& handle = navigationView.GetImplementation();
130
131   return static_cast<const Toolkit::Internal::NavigationView&>(handle);
132 }
133
134 } // namespace Toolkit
135
136 } // namespace Dali
137
138 #endif // DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H