X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.h;h=f0f216b6d3af3cd30aaddbcf2a756cfb320b50a4;hp=4ff673e73de08a55614e6ebc188bbe11566d9324;hb=68106e2cbb8541c18a77f39770ea7759f44e02a0;hpb=eea53605c5acb244aebb72d75bdd9b3a68a9678a diff --git a/dali-toolkit/public-api/controls/control.h b/dali-toolkit/public-api/controls/control.h index 4ff673e..f0f216b 100644 --- a/dali-toolkit/public-api/controls/control.h +++ b/dali-toolkit/public-api/controls/control.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_CONTROL_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -82,39 +82,14 @@ public: { enum { - BACKGROUND_COLOR = PROPERTY_START_INDEX, ///< name "background-color", @see SetBackgroundColor, type VECTOR4 - BACKGROUND, ///< name "background", @see SetBackground, type MAP - WIDTH_POLICY, ///< name "width-policy", @see SetSizePolicy, type STRING - HEIGHT_POLICY, ///< name "height-policy", @see SetSizePolicy, type STRING - MINIMUM_SIZE, ///< name "minimum-size", @see SetMinimumSize, type VECTOR3 - MAXIMUM_SIZE, ///< name "maximum-size", @see SetMaximumSize, type VECTOR3 - KEY_INPUT_FOCUS, ///< name "key-input-focus", @see SetKeyInputFocus, type BOOLEAN + STYLE_NAME = PROPERTY_START_INDEX, ///< name "style-name", @see SetStyleName, type std::string + BACKGROUND_COLOR, ///< name "background-color", @see SetBackgroundColor, type Vector4 + BACKGROUND_IMAGE, ///< name "background-image", @see SetBackgroundImage, type Map + KEY_INPUT_FOCUS, ///< name "key-input-focus", @see SetKeyInputFocus, type bool }; }; /** - * @brief Describes how a control could be resized. - */ - enum SizePolicy - { - Fixed, ///< Size can't grow or shrink. - Minimum, ///< Size can grow but shrink up to a minimum level. - Maximum, ///< Size can shrink but grow up to a maximum value. - Range, ///< Size can grow or shrink between a minimum and a maximum values. - Flexible, ///< Size can grow or shrink with no limits. - }; - - /** - * @brief Describes what a control should do when a contained actor/control exceeds the boundary of the control. - */ - enum ExceedPolicy - { - Crop, ///< Control's contents will be cropped. - Shrink, ///< Control's contents will be shrunk. - Scroll ///< Control's contents will be added to a scroll. - }; - - /** * @brief Describes the direction to move the keyboard focus towards. */ enum KeyboardFocusNavigationDirection @@ -200,79 +175,6 @@ public: */ const Internal::Control& GetImplementation() const; - // Size Negotiation - - /** - * @brief Sets the size policies for the width and height dimensions. - * - * @param[in] widthPolicy Size policy for the width dimension. - * @param[in] heightPolicy Size policy for the height dimension. - */ - void SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ); - - /** - * @brief Retrieves the size policies for the width and height dimensions. - * - * @param[out] widthPolicy Width's size policy. - * @param[out] heightPolicy Height's size policy. - */ - void GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const; - - /** - * @brief Sets the minimum size for the control. - * - * @param[in] size The minimum size. - */ - void SetMinimumSize( const Vector3& size ); - - /** - * @brief Retrieves the minimum size. - * - * @return The minimum size. - */ - const Vector3& GetMinimumSize() const; - - /** - * @brief Sets the maximum size. - * - * @param[in] size The maximum size. - */ - void SetMaximumSize( const Vector3& size ); - - /** - * @brief Retrieves the maximum size. - * - * @return The maximum size. - */ - const Vector3& GetMaximumSize() const; - - /** - * @brief Works out the natural size. - * - * Natural size is the control's size with any restriction. - * - * @return The natural size. - */ - Vector3 GetNaturalSize(); - - /** - * @brief Works out the control's height for a given width. - * - * @param[in] width The control's width. - * - * @return The control's height for the given width. - */ - float GetHeightForWidth( float width ); - - /** - * @brief Works out the control's width for a given height. - * - * @param[in] height The control's height. - * - * @return The control's width for the given height. - */ - float GetWidthForHeight( float height ); - // Key Input /** @@ -344,6 +246,22 @@ public: // Background /** + * @brief Sets the name of the style to be applied to the control. + * + * @param[in] styleName A string matching a style described in a stylesheet. + */ + void SetStyleName( const std::string& styleName ); + + /** + * @brief Retrieves the name of the style to be applied to the control (if any). + * + * @return A string matching a style or an empty string. + */ + const std::string& GetStyleName() const; + + // Background + + /** * @brief Sets the background color of the control. * * @param[in] color The required background color of the control @@ -366,7 +284,7 @@ public: * * @param[in] image The image to set as the background. */ - void SetBackground( Image image ); + void SetBackgroundImage( Image image ); /** * @brief Clears the background.