License conversion from Flora to Apache 2.0
[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) 2014 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/public-api/common/set-wrapper.h>
23 #include <dali/internal/common/message.h>
24 #include <dali/internal/event/common/property-notifier.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 class PropertyNotification;
33
34 /**
35  * PropertyNotificationManager issues notifications to applications
36  * a condition of a property being met.
37  * It also monitors the lifetime of PropertyNotification objects and will
38  * only emit signals for PropertyNotification objects which are still valid.
39  */
40 class PropertyNotificationManager : public PropertyNotifier
41 {
42 public:
43
44   /**
45    * Create an PropertyNotificationManager.
46    * @return A newly allocated object.
47    */
48   static PropertyNotificationManager* New();
49
50   /**
51    * Virtual destructor.
52    */
53   virtual ~PropertyNotificationManager();
54
55   /**
56    * Called when a PropertyNotification is constructed.
57    */
58   void PropertyNotificationCreated( PropertyNotification& propertyNotification );
59
60   /**
61    * Called when a PropertyNotification is destroyed.
62    */
63   void PropertyNotificationDestroyed( PropertyNotification& propertyNotification );
64
65 private: // private virtual overrides
66
67   /**
68    * @copydoc PropertyNotifier::NotifyProperty
69    */
70   virtual void NotifyProperty( SceneGraph::PropertyNotification* propertyNotification, bool validity );
71
72 private:
73
74   /**
75    * Default constructor.
76    */
77   PropertyNotificationManager();
78
79   // Undefined
80   PropertyNotificationManager(const PropertyNotificationManager&);
81
82   // Undefined
83   PropertyNotificationManager& operator=(const PropertyNotificationManager& rhs);
84
85 private:
86
87   std::set< PropertyNotification* > mPropertyNotifications; ///< All existing PropertyNotifications (not referenced)
88
89 };
90
91 } // namespace Internal
92
93 } // namespace Dali
94
95 #endif // __DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H__
96