X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fadaptor-framework%2Fwindow.h;h=8105e5dec486562bc1bf8e3ccaddd0e891265d3a;hb=54fa6064423c52dcff16687f6af27171a9be6b72;hp=07a554882edae415fe9f51027fd9becb38e2d8c6;hpb=454e03e2413be60a42ae4bdd2976b0e1d6a20945;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/public-api/adaptor-framework/window.h b/dali/public-api/adaptor-framework/window.h index 07a5548..8105e5d 100644 --- a/dali/public-api/adaptor-framework/window.h +++ b/dali/public-api/adaptor-framework/window.h @@ -1,8 +1,8 @@ -#ifndef __DALI_WINDOW_H__ -#define __DALI_WINDOW_H__ +#ifndef DALI_WINDOW_H +#define DALI_WINDOW_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -23,10 +23,17 @@ #include #include #include +#include #include #include #include +// INTERNAL INCLUDES +#include + +#undef OPAQUE +#undef TRANSPARENT + namespace Dali { /** @@ -46,6 +53,11 @@ class Window; class DragAndDropDetector; class Orientation; +class Actor; +class Layer; +class RenderTaskList; +class TouchData; +struct KeyEvent; /** * @brief The window class is used internally for drawing. @@ -54,16 +66,18 @@ class Orientation; * You can get a valid Window handle by calling Dali::Application::GetWindow(). * @SINCE_1_0.0 */ -class DALI_IMPORT_API Window : public BaseHandle +class DALI_ADAPTOR_API Window : public BaseHandle { public: - typedef Uint16Pair WindowSize; ///< Window size type @SINCE_1_2.60 - typedef Uint16Pair WindowPosition; ///< Window position type @SINCE_1_2.60 + using WindowSize = Uint16Pair ; ///< Window size type @SINCE_1_2.60 + using WindowPosition = Uint16Pair; ///< Window position type @SINCE_1_2.60 - typedef Signal< void (bool) > IndicatorSignalType; ///< Indicator state signal type @SINCE_1_0.0 - typedef Signal< void (bool) > FocusSignalType; ///< Window focus signal type @SINCE_1_2.60 - typedef Signal< void (WindowSize) > ResizedSignalType; ///< Window resized signal type @SINCE_1_2.60 + using ResizedSignalType = Signal< void (WindowSize) >; ///< @DEPRECATED_1_4.35 @brief Window resized signal type @SINCE_1_2.60 + using FocusChangeSignalType = Signal< void (Window,bool) >; ///< Window focus signal type @SINCE_1_4.35 + using ResizeSignalType = Signal< void (Window,WindowSize) >; ///< Window resized signal type @SINCE_1_4.35 + using KeyEventSignalType = Signal< void (const KeyEvent&) >; ///< Key event signal type + using TouchSignalType = Signal< void (const TouchData&) >; ///< Touch signal type public: @@ -71,6 +85,9 @@ public: /** * @brief Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing. + * + * This Enumeration is used the available orientation APIs and the preferred orientation. + * * @SINCE_1_0.0 */ enum WindowOrientation @@ -78,29 +95,8 @@ public: PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0 LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0 PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation @SINCE_1_0.0 - LANDSCAPE_INVERSE = 270 ///< Landscape inverse orientation @SINCE_1_0.0 - }; - - /** - * @brief Enumeration for opacity of the indicator. - * @SINCE_1_0.0 - */ - enum IndicatorBgOpacity - { - OPAQUE = 100, ///< Fully opaque indicator Bg @SINCE_1_0.0 - TRANSLUCENT = 50, ///< Semi translucent indicator Bg @SINCE_1_0.0 - TRANSPARENT = 0 ///< Fully transparent indicator Bg @SINCE_1_0.0 - }; - - /** - * @brief Enumeration for visible mode of the indicator. - * @SINCE_1_0.0 - */ - enum IndicatorVisibleMode - { - INVISIBLE = 0, ///< Hide indicator @SINCE_1_0.0 - VISIBLE = 1, ///< Show indicator @SINCE_1_0.0 - AUTO = 2 ///< Hide in default, will show when necessary @SINCE_1_0.0 + LANDSCAPE_INVERSE = 270, ///< Landscape inverse orientation @SINCE_1_0.0 + NO_ORIENTATION_PREFERENCE = -1 ///< No orientation. It is used to initialize or unset the preferred orientation. @SINCE_1_4.51 }; /** @@ -163,6 +159,7 @@ public: * @param[in] name The Window title * @param[in] isTransparent Whether Window is transparent * @return A new window + * @note This creates an extra window in addition to the default main window */ static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false); @@ -173,6 +170,7 @@ public: * @param[in] name The Window title * @param[in] className The Window class name * @param[in] isTransparent Whether Window is transparent + * @note This creates an extra window in addition to the default main window * @return A new Window */ static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false); @@ -212,27 +210,96 @@ public: Window& operator=(const Window& rhs); /** - * @brief This sets whether the indicator bar should be shown or not. - * @SINCE_1_0.0 - * @param[in] visibleMode Visible mode for indicator bar, VISIBLE in default + * @brief Move constructor. + * + * @SINCE_1_9.24 + * @param[in] rhs A reference to the moved handle */ - void ShowIndicator( IndicatorVisibleMode visibleMode ); + Window( Window&& rhs ); /** - * @brief This sets the opacity mode of indicator bar. - * @SINCE_1_0.0 - * @param[in] opacity The opacity mode + * @brief Move assignment operator. + * + * @SINCE_1_9.24 + * @param[in] rhs A reference to the moved handle + * @return A reference to this handle */ - void SetIndicatorBgOpacity( IndicatorBgOpacity opacity ); + Window& operator=( Window&& rhs ); /** - * @brief This sets the orientation of indicator bar. + * @brief Adds a child Actor to the Window. * - * It does not implicitly show the indicator if it is currently hidden. - * @SINCE_1_0.0 - * @param[in] orientation The orientation + * The child will be referenced. + * + * @SINCE_1_4.19 + * @param[in] actor The child + * @pre The actor has been initialized. + * @pre The actor does not have a parent. */ - void RotateIndicator(WindowOrientation orientation); + void Add( Actor actor ); + + /** + * @brief Removes a child Actor from the Window. + * + * The child will be unreferenced. + * + * @SINCE_1_4.19 + * @param[in] actor The child + * @pre The actor has been added to the stage. + */ + void Remove( Actor actor ); + + /** + * @brief Sets the background color of the Window. + * + * @SINCE_1_4.19 + * @param[in] color The new background color + */ + void SetBackgroundColor( const Vector4& color ); + + /** + * @brief Gets the background color of the Window. + * + * @SINCE_1_4.19 + * @return The background color + */ + Vector4 GetBackgroundColor() const; + + /** + * @brief Returns the root Layer of the Window. + * + * @SINCE_1_4.19 + * @return The root layer + */ + Layer GetRootLayer() const; + + /** + * @brief Queries the number of on-scene layers in the Window. + * + * Note that a default layer is always provided (count >= 1). + * + * @SINCE_1_4.19 + * @return The number of layers + */ + uint32_t GetLayerCount() const; + + /** + * @brief Retrieves the layer at a specified depth in the Window. + * + * @SINCE_1_4.19 + * @param[in] depth The depth + * @return The layer found at the given depth + * @pre Depth is less than layer count; see GetLayerCount(). + */ + Layer GetLayer( uint32_t depth ) const; + + /** + * @brief Retrieves the DPI of the window. + * + * @SINCE_1_9.21 + * @return The DPI of the window + */ + Uint16Pair GetDpi() const; /** * @brief Sets the window name and class string. @@ -279,6 +346,8 @@ public: * @SINCE_1_0.0 * @param[in] orientation The preferred orientation * @pre Orientation is in the list of available orientations. + * + * @note To unset the preferred orientation, orientation should be set NO_ORIENTATION_PREFERENCE. */ void SetPreferredOrientation( WindowOrientation orientation ); @@ -290,14 +359,6 @@ public: WindowOrientation GetPreferredOrientation(); /** - * @brief Returns the Drag & drop detector which can be used to receive drag & drop events. - * @note Not intended for application developers. - * @SINCE_1_0.0 - * @return A handle to the DragAndDropDetector - */ - DragAndDropDetector GetDragAndDropDetector() const; - - /** * @brief Gets the native handle of the window. * * When users call this function, it wraps the actual type used by the underlying window system. @@ -500,9 +561,9 @@ public: bool SetBrightness( int brightness ); /** - * @brief Gets preffered brightness of the window. + * @brief Gets preferred brightness of the window. * @SINCE_1_2.60 - * @return The preffered brightness. + * @return The preferred brightness. */ int GetBrightness() const; @@ -546,41 +607,91 @@ public: */ void SetTransparency( bool transparent ); + /** + * @brief Retrieves the list of render-tasks in the window. + * + * @SINCE_1_9.21 + * @return A valid handle to a RenderTaskList + */ + RenderTaskList GetRenderTaskList(); + public: // Signals + /** - * @brief The user should connect to this signal to get a timing when indicator was shown / hidden. - * @SINCE_1_0.0 + * @brief This signal is emitted when the window is resized. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( int width, int height ); + * @endcode + * The parameters are the resized width and height. + * + * @SINCE_1_2.60 * @return The signal to connect to */ - IndicatorSignalType& IndicatorVisibilityChangedSignal(); + ResizedSignalType& ResizedSignal() DALI_DEPRECATED_API; /** * @brief The user should connect to this signal to get a timing when window gains focus or loses focus. * * A callback of the following type may be connected: * @code - * void YourCallbackName( bool focusIn ); + * void YourCallbackName( Window window, bool focusIn ); * @endcode * The parameter is true if window gains focus, otherwise false. + * and window means this signal was called from what window * - * @SINCE_1_2.60 + * @SINCE_1_4.35 * @return The signal to connect to */ - FocusSignalType& FocusChangedSignal(); + FocusChangeSignalType& FocusChangeSignal(); /** * @brief This signal is emitted when the window is resized. * * A callback of the following type may be connected: * @code - * void YourCallbackName( int width, int height ); + * void YourCallbackName( Window window, int width, int height ); * @endcode * The parameters are the resized width and height. + * and window means this signal was called from what window * - * @SINCE_1_2.60 + * @SINCE_1_4.35 * @return The signal to connect to */ - ResizedSignalType& ResizedSignal(); + ResizeSignalType& ResizeSignal(); + + /** + * @brief This signal is emitted when key event is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const KeyEvent& event); + * @endcode + * + * @SINCE_1_9.21 + * @return The signal to connect to + */ + KeyEventSignalType& KeyEventSignal(); + + /** + * @brief This signal is emitted when the screen is touched and when the touch ends + * (i.e. the down & up touch events only). + * + * If there are multiple touch points, then this will be emitted when the first touch occurs and + * then when the last finger is lifted. + * An interrupted event will also be emitted (if it occurs). + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const TouchData& event); + * @endcode + * + * @SINCE_1_9.21 + * @return The touch signal to connect to + * + * @note Motion events are not emitted. + */ + TouchSignalType& TouchSignal(); public: // Not intended for application developers /// @cond internal