1 #ifndef DALI_TOOLKIT_INTERNAL_BORDER_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_BORDER_VISUAL_H
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/rendering/geometry.h>
25 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
37 * The visual which renders a solid color to the control's quad border fixed to a specified size.
39 * The following properties are required for create a BorderRender
41 * | %Property Name | Type |
42 * |-----------------|-------------|
43 * | borderColor | VECTOR4 |
44 * | borderSize | FLOAT |
45 * | antiAliasing | BOOLEAN |
48 class BorderVisual : public Visual::Base
55 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
57 BorderVisual( VisualFactoryCache& factoryCache );
60 * @brief A reference counted object may only be deleted by calling Unreference().
62 virtual ~BorderVisual();
67 * @copydoc Visual::Base::DoInitialize
69 virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
72 * @copydoc Visual::Base::DoSetOnStage
74 virtual void DoSetOnStage( Actor& actor );
77 * @copydoc Visual::Base::CreatePropertyMap
79 virtual void DoCreatePropertyMap( Property::Map& map ) const;
82 * @copydoc Visual::Base::DoSetProperty
84 virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
87 * @copydoc Visual::Base::DoGetProperty
89 virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
94 * Set the color of the border.
95 * @param[in] color The border color.
97 void SetBorderColor( const Vector4& color);
100 * Set the size of the border.
101 * @param[in] size The border size.
103 void SetBorderSize( float size );
106 * Enable/Disable the anti-aliasing.
107 * @param[in] enable Whether the anti-aliasing be enabled or not.
109 void RequireAntiAliasing( bool antiAliasing );
114 * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
116 void InitializeRenderer();
119 * Request the border shader from the factory cache. If fail, create tha shader and add it to cache.
120 * @return The border shader.
122 Shader GetBorderShader();
125 * Create the geometry which presents the border.
126 * @return The border geometry
128 Geometry CreateBorderGeometry();
131 BorderVisual( const BorderVisual& borderRenderer );
134 BorderVisual& operator=( const BorderVisual& borderRenderer );
138 Vector4 mBorderColor;
141 Property::Index mBorderColorIndex;
142 Property::Index mBorderSizeIndex;
147 } // namespace Internal
149 } // namespace Toolkit
153 #endif // DALI_TOOLKIT_INTERNAL_BORDER_VISUAL_H