1 #ifndef DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H
2 #define DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H
5 * Copyright (c) 2017 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.
20 #include <dali/public-api/object/ref-object.h>
21 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
22 #include <dali-toolkit/internal/builder/dictionary.h>
32 typedef IntrusivePtr<Style> StylePtr;
35 * This class encapsulates the style information for a given styled
36 * control. It is generated only when a control instance looks up
37 * it's style information for the first time, and then stored by
40 * It contains the visual, property and transition definitions for the
41 * main control and for each state and sub-state within the control.
43 * It has methods to enable the base control to apply visuals and
44 * properties per state.
46 class Style : public RefObject
49 static StylePtr New();
53 * Apply the visuals and properties for the current state/substate
54 * of the handle to the control pointed at by handle. Recurses
57 * @param[in] handle The handle to apply the visuals to
59 void ApplyVisualsAndPropertiesRecursively( Handle handle ) const;
64 * Apply the visuals of the style to the control pointed at by
67 * @param[in] handle The handle to apply the visuals to
69 void ApplyVisuals( Handle handle ) const;
72 * Apply the properties of the style to the control pointed at by
75 * @param[in] handle The handle to apply the properties to
77 void ApplyProperties( Handle handle ) const;
81 * @brief Default constructor.
86 * @brief virtual destructor.
92 DALI_INTERNAL Style( const Style& rhs );
95 DALI_INTERNAL Style& operator=(const Style& rhs);
98 // Everything must be shallow-copiable.
99 Dictionary<StylePtr> subStates; // Each named style maps to a state.
100 Dictionary<Property::Map> visuals;
101 Property::Map properties;
102 Property::Array transitions;
103 Toolkit::TransitionData entryTransition;
104 Toolkit::TransitionData exitTransition;
112 #endif //DALI_TOOLKIT_INTERNAL_BUILDER_STYLE_H