X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Faccessibility%2Fbridge%2Fbridge-value.cpp;h=7f81a32b08bbe6ebcd3ab44e3138febc68880d88;hb=6af352690fe5cb16092dcf9de16357264288d89c;hp=aa1a34c1f370c6bd9e135950529fc45486de303d;hpb=99209cd1fcb650ceb7c04612f3fc161531610dff;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/accessibility/bridge/bridge-value.cpp b/dali/internal/accessibility/bridge/bridge-value.cpp index aa1a34c..7f81a32 100644 --- a/dali/internal/accessibility/bridge/bridge-value.cpp +++ b/dali/internal/accessibility/bridge/bridge-value.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -30,38 +30,45 @@ BridgeValue::BridgeValue() void BridgeValue::RegisterInterfaces() { DBus::DBusInterfaceDescription desc{AtspiDbusInterfaceValue}; - AddGetSetPropertyToInterface( desc, "CurrentValue", &BridgeValue::GetCurrentValue, &BridgeValue::SetCurrentValue ); - AddGetPropertyToInterface( desc, "MaximumValue", &BridgeValue::GetMaximumValue ); - AddGetPropertyToInterface( desc, "MinimumIncrement", &BridgeValue::GetMinimumIncrement ); - AddGetPropertyToInterface( desc, "MinimumValue", &BridgeValue::GetMinimumValue ); - dbusServer.addInterface( "/", desc, true ); + AddGetSetPropertyToInterface(desc, "CurrentValue", &BridgeValue::GetCurrentValue, &BridgeValue::SetCurrentValue); + AddGetPropertyToInterface(desc, "MaximumValue", &BridgeValue::GetMaximumValue); + AddGetPropertyToInterface(desc, "MinimumIncrement", &BridgeValue::GetMinimumIncrement); + AddGetPropertyToInterface(desc, "MinimumValue", &BridgeValue::GetMinimumValue); + mDbusServer.addInterface("/", desc, true); } Value* BridgeValue::FindSelf() const { - auto s = BridgeBase::FindSelf(); - assert( s ); - auto s2 = dynamic_cast< Value* >( s ); - if( !s2 ) - throw std::domain_error{"object " + s->GetAddress().ToString() + " doesn't have Value interface"}; - return s2; + auto self = BridgeBase::FindSelf(); + assert(self); + auto valueInterface = dynamic_cast(self); + if(!valueInterface) + { + throw std::domain_error{"object " + self->GetAddress().ToString() + " doesn't have Value interface"}; + } + return valueInterface; } + double BridgeValue::GetCurrentValue() { return FindSelf()->GetCurrent(); } -void BridgeValue::SetCurrentValue( double new_value ) + +void BridgeValue::SetCurrentValue(double newValue) { - FindSelf()->SetCurrent( new_value ); + FindSelf()->SetCurrent(newValue); } + double BridgeValue::GetMaximumValue() { return FindSelf()->GetMaximum(); } + double BridgeValue::GetMinimumIncrement() { return FindSelf()->GetMinimumIncrement(); } + double BridgeValue::GetMinimumValue() { return FindSelf()->GetMinimum();