1 #ifndef DALI_BASE_OBJECT_IMPL_H
2 #define DALI_BASE_OBJECT_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.
22 #include <dali/public-api/object/base-object.h>
28 * @brief Holds the Implementation for the BaseObject class
30 class BaseObject::Impl
36 * @brief Retrieves the implementation of the internal BaseObject class.
37 * @param[in] internalBaseObject A ref to the BaseObject whose internal implementation is required
38 * @return The internal implementation
40 static BaseObject::Impl& Get( BaseObject& baseObject );
43 * @copydoc Get( BaseObject& )
45 static const BaseObject::Impl& Get( const BaseObject& baseObject );
49 * @param[in] baseObject The base object which owns this implementation
51 Impl( BaseObject& baseObject );
63 * Called shortly before the object itself is destroyed; no further callbacks will be received.
64 * @param[in] object The base object.
66 virtual void ObjectDestroyed( BaseObject& object ) = 0;
73 virtual ~Observer() {}
77 * Add an observer to the object.
78 * @param[in] observer The observer to add.
80 void AddObserver( Observer& observer );
83 * Remove an observer from the object
84 * @pre The observer has already been added.
85 * @param[in] observer The observer to remove.
87 void RemoveObserver( Observer& observer );
91 BaseObject& mBaseObject;
92 Dali::Vector<Observer*> mObservers;
97 #endif // DALI_BASE_OBJECT_IMPL_H