1 #ifndef DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H
2 #define DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H
5 * Copyright (c) 2020 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/devel-api/visual-factory/visual-base.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
29 namespace Internal // To use TypeRegistry, handle and body classes need the same name
32 * @brief A Simple Control to show use of visuals with a style sheet and changing visuals with a state change
35 class MyControl : public Dali::Toolkit::Internal::Control
39 * @brief Instantiate a new ContentView object
41 static Demo::MyControl New();
44 * @brief Default constructor
50 * @brief Called when a property of an object of this type is set.
52 * @param[in] object The object whose property is set.
53 * @param[in] index The property index.
54 * @param[in] value The new property value.
56 static void SetProperty(Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value);
59 * @brief Called to retrieve a property of an object of this type.
61 * @param[in] object The object whose property is to be retrieved.
62 * @param[in] index The property index.
63 * @return The current value of the property.
65 static Dali::Property::Value GetProperty(Dali::BaseObject* object, Dali::Property::Index propertyIndex);
67 private: // From Control
69 * @copydoc Toolkit::Control::OnInitialize()
71 virtual void OnInitialize();
75 * undefined constructor and operator=
77 MyControl(const MyControl&);
78 MyControl& operator=(const MyControl&);
83 } // namespace Internal
85 inline Internal::MyControl& GetImpl(Demo::MyControl& handle)
87 DALI_ASSERT_ALWAYS(handle);
88 Dali::RefObject& object = handle.GetImplementation();
89 return static_cast<Internal::MyControl&>(object);
92 inline const Internal::MyControl& GetImpl(const Demo::MyControl& handle)
94 DALI_ASSERT_ALWAYS(handle);
95 const Dali::RefObject& object = handle.GetImplementation();
96 return static_cast<const Internal::MyControl&>(object);
101 #endif // DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H