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