2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/common/property-notification-manager.h>
20 #include <dali/internal/event/common/property-notification-impl.h>
28 PropertyNotificationManager* PropertyNotificationManager::New()
30 return new PropertyNotificationManager;
33 PropertyNotificationManager::~PropertyNotificationManager()
37 void PropertyNotificationManager::PropertyNotificationCreated( PropertyNotification& propertyNotification )
39 mPropertyNotifications.insert( &propertyNotification );
42 void PropertyNotificationManager::PropertyNotificationDestroyed( PropertyNotification& propertyNotification )
44 std::set< PropertyNotification* >::iterator iter = std::find( mPropertyNotifications.begin(), mPropertyNotifications.end(), &propertyNotification );
45 DALI_ASSERT_ALWAYS( iter != mPropertyNotifications.end() && "PropertyNotification not found" );
47 mPropertyNotifications.erase( iter );
50 void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotification* propertyNotification, bool validity )
52 std::set< PropertyNotification* >::iterator iter = mPropertyNotifications.begin();
53 std::set< PropertyNotification* >::iterator endIter = mPropertyNotifications.end();
55 // walk the collection of PropertyNotifications
56 for( ; iter != endIter; ++iter )
58 // found one with the matching SceneGraph::PropertyNotification?
59 if( (*iter)->CompareSceneObject( propertyNotification ) )
61 // allow application to access the value that triggered this emit incase of NotifyOnChanged mode
62 (*iter)->SetNotifyResult(validity);
64 (*iter)->EmitSignalNotify();
70 PropertyNotificationManager::PropertyNotificationManager()
74 } // namespace Internal