[SRUK] Initial copy from Tizen 2.2 version
[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 Flora License, Version 1.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://floralicense.org/license/
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 // EXTERNAL INCLUDES
21 #include <set>
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/common/message.h>
25 #include <dali/internal/event/common/property-notifier.h>
26
27 namespace Dali
28 {
29
30 namespace Internal
31 {
32
33 class PropertyNotification;
34
35 /**
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.
40  */
41 class PropertyNotificationManager : public PropertyNotifier
42 {
43 public:
44
45   /**
46    * Create an PropertyNotificationManager.
47    * @return A newly allocated object.
48    */
49   static PropertyNotificationManager* New();
50
51   /**
52    * Virtual destructor.
53    */
54   virtual ~PropertyNotificationManager();
55
56   /**
57    * Called when a PropertyNotification is constructed.
58    */
59   void PropertyNotificationCreated( PropertyNotification& propertyNotification );
60
61   /**
62    * Called when a PropertyNotification is destroyed.
63    */
64   void PropertyNotificationDestroyed( PropertyNotification& propertyNotification );
65
66 private: // private virtual overrides
67
68   /**
69    * @copydoc PropertyNotifier::NotifyProperty
70    */
71   virtual void NotifyProperty( SceneGraph::PropertyNotification* propertyNotification, bool validity );
72
73 private:
74
75   /**
76    * Default constructor.
77    */
78   PropertyNotificationManager();
79
80   // Undefined
81   PropertyNotificationManager(const PropertyNotificationManager&);
82
83   // Undefined
84   PropertyNotificationManager& operator=(const PropertyNotificationManager& rhs);
85
86 private:
87
88   std::set< PropertyNotification* > mPropertyNotifications; ///< All existing PropertyNotifications (not referenced)
89
90 };
91
92 } // namespace Internal
93
94 } // namespace Dali
95
96 #endif // __DALI_INTERNAL_PROPERTY_NOTIFICATION_MANAGER_H__
97