Merge "Updated all code to new format" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-notification-manager.h
1 #ifndef DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H
2 #define DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/common/property-notifier.h>
23 #include <dali/public-api/common/dali-vector.h>
24
25 namespace Dali
26 {
27 namespace Internal
28 {
29 class PropertyNotification;
30
31 /**
32  * PropertyNotificationManager issues notifications to applications
33  * a condition of a property being met.
34  * It also monitors the lifetime of PropertyNotification objects and will
35  * only emit signals for PropertyNotification objects which are still valid.
36  */
37 class PropertyNotificationManager : public PropertyNotifier
38 {
39 public:
40   /**
41    * Create an PropertyNotificationManager.
42    * @return A newly allocated object.
43    */
44   static PropertyNotificationManager* New();
45
46   /**
47    * Virtual destructor.
48    */
49   ~PropertyNotificationManager() override;
50
51   /**
52    * Called when a PropertyNotification is constructed.
53    */
54   void PropertyNotificationCreated(PropertyNotification& propertyNotification);
55
56   /**
57    * Called when a PropertyNotification is destroyed.
58    */
59   void PropertyNotificationDestroyed(PropertyNotification& propertyNotification);
60
61 private: // private virtual overrides
62   /**
63    * @copydoc PropertyNotifier::NotifyProperty
64    */
65   void NotifyProperty(SceneGraph::PropertyNotification* propertyNotification, bool validity) override;
66
67 private:
68   /**
69    * Default constructor.
70    */
71   PropertyNotificationManager();
72
73   // Undefined
74   PropertyNotificationManager(const PropertyNotificationManager&);
75
76   // Undefined
77   PropertyNotificationManager& operator=(const PropertyNotificationManager& rhs);
78
79 private:
80   Dali::Vector<PropertyNotification*> mPropertyNotifications; ///< All existing PropertyNotifications (not owned)
81 };
82
83 } // namespace Internal
84
85 } // namespace Dali
86
87 #endif // DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H