New Navigation View Control 81/90381/10
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 29 Sep 2016 14:57:07 +0000 (15:57 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 12 Oct 2016 16:49:06 +0000 (09:49 -0700)
A View which allows the pushing and popping of views as a stack.
Pushing new content will pop off existing content, showing the new.
Popping the new content will will pop off the current content and show previous.

Change-Id: Icef8f7f90510c1919ed7cc49babe8128c477cac7

automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp [new file with mode: 0644]
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/controls/navigation-view/navigation-view.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/navigation-view/navigation-view.h [new file with mode: 0644]
dali-toolkit/devel-api/file.list
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.h [new file with mode: 0644]
dali-toolkit/internal/file.list

index d6ad543..6031392 100644 (file)
@@ -41,6 +41,7 @@ SET(TC_SOURCES
    utc-Dali-ItemView.cpp
    utc-Dali-KeyboardFocusManager.cpp
    utc-Dali-Magnifier.cpp
+   utc-Dali-NavigationView.cpp
    utc-Dali-Popup.cpp
    utc-Dali-ProgressBar.cpp
    utc-Dali-PushButton.cpp
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp
new file mode 100644 (file)
index 0000000..e91b2cc
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <sstream>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+void dali_navigationView_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_navigationView_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliNavigationTypeRegistry(void)
+{
+  ToolkitTestApplication application;
+
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+  DALI_TEST_CHECK( typeRegistry );
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "NavigationView" );
+  DALI_TEST_CHECK( typeInfo );
+
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+
+  NavigationView view = NavigationView::DownCast( handle );
+  DALI_TEST_CHECK( view );
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewNew(void)
+{
+  ToolkitTestApplication application;
+
+  NavigationView navigationView;
+  DALI_TEST_CHECK( !navigationView );
+
+  navigationView = NavigationView::New();
+  DALI_TEST_CHECK( navigationView );
+
+  Stage::GetCurrent().Add( navigationView );
+
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewCopyAndAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  NavigationView view = NavigationView::New();
+  DALI_TEST_CHECK( view );
+
+  NavigationView copy( view );
+  DALI_TEST_CHECK( copy == view );
+
+  NavigationView assign;
+  DALI_TEST_CHECK( !assign );
+  assign = view;
+  DALI_TEST_CHECK( assign == view );
+
+  // Self assignment
+  assign = assign;
+  DALI_TEST_CHECK( assign );
+  DALI_TEST_CHECK( assign == view );
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewDownCast(void)
+{
+  ToolkitTestApplication application;
+
+  BaseHandle view = NavigationView::New();
+  DALI_TEST_CHECK( NavigationView::DownCast( view ) );
+
+  BaseHandle empty;
+  DALI_TEST_CHECK( ! NavigationView::DownCast( empty ) );
+
+  BaseHandle another = Actor::New();
+  DALI_TEST_CHECK( ! NavigationView::DownCast( another ) );
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewPush(void)
+{
+  ToolkitTestApplication application;
+
+  Stage stage = Stage::GetCurrent();
+
+  // 1 Create and Add Navigation View to stage, actor count should be zero
+  NavigationView naviView = NavigationView::New();
+  stage.Add( naviView );
+
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 0,  TEST_LOCATION );
+
+  // 2 Add Actor to Navigation View, actor count should increase to 1
+
+  Actor TestParentActor1 = Actor::New();
+  naviView.Push( TestParentActor1 );
+
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 1,  TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewPop(void)
+{
+  ToolkitTestApplication application;
+
+  Stage stage = Stage::GetCurrent();
+
+  // 1 Create Navigation View
+  NavigationView naviView = NavigationView::New();
+  stage.Add( naviView );
+
+  // 2 Push initial Actor
+  Actor testParentActor1 = Actor::New();
+  testParentActor1.SetName("TestParentActor1");
+  naviView.Push( testParentActor1 );
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 1 ,  TEST_LOCATION );
+
+  // 3 Push Second Actor which contains a child actor
+  Actor testParentActor2 = Actor::New();
+  testParentActor2.SetName("TestParentActor2");
+  Actor testChildActor1 = Actor::New();
+  testParentActor2.Add( testChildActor1 );
+  naviView.Push( testParentActor2 );
+
+
+  // 4 Pop head actor, it should be TestParentActor2
+  Actor poppedActor = naviView.Pop();
+  DALI_TEST_EQUALS( poppedActor.GetName() ,  "TestParentActor2", TEST_LOCATION );
+
+  // 5 Navigation View child count should be 1
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 1 ,  TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewPushAndPop(void)
+{
+  ToolkitTestApplication application;
+
+  Stage stage = Stage::GetCurrent();
+
+  // 1 Create Navigation View
+  NavigationView naviView = NavigationView::New();
+  stage.Add( naviView );
+
+  // 2 Push initial Actor
+  Actor testParentActor1 = Actor::New();
+  testParentActor1.SetName("TestParentActor1");
+  naviView.Push( testParentActor1 );
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 1 ,  TEST_LOCATION );
+
+  // 3 Push Second Actor which contains a child actor
+  Actor testParentActor2 = Actor::New();
+  testParentActor2.SetName("TestParentActor2");
+  Actor testChildActor1 = Actor::New();
+  testParentActor2.Add( testChildActor1 );
+  naviView.Push( testParentActor2 );
+
+  // 3 Push third Actor which contains a child actor
+  Actor testParentActor3 = Actor::New();
+  testParentActor3.SetName("TestParentActor3");
+  Actor testChildActor2 = Actor::New();
+  testParentActor2.Add( testChildActor2 );
+  naviView.Push( testParentActor3 );
+
+  // 4 Pop head actor,  it should be TestParentActor3
+  Actor poppedActor = naviView.Pop();
+  DALI_TEST_EQUALS( poppedActor.GetName() ,  "TestParentActor3", TEST_LOCATION );
+
+  // 5 Pop head actor,  it should be TestParentActor2
+  Actor poppedActor2 = naviView.Pop();
+  DALI_TEST_EQUALS( poppedActor2.GetName() ,  "TestParentActor2", TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+int UtcDaliNavigationViewPreventLastPop(void)
+{
+  ToolkitTestApplication application;
+
+  Stage stage = Stage::GetCurrent();
+
+  // 1 Create Navigation View
+  NavigationView naviView = NavigationView::New();
+  stage.Add( naviView );
+
+  // 2 Push initial Actor
+  Actor testParentActor1 = Actor::New();
+  testParentActor1.SetName("TestParentActor1");
+  naviView.Push( testParentActor1 );
+  DALI_TEST_EQUALS( naviView.GetChildCount(), 1 ,  TEST_LOCATION );
+
+  // 3 Push Second Actor which contains a child actor
+  Actor testParentActor2 = Actor::New();
+  testParentActor2.SetName("TestParentActor2");
+  Actor testChildActor1 = Actor::New();
+  testParentActor2.Add( testChildActor1 );
+  naviView.Push( testParentActor2 );
+
+  // 4 Pop head actor, it should be TestParentActor2
+  Actor poppedActor1 = naviView.Pop();
+  DALI_TEST_EQUALS( poppedActor1.GetName() ,  "TestParentActor2", TEST_LOCATION );
+
+
+  // 5 Try to Pop head actor, Should be empty hence can not get name of Actor
+  Actor poppedActorEmpty = naviView.Pop();
+
+  try
+  {
+    const std::string hasNoName = poppedActorEmpty.GetName();
+    tet_infoline( hasNoName.c_str() );
+    DALI_TEST_CHECK( false ); // should not get here
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+
+  END_TEST;
+}
index cfb5d18..fd09527 100644 (file)
@@ -104,6 +104,7 @@ develapibubbleemitterdir =      $(develapicontrolsdir)/bubble-effect
 develapieffectsviewdir =        $(develapicontrolsdir)/effects-view
 develapigaussianblurviewdir =   $(develapicontrolsdir)/gaussian-blur-view
 develapimagnifierdir =          $(develapicontrolsdir)/magnifier
+develapinavigationviewdir =     $(develapicontrolsdir)/navigation-view
 develapipageturnviewdir =       $(develapicontrolsdir)/page-turn-view
 develapipopupdir =              $(develapicontrolsdir)/popup
 develapiprogressbardir =        $(develapicontrolsdir)/progress-bar
@@ -129,6 +130,7 @@ develapifocusmanager_HEADERS =      $(devel_api_focus_manager_header_files)
 develapigaussianblurview_HEADERS =  $(devel_api_gaussian_blur_view_header_files)
 develapiimageloader_HEADERS =       $(devel_api_image_loader_header_files)
 develapimagnifier_HEADERS =         $(devel_api_magnifier_header_files)
+develapinavigationview_HEADERS =    $(devel_api_navigation_view_header_files)
 develapipageturnview_HEADERS =      $(devel_api_page_turn_view_header_files)
 develapipopup_HEADERS =             $(devel_api_popup_header_files)
 develapiprogressbar_HEADERS =       $(devel_api_progress_bar_header_files)
diff --git a/dali-toolkit/devel-api/controls/navigation-view/navigation-view.cpp b/dali-toolkit/devel-api/controls/navigation-view/navigation-view.cpp
new file mode 100644 (file)
index 0000000..cffecf9
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/navigation-view/navigation-view-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+NavigationView::NavigationView()
+{
+}
+
+NavigationView::NavigationView( const NavigationView& handle )
+: Control(handle)
+{
+}
+
+NavigationView& NavigationView::operator=( const NavigationView& handle)
+{
+  if( &handle != this )
+  {
+    Control::operator=( handle );
+  }
+  return *this;
+}
+
+NavigationView::~NavigationView()
+{
+}
+
+NavigationView NavigationView::New()
+{
+  return Internal::NavigationView::New();
+}
+
+NavigationView NavigationView::DownCast( BaseHandle handle )
+{
+  return Control::DownCast<NavigationView, Internal::NavigationView>(handle);
+}
+
+NavigationView::NavigationView( Internal::NavigationView& implementation )
+: Control( implementation )
+{
+}
+
+NavigationView::NavigationView( Dali::Internal::CustomActor* internal )
+: Control( internal)
+{
+  VerifyCustomActorPointer<Internal::NavigationView>(internal);
+}
+
+
+void NavigationView::Push( Actor actor )
+{
+  GetImpl( *this ).Push( actor );
+}
+
+Actor NavigationView::Pop()
+{
+  return GetImpl( *this ).Pop();
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/controls/navigation-view/navigation-view.h b/dali-toolkit/devel-api/controls/navigation-view/navigation-view.h
new file mode 100644 (file)
index 0000000..1ff0f65
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef DALI_TOOLKIT_NAVIGATION_VIEW_H
+#define DALI_TOOLKIT_NAVIGATION_VIEW_H
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-function.h>
+#include <dali-toolkit/public-api/controls/control.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal DALI_INTERNAL
+{
+// Forward declarations
+class NavigationView;
+}
+
+/**
+ * @brief NavigationView implements a view that manages the navigation of hierarchical contents.
+ *
+ * An Actor is pushed onto the NavigationView, itself and its children are added to the stage.
+ * The actors currently shown are replaced.
+ * When pop is called on the NavigationView, the current tree of Actors are removed and the previous set added back.
+ * If pop is called on the last set of Actors then they remain, nothing is popped.
+ */
+class DALI_IMPORT_API NavigationView : public Control
+{
+
+public:
+
+  /**
+   * @brief Create a NavigationView handle; this can be initialize with NavigationView::New().
+   *
+   * @note Calling member function with an uninitialized handle is not allowed.
+   */
+  NavigationView();
+
+  /**
+   * @brief Copy Constructor.
+   * @param[in] handle Handle to copy.
+   */
+  NavigationView( const NavigationView& handle );
+
+ /**
+  * @brief Assignment operator.
+  * @param handle The handle to copy from.
+  * @return reference to this
+  */
+  NavigationView& operator=( const NavigationView& handle );
+
+  /**
+   * @brief Destructor
+   *
+   * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   */
+  ~NavigationView();
+
+  /**
+   * @brief  Create an initialized NavigationView.
+   *
+   * @return A handle to a newly allocated Dali resource.
+   */
+  static NavigationView New();
+
+  /**
+   * @brief Downcast an object handle to NavigationView.
+   *
+   * @details If handle points to a NavigationView, the downcast produces a valid handle.
+   * If not, the returned handle is left uninitialized.
+   * @param[in] handle Handle to an object.
+   * @return handle to a NavigationView of an uninitialized handle.
+   */
+  static NavigationView DownCast( BaseHandle handle );
+
+  /**
+   * @brief Push a new actor tree to the top of the NavigationView stack and show it.
+   * @param[in] item An actor tree.
+   */
+  void Push( Actor item );
+
+  /**
+   * @brief Pop the actor tree that is on the top of the NavigationView stack and make it disappear.
+   *
+   * @return The Actor tree popped out.
+   *
+   * @note It does not pop out the last item in the stack.
+   * It returns an uninitialized item handle if there is no item or only one item in the stack.
+   */
+  Actor Pop();
+
+
+public: // Not intended for application developers
+
+/// @cond internal
+  /**
+   * Creates a handle using the Toolkit::Internal implementation.
+   * @param[in]  implementation  The Control implementation.
+   */
+  DALI_INTERNAL NavigationView( Internal::NavigationView& implementation );
+
+  /**
+   * Allows the creation of this Control from an Internal::CustomActor pointer.
+   * @param[in]  internal  A pointer to the internal CustomActor.
+   */
+  explicit DALI_INTERNAL NavigationView( Dali::Internal::CustomActor* internal );
+/// @endcond
+}; // class NavigationView
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_NAVIGATION_VIEW_H
index 7cc6a2c..188ed1b 100755 (executable)
@@ -8,6 +8,7 @@ devel_api_src_files = \
   $(devel_api_src_dir)/controls/bubble-effect/bubble-emitter.cpp \
   $(devel_api_src_dir)/controls/effects-view/effects-view.cpp \
   $(devel_api_src_dir)/controls/magnifier/magnifier.cpp \
+  $(devel_api_src_dir)/controls/navigation-view/navigation-view.cpp \
   $(devel_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.cpp \
   $(devel_api_src_dir)/controls/page-turn-view/page-turn-portrait-view.cpp \
   $(devel_api_src_dir)/controls/page-turn-view/page-turn-view.cpp \
@@ -53,6 +54,9 @@ devel_api_effects_view_header_files = \
 devel_api_magnifier_header_files = \
   $(devel_api_src_dir)/controls/magnifier/magnifier.h
 
+devel_api_navigation_view_header_files = \
+  $(devel_api_src_dir)/controls/navigation-view/navigation-view.h
+
 devel_api_page_turn_view_header_files = \
   $(devel_api_src_dir)/controls/page-turn-view/page-factory.h \
   $(devel_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.h \
diff --git a/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp b/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp
new file mode 100644 (file)
index 0000000..1d15650
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include "navigation-view-impl.h"
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+namespace // to register type
+{
+
+BaseHandle Create()
+{
+  return Toolkit::NavigationView::New();
+}
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::NavigationView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
+
+} // namespace
+
+NavigationView::NavigationView()
+: Control(ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) )
+{
+}
+
+NavigationView::~NavigationView()
+{
+  // Clear all the items in the stack, forces their destruction before NavigationView is destroyed.
+  mContentStack.clear();
+}
+
+Toolkit::NavigationView NavigationView::New()
+{
+  // Create the implementation, temporarily owned by this handle on stack
+  IntrusivePtr< NavigationView > internalNavigationView = new NavigationView();
+
+  // Pass ownership to CustomActor handle
+  Toolkit::NavigationView navigationView( *internalNavigationView );
+
+  // Second-phase init of the implementation
+  // This can only be done after the CustomActor connection has been made...
+  internalNavigationView->Initialize();
+
+  return navigationView;
+}
+
+void NavigationView::OnStageConnection( int depth )
+{
+  Self().SetSensitive(true);
+}
+
+void NavigationView::Push( Actor& actor )
+{
+  // check the uninitialized item
+  // check the duplicated push for the top item
+  if(!actor )
+  {
+    return;
+  }
+
+  if( mContentStack.size() > 0 )
+  {
+    Self().Remove( mContentStack.back()  );
+  }
+
+  //push the new item into the stack and show it
+  mContentStack.push_back(actor);
+  Self().Add(actor);
+}
+
+Actor NavigationView::Pop()
+{
+  // cannot pop out the bottom-most item
+  Actor poppedItem;
+  if( mContentStack.size() > 1 )
+  {
+    // pop out the top item of the stack and show the new item right under the old one.
+    Self().Remove(mContentStack.back());
+    poppedItem = mContentStack.back();
+    mContentStack.pop_back();
+    Self().Add(mContentStack.back());
+  }
+
+  return poppedItem;
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.h b/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.h
new file mode 100644 (file)
index 0000000..c6d9160
--- /dev/null
@@ -0,0 +1,142 @@
+#ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H__
+#define __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H__
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <list>
+#include <dali/public-api/actors/layer.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+class NavigationView;
+
+namespace Internal
+{
+
+class NavigationBar;
+
+/**
+ * @brief
+ *
+ * NavigationView implements a controller than manages the navigation of hierarchical contents.
+ */
+
+class NavigationView : public Control
+{
+public:
+
+  /**
+   * Create an initialized NavigationView.
+   * @return A handle to a newly allocated Dali resource
+   */
+  static Toolkit::NavigationView New();
+
+  /**
+   * @copydoc Dali::Toolkit::NavigationView::Push()
+   */
+  void Push( Actor& actor );
+
+  /**
+   * @copydoc Dali::Toolkit::NavigationView::Pop()
+   */
+  Actor Pop();
+
+  /**
+   * Performs actions as requested using the action name.
+   * @param[in] object The object on which to perform the action.
+   * @param[in] actionName The action to perform.
+   * @param[in] properties The properties with which to perform this action.
+   * @return true if action has been accepted by this control
+   */
+  //static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& properties );
+
+
+private: // override functions from Control
+
+  /**
+   * @copydoc Control::OnStageConnection( int depth  )
+   */
+  virtual void OnStageConnection( int depth );
+
+  /**
+   * @copydoc Control::OnRelayout()
+   */
+  //virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+protected:
+
+  /**
+   * Constructor.
+   * It initializes the NavigationView members
+   */
+  NavigationView();
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~NavigationView();
+
+private:
+
+  // Undefined
+  NavigationView(const NavigationView&);
+
+  // Undefined
+  NavigationView& operator=(const NavigationView& rhs);
+
+private:
+
+  std::vector< Actor >         mContentStack;
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Toolkit::Internal::NavigationView& GetImpl( Toolkit::NavigationView& navigationView )
+{
+  DALI_ASSERT_ALWAYS( navigationView );
+
+  Dali::RefObject& handle = navigationView.GetImplementation();
+
+  return static_cast<Toolkit::Internal::NavigationView&>( handle );
+}
+
+inline const Toolkit::Internal::NavigationView& GetImpl( const Toolkit::NavigationView& navigationView )
+{
+  DALI_ASSERT_ALWAYS( navigationView );
+
+  const Dali::RefObject& handle = navigationView.GetImplementation();
+
+  return static_cast<const Toolkit::Internal::NavigationView&>( handle );
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H__ */
index 7fb2109..5a52371 100644 (file)
@@ -43,6 +43,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp \
    $(toolkit_src_dir)/controls/image-view/image-view-impl.cpp \
    $(toolkit_src_dir)/controls/magnifier/magnifier-impl.cpp \
+   $(toolkit_src_dir)/controls/navigation-view/navigation-view-impl.cpp \
    $(toolkit_src_dir)/controls/popup/confirmation-popup-impl.cpp \
    $(toolkit_src_dir)/controls/model3d-view/model3d-view-impl.cpp \
    $(toolkit_src_dir)/controls/model3d-view/obj-loader.cpp \