KParts::TextExtension

Search for usage in LXR

#include <KParts/TextExtension>

Inheritance diagram for KParts::TextExtension:

Public Types

enum  Format { PlainText, HTML }
 

Signals

void selectionChanged ()
 

Public Member Functions

 TextExtension (KParts::ReadOnlyPart *parent)
 
virtual QString completeText (Format format) const
 
virtual int currentPage () const
 
virtual bool findText (const QString &string, KFind::SearchOptions options) const
 
virtual bool hasSelection () const
 
virtual int pageCount () const
 
virtual QString pageText (Format format) const
 
virtual QString selectedText (Format format) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static TextExtensionchildObject (QObject *obj)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

An extension for KParts that allows to retrieve text from the part.

For instance, the text-to-speech plugin uses this to speak the whole text from the part or the selected text. The translation plugin uses it for translating the selected text, and so on.

Since
4.6

Definition at line 33 of file textextension.h.

Member Function Documentation

◆ childObject()

KParts::TextExtension * KParts::TextExtension::childObject ( QObject obj)
static

Queries obj for a child object which inherits from this TextExtension class.

Definition at line 41 of file textextension.cpp.

◆ completeText()

QString KParts::TextExtension::completeText ( Format  format) const
virtual

Returns the complete text shown in the part, in the requested format.

If the format is not supported, the part must return an empty string.

Definition at line 36 of file textextension.cpp.

◆ currentPage()

int KParts::TextExtension::currentPage ( ) const
virtual

Returns the current page (between 0 and pageCount()-1), for parts who support the concept of pages.

Otherwise returns 0.

Definition at line 51 of file textextension.cpp.

◆ findText()

bool KParts::TextExtension::findText ( const QString string,
KFind::SearchOptions  options 
) const
virtual

Returns true if string is found using the given options.

If any text matches string, then it will be selected/highlighted. To find the next matching text, simply call this function again with the same search text until it returns false.

To clear a selection, just pass an empty string.

Note that parts that implement this extension might not support all the options available in KFind::SearchOptions.

Definition at line 61 of file textextension.cpp.

◆ hasSelection()

bool KParts::TextExtension::hasSelection ( ) const
virtual

Returns true if the user selected text in the part.

Definition at line 26 of file textextension.cpp.

◆ pageCount()

int KParts::TextExtension::pageCount ( ) const
virtual

Returns the number of pages, for parts who support the concept of pages.

Otherwise returns 0.

Definition at line 46 of file textextension.cpp.

◆ pageText()

QString KParts::TextExtension::pageText ( Format  format) const
virtual

Returns the text in a given page, in the requested format.

Definition at line 56 of file textextension.cpp.

◆ selectedText()

QString KParts::TextExtension::selectedText ( Format  format) const
virtual

Returns the selected text, in the requested format.

If the format is not supported, the part must return an empty string.

Definition at line 31 of file textextension.cpp.

◆ selectionChanged

void KParts::TextExtension::selectionChanged ( )
signal

This signal is emitted when the selection changes.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:53:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.