-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// CLASS HEADER
-
#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
// EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/singleton-service.h>
// INTERNAL INCLUDES
-
#include <dali-toolkit/internal/focus-manager/focus-manager-impl.h>
namespace Dali
namespace Toolkit
{
-const char* const FocusManager::SIGNAL_FOCUS_CHANGED = "focus-changed";
-const char* const FocusManager::SIGNAL_FOCUS_OVERSHOT = "focus-overshot";
-const char* const FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated";
-const std::string FocusManager::ACTOR_FOCUSABLE("focusable");
-const std::string FocusManager::IS_FOCUS_GROUP("is-focus-group");
-
FocusManager::FocusManager()
{
}
FocusManager manager;
// Check whether the focus manager is already created
- Dali::Adaptor& adaptor = Dali::Adaptor::Get();
- Dali::BaseHandle handle = adaptor.GetSingleton(typeid(FocusManager));
- if(handle)
- {
- // If so, downcast the handle of singleton to focus manager
- manager = FocusManager(dynamic_cast<Internal::FocusManager*>(handle.GetObjectPtr()));
- }
-
- if(!manager)
+ SingletonService singletonService( SingletonService::Get() );
+ if ( singletonService )
{
- // If not, create the focus manager and register it as a singleton
- manager = FocusManager(new Internal::FocusManager());
- adaptor.RegisterSingleton(typeid(manager), manager);
+ Dali::BaseHandle handle = singletonService.GetSingleton(typeid(FocusManager));
+ if(handle)
+ {
+ // If so, downcast the handle of singleton to focus manager
+ manager = FocusManager(dynamic_cast<Internal::FocusManager*>(handle.GetObjectPtr()));
+ }
+
+ if(!manager)
+ {
+ // If not, create the focus manager and register it as a singleton
+ manager = FocusManager(new Internal::FocusManager());
+ singletonService.Register(typeid(manager), manager);
+ }
}
return manager;
return GetImpl(*this).GetFocusGroup(actor);
}
-FocusManager::FocusChangedSignalV2& FocusManager::FocusChangedSignal()
+FocusManager::FocusChangedSignalType& FocusManager::FocusChangedSignal()
{
return GetImpl(*this).FocusChangedSignal();
}
-FocusManager::FocusOvershotSignalV2& FocusManager::FocusOvershotSignal()
+FocusManager::FocusOvershotSignalType& FocusManager::FocusOvershotSignal()
{
return GetImpl(*this).FocusOvershotSignal();
}
-FocusManager::FocusedActorActivatedSignalV2& FocusManager::FocusedActorActivatedSignal()
+FocusManager::FocusedActorActivatedSignalType& FocusManager::FocusedActorActivatedSignal()
{
return GetImpl(*this).FocusedActorActivatedSignal();
}