1 #ifndef DALI_CUSTOM_ACTOR_H
2 #define DALI_CUSTOM_ACTOR_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.
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/actors/custom-actor-impl.h>
28 * @addtogroup dali_core_actors
32 namespace Internal DALI_INTERNAL
38 * @brief CustomActor is a base class for custom UI controls.
40 * The implementation of the control must be supplied; see CustomActorImpl for more details.
43 class DALI_CORE_API CustomActor : public Actor
47 * @brief Creates an uninitialized CustomActor handle.
49 * Only derived versions can be instantiated.
50 * Calling member functions with an uninitialized CustomActor handle is not allowed.
56 * @brief Downcasts a handle to CustomActor handle.
58 * If the handle points to a CustomActor, the downcast produces valid handle.
59 * If not, the returned handle is left uninitialized.
62 * @param[in] handle Handle to an object
63 * @return Handle to a CustomActor or an uninitialized handle
65 static CustomActor DownCast(BaseHandle handle);
70 * This is non-virtual since derived Handle types must not contain data or virtual methods.
76 * @brief Retrieves the custom actor implementation.
79 * @return The implementation
81 CustomActorImpl& GetImplementation();
84 * @brief Retrieves the custom actor implementation.
87 * @return The implementation
89 const CustomActorImpl& GetImplementation() const;
92 * @brief Creates an initialized CustomActor.
95 * @param[in] implementation The implementation for this custom actor
96 * @return A handle to a newly allocated Dali resource
98 CustomActor(CustomActorImpl& implementation);
101 * @brief Copy constructor.
104 * @param[in] copy The actor to copy
106 CustomActor(const CustomActor& copy);
109 * @brief Assignment operator.
112 * @param[in] rhs The actor to copy
113 * @return A reference to this
115 CustomActor& operator=(const CustomActor& rhs);
118 * @brief Move constructor.
121 * @param[in] rhs The actor to move
123 CustomActor(CustomActor&& rhs);
126 * @brief Move assignment operator.
129 * @param[in] rhs The actor to move
130 * @return A reference to this
132 CustomActor& operator=(CustomActor&& rhs);
134 public: // Not intended for application developers
136 * @brief This constructor is used internally to create additional CustomActor handles.
139 * @param[in] actor A pointer to a newly allocated Dali resource
141 CustomActor(Internal::CustomActor* actor);
149 #endif // DALI_CUSTOM_ACTOR_H