1 #ifndef DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H
2 #define DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_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.
21 #include "my-control.h"
24 #include <dali-toolkit/public-api/controls/control-impl.h>
25 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
30 namespace Internal // To use TypeRegistry, handle and body classes need the same name
34 * @brief A Simple Control to show use of visuals with a style sheet and changing visuals with a state change
37 class MyControl : public Dali::Toolkit::Internal::Control
41 * @brief Instantiate a new ContentView object
43 static Demo::MyControl New();
46 * @brief Default constructor
52 * @brief Called when a property of an object of this type is set.
54 * @param[in] object The object whose property is set.
55 * @param[in] index The property index.
56 * @param[in] value The new property value.
58 static void SetProperty( Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
61 * @brief Called to retrieve a property of an object of this type.
63 * @param[in] object The object whose property is to be retrieved.
64 * @param[in] index The property index.
65 * @return The current value of the property.
67 static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index propertyIndex );
69 private: // From Control
71 * @copydoc Toolkit::Control::OnInitialize()
73 virtual void OnInitialize();
77 * undefined constructor and operator=
79 MyControl( const MyControl& );
80 MyControl& operator=( const MyControl& );
87 inline Internal::MyControl& GetImpl( Demo::MyControl& handle )
89 DALI_ASSERT_ALWAYS( handle );
90 Dali::RefObject& object = handle.GetImplementation();
91 return static_cast<Internal::MyControl&>(object);
94 inline const Internal::MyControl& GetImpl( const Demo::MyControl& handle )
96 DALI_ASSERT_ALWAYS( handle );
97 const Dali::RefObject& object = handle.GetImplementation();
98 return static_cast<const Internal::MyControl&>(object);
103 #endif // DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H