1 #ifndef DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H
2 #define DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H
5 * Copyright (c) 2023 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 <unordered_map>
25 #include <dali/internal/common/ordered-set.h>
26 #include <dali/internal/event/common/property-notifier.h>
27 #include <dali/public-api/common/dali-vector.h>
33 class PropertyNotification;
36 * PropertyNotificationManager issues notifications to applications
37 * a condition of a property being met.
38 * It also monitors the lifetime of PropertyNotification objects and will
39 * only emit signals for PropertyNotification objects which are still valid.
41 class PropertyNotificationManager : public PropertyNotifier
45 * Create an PropertyNotificationManager.
46 * @return A newly allocated object.
48 static PropertyNotificationManager* New();
53 ~PropertyNotificationManager() override;
56 * Called when a PropertyNotification is constructed.
58 void PropertyNotificationCreated(PropertyNotification& propertyNotification);
61 * Called when a PropertyNotification is destroyed.
63 void PropertyNotificationDestroyed(PropertyNotification& propertyNotification);
66 * Called when a SceneGraph::PropertyNotification is mapping by PropertyNotification.
68 void PropertyNotificationSceneObjectMapping(const SceneGraph::PropertyNotification* sceneGraphPropertyNotification, PropertyNotification& propertyNotification);
71 * Called when a SceneGraph::PropertyNotification is unmaped from PropertyNotification.
73 void PropertyNotificationSceneObjectUnmapping(const SceneGraph::PropertyNotification* sceneGraphPropertyNotification);
75 private: // private virtual overrides
77 * @copydoc PropertyNotifier::NotifyProperty
79 void NotifyProperty(SceneGraph::PropertyNotification* sceneGraphPropertyNotification, bool validity) override;
83 * Default constructor.
85 PropertyNotificationManager();
88 PropertyNotificationManager(const PropertyNotificationManager&);
91 PropertyNotificationManager& operator=(const PropertyNotificationManager& rhs);
94 OrderedSet<PropertyNotification, false> mPropertyNotifications; ///< All existing PropertyNotifications (not owned)
96 std::unordered_map<const SceneGraph::PropertyNotification*, PropertyNotification*> mSceneGraphObjectMap; ///< Converter from SceneGraph object pointer to Event object.
99 } // namespace Internal
103 #endif // DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H