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>
22 #include <dali/internal/event/common/property-notification-impl.h>
23 #include <dali/internal/common/message.h>
31 PropertyNotificationManager* PropertyNotificationManager::New()
33 return new PropertyNotificationManager;
36 PropertyNotificationManager::~PropertyNotificationManager()
40 void PropertyNotificationManager::PropertyNotificationCreated( PropertyNotification& propertyNotification )
42 mPropertyNotifications.PushBack( &propertyNotification );
45 void PropertyNotificationManager::PropertyNotificationDestroyed( PropertyNotification& propertyNotification )
47 Dali::Vector< PropertyNotification* >::Iterator iter = std::find( mPropertyNotifications.Begin(), mPropertyNotifications.End(), &propertyNotification );
48 DALI_ASSERT_ALWAYS( iter != mPropertyNotifications.End() && "PropertyNotification not found" );
50 mPropertyNotifications.Remove( iter );
53 void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotification* propertyNotification, bool validity )
55 Dali::Vector< PropertyNotification* >::Iterator iter = mPropertyNotifications.Begin();
56 const Dali::Vector< PropertyNotification* >::Iterator endIter = mPropertyNotifications.End();
58 // walk the collection of PropertyNotifications
59 for( ; iter != endIter; ++iter )
61 // found one with the matching SceneGraph::PropertyNotification?
62 if( (*iter)->CompareSceneObject( propertyNotification ) )
64 // allow application to access the value that triggered this emit incase of NotifyOnChanged mode
65 (*iter)->SetNotifyResult(validity);
67 (*iter)->EmitSignalNotify();
73 PropertyNotificationManager::PropertyNotificationManager()
77 } // namespace Internal