Add to set Available Orientations.
This API is for adding several orientations one time.
Change-Id: Ie11ccd2d62d940fe14603e4241a257ed6fe9dff7
return GetImplementation( window ).GetCurrentOrientation();
}
+void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+{
+ GetImplementation( window ).SetAvailableOrientations( orientations );
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window window );
+/**
+ * @brief Sets available orientations of the window.
+ *
+ * This API is for setting several orientations one time.
+ *
+ * @param[in] window The window instance
+ * @param[in] orientations The available orientation list to add
+ */
+DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+
} // namespace DevelWindow
} // namespace Dali
return ConvertToOrientation( mRotationAngle );
}
+void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+{
+ Dali::Vector<float>::SizeType count = orientations.Count();
+ for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
+ {
+ if( IsOrientationAvailable( orientations[index] ) == false )
+ {
+ DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
+ continue;
+ }
+
+ bool found = false;
+ int convertedAngle = ConvertToAngle( orientations[index] );
+
+ for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
+ {
+ if( mAvailableAngles[i] == convertedAngle )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if( !found )
+ {
+ DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle );
+ mAvailableAngles.push_back( convertedAngle );
+ }
+ }
+ SetAvailableAnlges( mAvailableAngles );
+}
+
} // Adaptor
} // Internal
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/object/property-array.h>
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/window.h>
*/
Dali::Window::WindowOrientation GetCurrentOrientation() const;
+ /**
+ * @copydoc Dali::DevelWindow::SetAvailableOrientations()
+ */
+ void SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+
public: // Dali::Internal::Adaptor::SceneHolder
/**