// EXTERNAL INCLUDES
#include <string>
+#include <dali/public-api/math/rect.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility.h>
virtual bool SetRangeOfSelection(std::size_t selectionIndex, std::size_t startOffset, std::size_t endOffset) = 0;
/**
+ * @brief Gets the bounding box for text within a range in text.
+ *
+ * @param[in] startOffset The index of first character
+ * @param[in] endOffset The index of first character after the last one expected
+ * @param[in] type The enumeration with type of coordinate system
+ *
+ * @return Rect<> giving the position and size of the specified range of text
+ * @remarks This method is `GetRangeExtents` in DBus method.
+ */
+ virtual Rect<> GetRangeExtents(std::size_t startOffset, std::size_t endOffset, CoordinateType type) = 0;
+
+ /**
* @brief Downcasts an Accessible to a Text.
*
* @param obj The Accessible
mDirectReadingClient.method<DBus::ValueOrError<void>(bool)>("PauseResume").asyncCall([](DBus::ValueOrError<void> msg) {
if(!msg)
{
- LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")\n";
}
},
true);
mDirectReadingClient.method<DBus::ValueOrError<void>(bool)>("PauseResume").asyncCall([](DBus::ValueOrError<void> msg) {
if(!msg)
{
- LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")\n";
}
},
false);
mDirectReadingClient.method<DBus::ValueOrError<void>(bool)>("StopReading").asyncCall([](DBus::ValueOrError<void> msg) {
if(!msg)
{
- LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")\n";
}
},
alsoNonDiscardable);
mDirectReadingClient.method<DBus::ValueOrError<std::string, bool, int32_t>(std::string, bool)>("ReadCommand").asyncCall([=](DBus::ValueOrError<std::string, bool, int32_t> msg) {
if(!msg)
{
- LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")\n";
}
else if(callback)
{
AddFunctionToInterface(desc, "GetSelection", &BridgeText::GetRangeOfSelection);
AddFunctionToInterface(desc, "SetSelection", &BridgeText::SetRangeOfSelection);
AddFunctionToInterface(desc, "RemoveSelection", &BridgeText::RemoveSelection);
+ AddFunctionToInterface(desc, "GetRangeExtents", &BridgeText::GetRangeExtents);
mDbusServer.addInterface("/", desc, true);
}
{
return FindSelf()->SetRangeOfSelection(selectionIndex, startOffset, endOffset);
}
+
+DBus::ValueOrError<int32_t, int32_t, int32_t, int32_t> BridgeText::GetRangeExtents(int32_t startOffset, int32_t endOffset, uint32_t coordType)
+{
+ auto rect = FindSelf()->GetRangeExtents(startOffset, endOffset, static_cast<CoordinateType>(coordType));
+ return {static_cast<int32_t>(rect.x), static_cast<int32_t>(rect.y), static_cast<int32_t>(rect.width), static_cast<int32_t>(rect.height)};
+}
* @copydoc Dali::Accessibility::Text::SetRangeOfSelection()
*/
DBus::ValueOrError<bool> SetRangeOfSelection(int32_t selectionIndex, int32_t startOffset, int32_t endOffset);
+
+ /**
+ * @copydoc Dali::Accessibility::Text::GetRangeExtents()
+ */
+ DBus::ValueOrError<int32_t, int32_t, int32_t, int32_t> GetRangeExtents(int32_t startOffset, int32_t endOffset, uint32_t coordType);
};
#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_TEXT_H