1 #ifndef DALI_BASE_OBJECT_IMPL_H
2 #define DALI_BASE_OBJECT_IMPL_H
5 * Copyright (c) 2021 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/object/base-object.h>
27 * @brief Holds the Implementation for the BaseObject class
29 class BaseObject::Impl
33 * @brief Retrieves the implementation of the internal BaseObject class.
34 * @param[in] internalBaseObject A ref to the BaseObject whose internal implementation is required
35 * @return The internal implementation
37 static BaseObject::Impl& Get(BaseObject& baseObject);
40 * @copydoc Get( BaseObject& )
42 static const BaseObject::Impl& Get(const BaseObject& baseObject);
46 * @param[in] baseObject The base object which owns this implementation
48 Impl(BaseObject& baseObject);
59 * Called shortly before the object itself is destroyed; no further callbacks will be received.
60 * @param[in] object The base object.
62 virtual void ObjectDestroyed(BaseObject& object) = 0;
68 virtual ~Observer() = default;
72 * Add an observer to the object.
73 * @param[in] observer The observer to add.
75 void AddObserver(Observer& observer);
78 * Remove an observer from the object
79 * @pre The observer has already been added.
80 * @param[in] observer The observer to remove.
82 void RemoveObserver(Observer& observer);
85 BaseObject& mBaseObject;
86 Dali::Vector<Observer*> mObservers;
91 #endif // DALI_BASE_OBJECT_IMPL_H