void CSCLConnectionISF::set_selection(sclint start, sclint end)
{
if (m_initialized) {
- m_helper_agent.set_selection(start, end);
+ m_helper_agent.set_selection(start, end);
}
}
void CSCLConnectionISF::send_private_command(const sclchar *command)
{
if (m_initialized) {
- m_helper_agent.send_private_command(command);
+ m_helper_agent.send_private_command(command);
+ }
+}
+
+void CSCLConnectionISF::get_selection_text(sclchar **text)
+{
+ if (m_initialized) {
+ scim::String selection_text;
+ m_helper_agent.get_selection(selection_text);
+
+ if (text)
+ *text = strdup(selection_text.c_str());
}
}
void set_selection(sclint start, sclint end);
void send_private_command(const char *command);
void get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor);
+ void get_selection_text(sclchar **text);
private:
sclboolean m_initialized;
m_impl->send_private_command(command);
}
}
+
+void CSCLConnection::get_selection_text(sclchar **text)
+{
+ if (m_impl) {
+ m_impl->get_selection_text(text);
+ }
+}
virtual void set_selection(sclint start, sclint end);
virtual void send_private_command(const sclchar *command);
virtual void get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor);
+ virtual void get_selection_text(sclchar **text);
protected:
std::string m_backend_identifier;
m_impl->send_private_command(command);
}
}
+
+void CSCLCore::get_selection_text(sclchar **text) const
+{
+ if (m_impl) {
+ m_impl->get_selection_text(text);
+ }
+}
* @param[out] cursor The cursor position.
*/
void get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor) const;
+
+ /**
+ * @brief Get the selected text.
+ *
+ * @param[out] text The surrounding text.
+ */
+ void get_selection_text(sclchar **text) const;
private:
CSCLCoreImpl *m_impl;
};
{
m_connection.send_private_command(command);
}
+
+void CSCLCoreImpl::get_selection_text(sclchar **text)
+{
+ m_connection.get_selection_text(text);
+}
\ No newline at end of file
void set_selection(sclint start, sclint end);
void send_private_command(const sclchar *command);
void get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor);
+ void get_selection_text(sclchar **text);
private:
ISCLCoreEventCallback *m_event_callback;