[dali_2.3.25] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / navigation-view / navigation-view.h
1 #ifndef DALI_TOOLKIT_NAVIGATION_VIEW_H
2 #define DALI_TOOLKIT_NAVIGATION_VIEW_H
3
4 /*
5  * Copyright (c) 2022 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23 #include <dali/public-api/animation/alpha-function.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29 namespace Internal DALI_INTERNAL
30 {
31 // Forward declarations
32 class NavigationView;
33 } // namespace DALI_INTERNAL
34
35 /**
36  * @brief NavigationView implements a view that manages the navigation of hierarchical contents.
37  *
38  * An Actor is pushed onto the NavigationView, itself and its children are added to the stage.
39  * The actors currently shown are replaced.
40  * When pop is called on the NavigationView, the current tree of Actors are removed and the previous set added back.
41  * If pop is called on the last set of Actors then they remain, nothing is popped.
42  */
43 class DALI_TOOLKIT_API NavigationView : public Control
44 {
45 public:
46   /**
47    * @brief Create a NavigationView handle; this can be initialize with NavigationView::New().
48    *
49    * @note Calling member function with an uninitialized handle is not allowed.
50    */
51   NavigationView();
52
53   /**
54    * @brief Copy Constructor.
55    * @param[in] handle Handle to copy.
56    */
57   NavigationView(const NavigationView& handle);
58
59   /**
60    * @brief Assignment operator.
61    * @param[in] handle The handle to copy from.
62    * @return reference to this
63    */
64   NavigationView& operator=(const NavigationView& handle);
65
66   /**
67    * @brief Move Constructor.
68    * @param[in] handle Handle to move.
69    */
70   NavigationView(NavigationView&& handle);
71
72   /**
73    * @brief Move assignment operator.
74    * @param[in] handle The handle to move from.
75    * @return reference to this
76    */
77   NavigationView& operator=(NavigationView&& handle);
78
79   /**
80    * @brief Destructor
81    *
82    * This is non-virtual since derived Handle types must not contain data or virtual methods.
83    */
84   ~NavigationView();
85
86   /**
87    * @brief  Create an initialized NavigationView.
88    *
89    * @return A handle to a newly allocated Dali resource.
90    */
91   static NavigationView New();
92
93   /**
94    * @brief Downcast an object handle to NavigationView.
95    *
96    * @details If handle points to a NavigationView, the downcast produces a valid handle.
97    * If not, the returned handle is left uninitialized.
98    * @param[in] handle Handle to an object.
99    * @return handle to a NavigationView of an uninitialized handle.
100    */
101   static NavigationView DownCast(BaseHandle handle);
102
103   /**
104    * @brief Push a new actor tree to the top of the NavigationView stack and show it.
105    * @param[in] item An actor tree.
106    */
107   void Push(Actor item);
108
109   /**
110    * @brief Pop the actor tree that is on the top of the NavigationView stack and make it disappear.
111    *
112    * @return The Actor tree popped out.
113    *
114    * @note It does not pop out the last item in the stack.
115    * It returns an uninitialized item handle if there is no item or only one item in the stack.
116    */
117   Actor Pop();
118
119 public: // Not intended for application developers
120         /// @cond internal
121   /**
122    * Creates a handle using the Toolkit::Internal implementation.
123    * @param[in]  implementation  The Control implementation.
124    */
125   DALI_INTERNAL NavigationView(Internal::NavigationView& implementation);
126
127   /**
128    * Allows the creation of this Control from an Internal::CustomActor pointer.
129    * @param[in]  internal  A pointer to the internal CustomActor.
130    */
131   explicit DALI_INTERNAL NavigationView(Dali::Internal::CustomActor* internal);
132   /// @endcond
133 }; // class NavigationView
134
135 } // namespace Toolkit
136
137 } // namespace Dali
138
139 #endif // DALI_TOOLKIT_NAVIGATION_VIEW_H