}
mData->mCurrentlyHighlightedActor = {};
mData->mHighlightActor = {};
+
+ mDisabledSignal.Emit();
}
mHighlightedActor = {};
mHighlightClearAction = {};
auto window = Dali::DevelWindow::Get(rootLayer);
EmitActivate(window); // Currently, sends a signal that the default window is activated here.
}
+
+ mEnabledSignal.Emit();
+
return ForceUpResult::JUST_STARTED;
}
}
}
- void ReadAndListenProperty()
+ void ReadIsEnabledProperty()
{
- // read property
- auto enabled = mAccessibilityStatusClient.property<bool>("ScreenReaderEnabled").get();
- if(enabled)
- {
- mIsScreenReaderEnabled = std::get<0>(enabled);
- }
-
- enabled = mAccessibilityStatusClient.property<bool>("IsEnabled").get();
- if(enabled)
- {
- mIsEnabled = std::get<0>(enabled);
- }
-
- if(mIsScreenReaderEnabled || mIsEnabled)
- {
- ForceUp();
- }
+ mAccessibilityStatusClient.property<bool>("IsEnabled").asyncGet([this](DBus::ValueOrError<bool> msg) {
+ if(!msg)
+ {
+ DALI_LOG_ERROR("Get IsEnabled property error: %s\n", msg.getError().message.c_str());
+ if(msg.getError().errorType == DBus::ErrorType::INVALID_REPLY)
+ {
+ ReadIsEnabledProperty();
+ }
+ return;
+ }
+ mIsEnabled = std::get<0>(msg);
+ if(mIsEnabled)
+ {
+ ForceUp();
+ }
+ });
+ }
- // listen property change
- mAccessibilityStatusClient.addPropertyChangedEvent<bool>("ScreenReaderEnabled", [this](bool res) {
- mIsScreenReaderEnabled = res;
+ void ListenIsEnabledProperty()
+ {
+ mAccessibilityStatusClient.addPropertyChangedEvent<bool>("IsEnabled", [this](bool res) {
+ mIsEnabled = res;
if(mIsScreenReaderEnabled || mIsEnabled)
{
ForceUp();
ForceDown();
}
});
+ }
- mAccessibilityStatusClient.addPropertyChangedEvent<bool>("IsEnabled", [this](bool res) {
- mIsEnabled = res;
+ void ReadScreenReaderEnabledProperty()
+ {
+ mAccessibilityStatusClient.property<bool>("ScreenReaderEnabled").asyncGet([this](DBus::ValueOrError<bool> msg) {
+ if(!msg)
+ {
+ DALI_LOG_ERROR("Get ScreenReaderEnabled property error: %s\n", msg.getError().message.c_str());
+ if(msg.getError().errorType == DBus::ErrorType::INVALID_REPLY)
+ {
+ ReadScreenReaderEnabledProperty();
+ }
+ return;
+ }
+ mIsScreenReaderEnabled = std::get<0>(msg);
+ if(mIsScreenReaderEnabled)
+ {
+ ForceUp();
+ }
+ });
+ }
+
+ void ListenScreenReaderEnabledProperty()
+ {
+ mAccessibilityStatusClient.addPropertyChangedEvent<bool>("ScreenReaderEnabled", [this](bool res) {
+ mIsScreenReaderEnabled = res;
if(mIsScreenReaderEnabled || mIsEnabled)
{
ForceUp();
});
}
+ void ReadAndListenProperties()
+ {
+ ReadIsEnabledProperty();
+ ListenIsEnabledProperty();
+
+ ReadScreenReaderEnabledProperty();
+ ListenScreenReaderEnabledProperty();
+ }
+
bool InitializeAccessibilityStatusClient()
{
mAccessibilityStatusClient = DBus::DBusClient{A11yDbusName, A11yDbusPath, A11yDbusStatusInterface, DBus::ConnectionType::SESSION};
{
if ( InitializeAccessibilityStatusClient() )
{
- ReadAndListenProperty();
+ ReadAndListenProperties();
mIdleCallback = NULL;
return false;
}
{
if ( InitializeAccessibilityStatusClient() )
{
- ReadAndListenProperty();
+ ReadAndListenProperties();
return;
}