KTextEditor::View

Search for usage in LXR

#include <KTextEditor/View>

Inheritance diagram for KTextEditor::View:

Public Types

enum  InputMode { NormalInputMode = 0, ViInputMode = 1 }
 
enum  LineType { RealLine = 0, VisibleLine = 1 }
 
enum  ViewMode {
  NormalModeInsert = 0, NormalModeOverwrite = 1, ViModeNormal = 10, ViModeInsert = 11,
  ViModeVisual = 12, ViModeVisualLine = 13, ViModeVisualBlock = 14, ViModeReplace = 15
}
 
- Public Types inherited from QWidget
enum  RenderFlag
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 

Signals

void configChanged (KTextEditor::View *view)
 
void contextMenuAboutToShow (KTextEditor::View *view, QMenu *menu)
 
void cursorPositionChanged (KTextEditor::View *view, const KTextEditor::Cursor &newPosition)
 
void focusIn (KTextEditor::View *view)
 
void focusOut (KTextEditor::View *view)
 
void horizontalScrollPositionChanged (KTextEditor::View *view)
 
void mousePositionChanged (KTextEditor::View *view, const KTextEditor::Cursor &newPosition)
 
void selectionChanged (KTextEditor::View *view)
 
void statusBarEnabledChanged (KTextEditor::View *view, bool enabled)
 
void textInserted (KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
 
void verticalScrollPositionChanged (KTextEditor::View *view, const KTextEditor::Cursor &newPos)
 
void viewInputModeChanged (KTextEditor::View *view, KTextEditor::View::InputMode mode)
 
void viewModeChanged (KTextEditor::View *view, KTextEditor::View::ViewMode mode)
 

Public Member Functions

virtual ~View ()
 
virtual bool blockSelection () const =0
 
virtual QMenucontextMenu () const =0
 
virtual KTextEditor::Cursor coordinatesToCursor (const QPoint &coord) const =0
 
virtual Cursor cursorPosition () const =0
 
virtual QPoint cursorPositionCoordinates () const =0
 
virtual Cursor cursorPositionVirtual () const =0
 
virtual QPoint cursorToCoordinate (const KTextEditor::Cursor &cursor) const =0
 
virtual QMenudefaultContextMenu (QMenu *menu=nullptr) const =0
 
virtual KTextEditor::Attribute::Ptr defaultStyleAttribute (KTextEditor::DefaultStyle defaultStyle) const =0
 
virtual Documentdocument () const =0
 
int firstDisplayedLine (LineType lineType=RealLine) const
 
bool insertTemplate (const KTextEditor::Cursor &insertPosition, const QString &templateString, const QString &script=QString())
 
virtual bool insertText (const QString &text)
 
bool isStatusBarEnabled () const
 
int lastDisplayedLine (LineType lineType=RealLine) const
 
virtual QList< KTextEditor::AttributeBlocklineAttributes (int line)=0
 
virtual KTextEditor::MainWindowmainWindow () const =0
 
KTextEditor::Cursor maxScrollPosition () const
 
virtual bool mouseTrackingEnabled () const =0
 
virtual bool print ()=0
 
virtual void printPreview ()=0
 
virtual void readSessionConfig (const KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
 
virtual bool removeSelection ()=0
 
virtual bool removeSelectionText ()=0
 
virtual bool selection () const =0
 
virtual Range selectionRange () const =0
 
virtual QString selectionText () const =0
 
virtual bool setBlockSelection (bool on)=0
 
virtual void setContextMenu (QMenu *menu)=0
 
virtual bool setCursorPosition (Cursor position)=0
 
void setHorizontalScrollPosition (int x)
 
virtual bool setMouseTrackingEnabled (bool enable)=0
 
void setScrollPosition (KTextEditor::Cursor &cursor)
 
virtual bool setSelection (const Range &range)=0
 
void setStatusBarEnabled (bool enable)
 
void setViewInputMode (InputMode inputMode)
 
QRect textAreaRect () const
 
KSyntaxHighlighting::Theme theme () const
 
virtual InputMode viewInputMode () const =0
 
virtual QString viewInputModeHuman () const =0
 
virtual ViewMode viewMode () const =0
 
virtual QString viewModeHuman () const =0
 
virtual void writeSessionConfig (KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
 
- Public Member Functions inherited from QWidget
 QWidget (QWidget *parent, Qt::WindowFlags f)
 
bool acceptDrops () const const
 
QString accessibleDescription () const const
 
QString accessibleName () const const
 
QList< QAction * > actions () const const
 
void activateWindow ()
 
void addAction (QAction *action)
 
void addActions (QList< QAction * > actions)
 
void adjustSize ()
 
bool autoFillBackground () const const
 
QPalette::ColorRole backgroundRole () const const
 
QBackingStorebackingStore () const const
 
QSize baseSize () const const
 
QWidgetchildAt (int x, int y) const const
 
QWidgetchildAt (const QPoint &p) const const
 
QRect childrenRect () const const
 
QRegion childrenRegion () const const
 
void clearFocus ()
 
void clearMask ()
 
bool close ()
 
QMargins contentsMargins () const const
 
QRect contentsRect () const const
 
Qt::ContextMenuPolicy contextMenuPolicy () const const
 
QCursor cursor () const const
 
void customContextMenuRequested (const QPoint &pos)
 
WId effectiveWinId () const const
 
void ensurePolished () const const
 
Qt::FocusPolicy focusPolicy () const const
 
QWidgetfocusProxy () const const
 
QWidgetfocusWidget () const const
 
const QFontfont () const const
 
QFontInfo fontInfo () const const
 
QFontMetrics fontMetrics () const const
 
QPalette::ColorRole foregroundRole () const const
 
QRect frameGeometry () const const
 
QSize frameSize () const const
 
const QRectgeometry () const const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const const
 
QPixmap grab (const QRect &rectangle)
 
void grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags)
 
void grabKeyboard ()
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context)
 
QGraphicsEffectgraphicsEffect () const const
 
QGraphicsProxyWidgetgraphicsProxyWidget () const const
 
bool hasEditFocus () const const
 
bool hasFocus () const const
 
virtual bool hasHeightForWidth () const const
 
bool hasMouseTracking () const const
 
bool hasTabletTracking () const const
 
int height () const const
 
virtual int heightForWidth (int w) const const
 
void hide ()
 
Qt::InputMethodHints inputMethodHints () const const
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const const
 
void insertAction (QAction *before, QAction *action)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
bool isActiveWindow () const const
 
bool isAncestorOf (const QWidget *child) const const
 
bool isEnabled () const const
 
bool isEnabledTo (const QWidget *ancestor) const const
 
bool isEnabledToTLW () const const
 
bool isFullScreen () const const
 
bool isHidden () const const
 
bool isMaximized () const const
 
bool isMinimized () const const
 
bool isModal () const const
 
bool isTopLevel () const const
 
bool isVisible () const const
 
bool isVisibleTo (const QWidget *ancestor) const const
 
bool isWindow () const const
 
bool isWindowModified () const const
 
QLayoutlayout () const const
 
Qt::LayoutDirection layoutDirection () const const
 
QLocale locale () const const
 
void lower ()
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const const
 
QPoint mapFromGlobal (const QPoint &pos) const const
 
QPoint mapFromParent (const QPoint &pos) const const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const const
 
QPoint mapToGlobal (const QPoint &pos) const const
 
QPoint mapToParent (const QPoint &pos) const const
 
QRegion mask () const const
 
int maximumHeight () const const
 
QSize maximumSize () const const
 
int maximumWidth () const const
 
int minimumHeight () const const
 
QSize minimumSize () const const
 
virtual QSize minimumSizeHint () const const
 
int minimumWidth () const const
 
void move (int x, int y)
 
void move (const QPoint &)
 
QWidgetnativeParentWidget () const const
 
QWidgetnextInFocusChain () const const
 
QRect normalGeometry () const const
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
virtual QPaintEnginepaintEngine () const const override
 
const QPalettepalette () const const
 
QWidgetparentWidget () const const
 
QPoint pos () const const
 
QWidgetpreviousInFocusChain () const const
 
 QWIDGETSIZE_MAX QWIDGETSIZE_MAX
 
void raise ()
 
QRect rect () const const
 
void releaseKeyboard ()
 
void releaseMouse ()
 
void releaseShortcut (int id)
 
void removeAction (QAction *action)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint ()
 
void repaint (int x, int y, int w, int h)
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &rgn)
 
void resize (int w, int h)
 
void resize (const QSize &)
 
bool restoreGeometry (const QByteArray &geometry)
 
QByteArray saveGeometry () const const
 
QScreenscreen () const const
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &r)
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute attribute, bool on)
 
void setAutoFillBackground (bool enabled)
 
void setBackgroundRole (QPalette::ColorRole role)
 
void setBaseSize (int basew, int baseh)
 
void setBaseSize (const QSize &)
 
void setContentsMargins (const QMargins &margins)
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &)
 
void setDisabled (bool disable)
 
void setEditFocus (bool enable)
 
void setEnabled (bool)
 
void setFixedHeight (int h)
 
void setFixedSize (const QSize &s)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFocus (Qt::FocusReason reason)
 
void setFocus ()
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *w)
 
void setFont (const QFont &)
 
void setForegroundRole (QPalette::ColorRole role)
 
void setGeometry (const QRect &)
 
void setGeometry (int x, int y, int w, int h)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void setHidden (bool hidden)
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *layout)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (int maxw, int maxh)
 
void setMaximumSize (const QSize &)
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &)
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 
void setParent (QWidget *parent)
 
void setShortcutAutoRepeat (int id, bool enable)
 
void setShortcutEnabled (int id, bool enable)
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
void setStatusTip (const QString &)
 
void setStyle (QStyle *style)
 
void setStyleSheet (const QString &styleSheet)
 
void setTabletTracking (bool enable)
 
void setToolTip (const QString &)
 
void setToolTipDuration (int msec)
 
void setUpdatesEnabled (bool enable)
 
void setupUi (QWidget *widget)
 
virtual void setVisible (bool visible)
 
void setWhatsThis (const QString &)
 
void setWindowFilePath (const QString &filePath)
 
void setWindowFlag (Qt::WindowType flag, bool on)
 
void setWindowFlags (Qt::WindowFlags type)
 
void setWindowIcon (const QIcon &icon)
 
void setWindowIconText (const QString &)
 
void setWindowModality (Qt::WindowModality windowModality)
 
void setWindowModified (bool)
 
void setWindowOpacity (qreal level)
 
void setWindowRole (const QString &role)
 
void setWindowState (Qt::WindowStates windowState)
 
void setWindowTitle (const QString &)
 
void show ()
 
void showFullScreen ()
 
void showMaximized ()
 
void showMinimized ()
 
void showNormal ()
 
QSize size () const const
 
virtual QSize sizeHint () const const
 
QSize sizeIncrement () const const
 
QSizePolicy sizePolicy () const const
 
void stackUnder (QWidget *w)
 
QString statusTip () const const
 
QStylestyle () const const
 
QString styleSheet () const const
 
bool testAttribute (Qt::WidgetAttribute attribute) const const
 
QString toolTip () const const
 
int toolTipDuration () const const
 
QWidgettopLevelWidget () const const
 
bool underMouse () const const
 
void ungrabGesture (Qt::GestureType gesture)
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (int x, int y, int w, int h)
 
void update (const QRect &rect)
 
void update (const QRegion &rgn)
 
void update ()
 
void updateGeometry ()
 
bool updatesEnabled () const const
 
QRegion visibleRegion () const const
 
QString whatsThis () const const
 
int width () const const
 
QWidgetwindow () const const
 
QString windowFilePath () const const
 
Qt::WindowFlags windowFlags () const const
 
QWindowwindowHandle () const const
 
QIcon windowIcon () const const
 
void windowIconChanged (const QIcon &icon)
 
QString windowIconText () const const
 
void windowIconTextChanged (const QString &iconText)
 
Qt::WindowModality windowModality () const const
 
qreal windowOpacity () const const
 
QString windowRole () const const
 
Qt::WindowStates windowState () const const
 
QString windowTitle () const const
 
void windowTitleChanged (const QString &title)
 
Qt::WindowType windowType () const const
 
WId winId () const const
 
int x () const const
 
int y () const 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 eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (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
 
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 (QObject *object)
 
qobject_cast (const 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
 
- Public Member Functions inherited from QPaintDevice
int colorCount () const const
 
int depth () const const
 
int devicePixelRatio () const const
 
qreal devicePixelRatioF () const const
 
int height () const const
 
int heightMM () const const
 
int logicalDpiX () const const
 
int logicalDpiY () const const
 
bool paintingActive () const const
 
int physicalDpiX () const const
 
int physicalDpiY () const const
 
int width () const const
 
int widthMM () const const
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient (KXMLGUIClient *parent)
 
QActionaction (const char *name) const
 
virtual QActionaction (const QDomElement &element) const
 
virtual KActionCollectionactionCollection () const
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilderclientBuilder () const
 
virtual QString componentName () const
 
virtual QDomDocument domDocument () const
 
KXMLGUIFactoryfactory () const
 
void insertChildClient (KXMLGUIClient *child)
 
KXMLGUIClientparentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
void reloadXML ()
 
void removeChildClient (KXMLGUIClient *child)
 
void replaceXMLFile (const QString &xmlfile, const QString &localxmlfile, bool merge=false)
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
void setFactory (KXMLGUIFactory *factory)
 
void setXMLGUIBuildDocument (const QDomDocument &doc)
 
void unplugActionList (const QString &name)
 
virtual QString xmlFile () const
 
QDomDocument xmlguiBuildDocument () const
 

Protected Member Functions

 View (ViewPrivate *impl, QWidget *parent)
 
- Protected Member Functions inherited from QWidget
virtual void actionEvent (QActionEvent *event)
 
virtual void changeEvent (QEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 
void create (WId window, bool initializeWindow, bool destroyOldWindow)
 
void destroy (bool destroyWindow, bool destroySubWindows)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void enterEvent (QEvent *event)
 
virtual bool event (QEvent *event) override
 
virtual void focusInEvent (QFocusEvent *event)
 
bool focusNextChild ()
 
virtual bool focusNextPrevChild (bool next)
 
virtual void focusOutEvent (QFocusEvent *event)
 
bool focusPreviousChild ()
 
virtual void hideEvent (QHideEvent *event)
 
virtual void initPainter (QPainter *painter) const const override
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
virtual int metric (QPaintDevice::PaintDeviceMetric m) const const override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
void updateMicroFocus ()
 
virtual void wheelEvent (QWheelEvent *event)
 
- 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)
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
virtual void setComponentName (const QString &componentName, const QString &componentDisplayName)
 
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)
 
virtual void setLocalXMLFile (const QString &file)
 
virtual void setXML (const QString &document, bool merge=false)
 
virtual void setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true)
 
virtual void stateChanged (const QString &newstate, ReverseStateChange reverse=StateNoReverse)
 

Additional Inherited Members

- Properties inherited from QWidget
 acceptDrops
 
 accessibleDescription
 
 accessibleName
 
 autoFillBackground
 
 baseSize
 
 childrenRect
 
 childrenRegion
 
 contextMenuPolicy
 
 cursor
 
 enabled
 
 focus
 
 focusPolicy
 
 font
 
 frameGeometry
 
 frameSize
 
 fullScreen
 
 geometry
 
 height
 
 inputMethodHints
 
 isActiveWindow
 
 layoutDirection
 
 locale
 
 maximized
 
 maximumHeight
 
 maximumSize
 
 maximumWidth
 
 minimized
 
 minimumHeight
 
 minimumSize
 
 minimumSizeHint
 
 minimumWidth
 
 modal
 
 mouseTracking
 
 normalGeometry
 
 palette
 
 pos
 
 rect
 
 size
 
 sizeHint
 
 sizeIncrement
 
 sizePolicy
 
 statusTip
 
 styleSheet
 
 tabletTracking
 
 toolTip
 
 toolTipDuration
 
 updatesEnabled
 
 visible
 
 whatsThis
 
 width
 
 windowFilePath
 
 windowFlags
 
 windowIcon
 
 windowIconText
 
 windowModality
 
 windowModified
 
 windowOpacity
 
 windowTitle
 
 x
 
 y
 
- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QWidget
QWidgetcreateWindowContainer (QWindow *window, QWidget *parent, Qt::WindowFlags flags)
 
QWidgetfind (WId id)
 
QWidgetkeyboardGrabber ()
 
QWidgetmouseGrabber ()
 
void setTabOrder (QWidget *first, QWidget *second)
 
- 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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findVersionNumber (const QString &xml)
 
- Public Attributes inherited from QWidget
 DrawChildren
 
 DrawWindowBackground
 
 IgnoreMask
 
typedef RenderFlags
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Public Attributes inherited from QPaintDevice
 PdmDepth
 
 PdmDevicePixelRatio
 
 PdmDevicePixelRatioScaled
 
 PdmDpiX
 
 PdmDpiY
 
 PdmHeight
 
 PdmHeightMM
 
 PdmNumColors
 
 PdmPhysicalDpiX
 
 PdmPhysicalDpiY
 
 PdmWidth
 
 PdmWidthMM
 
- Static Protected Member Functions inherited from KXMLGUIClient
static QString standardsXmlFileLocation ()
 

Detailed Description

A text widget with KXMLGUIClient that represents a Document.

Topics:

Introduction

The View class represents a single view of a KTextEditor::Document, get the document on which the view operates with document(). A view provides both the graphical representation of the text and the KXMLGUIClient for the actions. The view itself does not provide text manipulation, use the methods from the Document instead. The only method to insert text is insertText(), which inserts the given text at the current cursor position and emits the signal textInserted().

Usually a view is created by using Document::createView(). Furthermore a view can have a context menu. Set it with setContextMenu() and get it with contextMenu().

Merging the View's GUI

A View is derived from the class KXMLGUIClient, so its GUI elements (like menu entries and toolbar items) can be merged into the application's GUI (or into a KXMLGUIFactory) by calling

// view is of type KTextEditor::View*

You can add only one view as client, so if you have several views, you first have to remove the current view, and then add the new one, like this

mainWindow()->guiFactory()->removeClient( currentView );
mainWindow()->guiFactory()->addClient( newView );

Text Selection

As the view is a graphical text editor it provides normal and block text selection. You can check with selection() whether a selection exists. removeSelection() will remove the selection without removing the text, whereas removeSelectionText() also removes both, the selection and the selected text. Use selectionText() to get the selected text and setSelection() to specify the selected text range. The signal selectionChanged() is emitted whenever the selection changed.

Cursor Positions

A view has one Cursor which represents a line/column tuple. Two different kinds of cursor positions are supported: first is the real cursor position where a tab character only counts one character. Second is the virtual cursor position, where a tab character counts as many spaces as defined. Get the real position with cursorPosition() and the virtual position with cursorPositionVirtual(). Set the real cursor position with setCursorPosition(). The signal cursorPositionChanged() is emitted whenever the cursor position changed.

Screen coordinates of the current text cursor position in pixels are obtained through cursorPositionCoordinates(). Further conversion of screen pixel coordinates and text cursor positions are provided by cursorToCoordinate() and coordinatesToCursor().

Mouse Tracking

It is possible to get notified via the signal mousePositionChanged() for mouse move events, if mouseTrackingEnabled() returns true. Mouse tracking can be turned on/off by calling setMouseTrackingEnabled(). If an editor implementation does not support mouse tracking, mouseTrackingEnabled() will always return false.

Input/View Modes

A view supports several input modes. Common input modes are NormalInputMode and ViInputMode. Which input modes the editor supports depends on the implementation. The getter viewInputMode() returns enum representing the current mode.

Input modes can have their own view modes. In case of default NormalInputMode those are NormalModeInsert and NormalModeOverwrite. You can use viewMode() getter to obtain those.

For viewMode() and viewInputMode() there are also variants with Human suffix, which returns the human readable representation (i18n) usable for displaying in user interface.

Whenever the input/view mode changes the signals viewInputModeChanged()/viewModeChanged() are emitted.

View Extension Interfaces

A simple view represents the text of a Document and provides a text cursor, text selection, edit modes etc. Advanced concepts like code completion and text hints are defined in the extension interfaces. An KTextEditor implementation does not need to support all the extensions. To implement the interfaces multiple inheritance is used.

More information about interfaces for the view can be found in View Extension Interfaces.

See also
KTextEditor::Document, KTextEditor::CodeCompletionInterface, KXMLGUIClient
Author
Christoph Cullmann <cullm[email protected][email protected][email protected]kde.o[email protected]rg>

Definition at line 146 of file view.h.

Member Enumeration Documentation

Possible input modes.

These correspond to various modes the text editor might be in.

Enumerator
NormalInputMode 

Normal Mode.

ViInputMode 

Vi mode.

The view will behave like the editor vi(m)

Definition at line 189 of file view.h.

Possible line types.

Since
5.33
Enumerator
RealLine 

Real line.

VisibleLine 

Visible line.

Line that is not folded.

Definition at line 214 of file view.h.

Possible view modes These correspond to various modes the text editor might be in.

Enumerator
NormalModeInsert 

Insert mode.

Characters will be added.

NormalModeOverwrite 

Overwrite mode.

Characters will be replaced.

Definition at line 198 of file view.h.

Constructor & Destructor Documentation

View::View ( ViewPrivate *  impl,
QWidget parent 
)
protected

Constructor.

Create a view attached to the widget parent.

Pass it the internal implementation to store a d-pointer.

Parameters
impld-pointer to use
parentparent widget
See also
Document::createView()

Definition at line 203 of file ktexteditor.cpp.

View::~View ( )
virtualdefault

Virtual destructor.

Member Function Documentation

virtual bool KTextEditor::View::blockSelection ( ) const
pure virtual

Get the status of the selection mode.

true indicates that block selection mode is on. If this is true, selections applied via the SelectionInterface are handled as block selections and the Copy&Paste functions work on rectangular blocks of text rather than normal.

Returns
true, if block selection mode is enabled, otherwise false
See also
setBlockSelection()
void KTextEditor::View::configChanged ( KTextEditor::View view)
signal

This signal is emitted whenever the current view configuration is changed.

Parameters
viewthe view which's config has changed
Since
5.79
virtual QMenu* KTextEditor::View::contextMenu ( ) const
pure virtual

Get the context menu for this view.

The return value can be NULL if no context menu object was set and kxmlgui is not initialized yet. If there is no user set menu, the kxmlgui menu is returned. Do not delete this menu, if if it is the xmlgui menu.

Returns
context menu object
See also
setContextMenu()
void KTextEditor::View::contextMenuAboutToShow ( KTextEditor::View view,
QMenu menu 
)
signal

Signal which is emitted immediately prior to showing the current context menu.

virtual KTextEditor::Cursor KTextEditor::View::coordinatesToCursor ( const QPoint coord) const
pure virtual

Get the text-cursor in the document from the screen coordinates, relative to the view widget.

To map a cursor to pixel coordinates (the reverse transformation) use cursorToCoordinate().

Parameters
coordcoordinates relative to the view widget
Returns
cursor in the View, that points onto the character under the given coordinate. May be KTextEditor::Cursor::invalid().
virtual Cursor KTextEditor::View::cursorPosition ( ) const
pure virtual

Get the view's current cursor position.

A TAB character is handeled as only one character.

Returns
current cursor position
See also
setCursorPosition()
void KTextEditor::View::cursorPositionChanged ( KTextEditor::View view,
const KTextEditor::Cursor newPosition 
)
signal

This signal is emitted whenever the view's cursor position changed.

Parameters
viewview which emitted the signal
newPositionnew position of the cursor (Kate will pass the real cursor position, not the virtual)
See also
cursorPosition(), cursorPositionVirtual()
virtual QPoint KTextEditor::View::cursorPositionCoordinates ( ) const
pure virtual

Get the screen coordinates (x, y) of the cursor position in pixels.

The returned coordinates are relative to the View such that (0, 0) represents tht top-left corner of the View.

If global screen coordinates are required, e.g. for showing a QToolTip, convert the view coordinates to global screen coordinates as follows:

QPoint viewCoordinates = view->cursorPositionCoordinates();
QPoint globalCoorinates = view->mapToGlobal(viewCoordinates);
Returns
cursor screen coordinates
See also
cursorToCoordinate(), coordinatesToCursor()
virtual Cursor KTextEditor::View::cursorPositionVirtual ( ) const
pure virtual

Get the current virtual cursor position, virtual means the tabulator character (TAB) counts multiple characters, as configured by the user (e.g.

one TAB is 8 spaces). The virtual cursor position provides access to the user visible values of the current cursor position.

Returns
virtual cursor position
See also
cursorPosition()
virtual QPoint KTextEditor::View::cursorToCoordinate ( const KTextEditor::Cursor cursor) const
pure virtual

Get the screen coordinates (x, y) of the supplied cursor relative to the view widget in pixels.

Thus, (0, 0) represents the top left hand of the view widget.

To map pixel coordinates to a Cursor position (the reverse transformation) use coordinatesToCursor().

Parameters
cursorcursor to determine coordinate for.
Returns
cursor screen coordinates relative to the view widget
See also
cursorPositionCoordinates(), coordinatesToCursor()
virtual QMenu* KTextEditor::View::defaultContextMenu ( QMenu menu = nullptr) const
pure virtual

Populate menu with default text editor actions.

If menu is null, a menu will be created with the view as its parent.

Note
to use this menu, you will next need to call setContextMenu(), as this does not assign the new context menu.
Warning
This contains only basic options from the editor component (katepart). Plugins are not merged/integrated into it! If you want to be a better citizen and take full advantage of KTextEditor plugins do something like:
KXMLGUIClient* client = view;
// search parent XmlGuiClient
while (client->parentClient()) {
client = client->parentClient();
}
if (client->factory()) {
const QList<QWidget*> menuContainers = client->factory()->containers("menu");
for (QWidget *w : menuContainers) {
if (w->objectName() == "ktexteditor_popup") {
// do something with the menu (ie adding an onshow handler)
break;
}
}
}
or simply use the aboutToShow, aboutToHide signals !!!!!
Parameters
menuthe menu to be populated, or null to create a new menu.
Returns
the menu, whether created or passed initially
virtual KTextEditor::Attribute::Ptr KTextEditor::View::defaultStyleAttribute ( KTextEditor::DefaultStyle  defaultStyle) const
pure virtual

Returns the attribute for the default style defaultStyle.

Parameters
defaultStyledefault style to get the attribute for
See also
KTextEditor::Attribute
virtual Document* KTextEditor::View::document ( ) const
pure virtual

Get the view's document, that means the view is a view of the returned document.

Returns
the view's document
int View::firstDisplayedLine ( LineType  lineType = RealLine) const

Get the first displayed line in the view.

Note
If code is folded, many hundred lines can be between firstDisplayedLine() and lastDisplayedLine().
Parameters
lineTypeif RealLine (the default), it returns the real line number accounting for folded regions. In that case it walks over all folded regions O(n) for n == number of folded ranges
Returns
the first displayed line
See also
lastDisplayedLine()
Since
5.33

Definition at line 394 of file ktexteditor.cpp.

void KTextEditor::View::focusIn ( KTextEditor::View view)
signal

This signal is emitted whenever the view gets the focus.

Parameters
viewview which gets focus
See also
focusOut()
void KTextEditor::View::focusOut ( KTextEditor::View view)
signal

This signal is emitted whenever the view loses the focus.

Parameters
viewview which lost focus
See also
focusIn()
void KTextEditor::View::horizontalScrollPositionChanged ( KTextEditor::View view)
signal

This signal should be emitted whenever the view is scrolled horizontally.

Parameters
viewview which emitted the signal
bool View::insertTemplate ( const KTextEditor::Cursor insertPosition,
const QString templateString,
const QString script = QString() 
)

Insert a template into the document.

The template can have editable fields which can be filled by the user. You can create editable fields with ${fieldname}; multiple fields with the same name will have their contents synchronized automatically, and only the first one is editable in this case. Fields can have a default value specified by writing ${fieldname=default}. Note that `default' is a JavaScript expression and strings need to be quoted. You can also provide a piece of JavaScript for more complex logic. To create a field which provides text based on a JS function call and the values of the other, editable fields, use the ${func()} syntax. func() must be a callable object defined in script. You can pass arguments to the function by just writing any constant expression or a field name.

Parameters
insertPositionwhere to insert the template
templateStringtemplate to insert using the above syntax
scriptscript with functions which can be used in templateScript
Returns
true on success, false if insertion failed (e.g. read-only mode)

Definition at line 170 of file ktexteditor.cpp.

bool View::insertText ( const QString text)
virtual

This is a convenience function which inserts text at the view's current cursor position.

You do not necessarily need to reimplement it, except you want to do some special things.

Parameters
textText to be inserted
Returns
true on success of insertion, otherwise false
See also
textInserted()

Definition at line 145 of file ktexteditor.cpp.

bool View::isStatusBarEnabled ( ) const

Is the status bar enabled?

Returns
status bar enabled?

Definition at line 154 of file ktexteditor.cpp.

int View::lastDisplayedLine ( LineType  lineType = RealLine) const

Get the last displayed line in the view.

Note
If code is folded, many hundred lines can be between firstDisplayedLine() and lastDisplayedLine().
Parameters
lineTypeif RealLine (the default), it returns the real line number accounting for folded regions. In that case it walks over all folded regions O(n) for n == number of folded ranges
Returns
the last displayed line
See also
firstDisplayedLine()
Since
5.33

Definition at line 399 of file ktexteditor.cpp.

virtual QList<KTextEditor::AttributeBlock> KTextEditor::View::lineAttributes ( int  line)
pure virtual

Get the list of AttributeBlocks for a given line in the document.

Returns
list of AttributeBlocks for given line.
virtual KTextEditor::MainWindow* KTextEditor::View::mainWindow ( ) const
pure virtual

Get the view's main window, if any.

Returns
the view's main window, will always return at least some non-nullptr dummy interface
KTextEditor::Cursor View::maxScrollPosition ( ) const

Get the cursor corresponding to the maximum position the view can vertically scroll to.

Returns
cursor position of the maximum vertical scroll position.
Since
5.33

Definition at line 389 of file ktexteditor.cpp.

void KTextEditor::View::mousePositionChanged ( KTextEditor::View view,
const KTextEditor::Cursor newPosition 
)
signal

This signal is emitted whenever the position of the mouse changes over this view.

If the mouse moves off the view, an invalid cursor position should be emitted, i.e. Cursor::invalid().

Note
If mouseTrackingEnabled() returns false, this signal is never emitted.
Parameters
viewview which emitted the signal
newPositionnew position of the mouse or Cursor::invalid(), if the mouse moved out of the view.
See also
mouseTrackingEnabled()
virtual bool KTextEditor::View::mouseTrackingEnabled ( ) const
pure virtual

Check, whether mouse tracking is enabled.

Mouse tracking is required to have the signal mousePositionChanged() emitted.

Returns
true, if mouse tracking is enabled, otherwise false
See also
setMouseTrackingEnabled(), mousePositionChanged()
virtual bool KTextEditor::View::print ( )
pure virtual

Print the document.

This should result in showing the print dialog.

Returns
true if document was printed
virtual void KTextEditor::View::printPreview ( )
pure virtual

Shows the print preview dialog/.

virtual void KTextEditor::View::readSessionConfig ( const KConfigGroup config,
const QSet< QString > &  flags = QSetQString >() 
)
pure virtual

Read session settings from the given config.

Known flags: none atm

Parameters
configread the session settings from this KConfigGroup
flagsadditional flags
See also
writeSessionConfig()
virtual bool KTextEditor::View::removeSelection ( )
pure virtual

Remove the view's current selection, without deleting the selected text.

Returns
true on success, otherwise false
See also
removeSelectionText()
virtual bool KTextEditor::View::removeSelectionText ( )
pure virtual

Remove the view's current selection including the selected text.

Returns
true on success, otherwise false
See also
removeSelection()
virtual bool KTextEditor::View::selection ( ) const
pure virtual

Query the view whether it has selected text, i.e.

whether a selection exists.

Returns
true if a text selection exists, otherwise false
See also
setSelection(), selectionRange()
void KTextEditor::View::selectionChanged ( KTextEditor::View view)
signal

This signal is emitted whenever the view's selection changes.

Note
If the mode switches from block selection to normal selection or vice versa this signal should also be emitted.
Parameters
viewview in which the selection changed
See also
selection(), selectionRange(), selectionText()
virtual Range KTextEditor::View::selectionRange ( ) const
pure virtual

Get the range occupied by the current selection.

Returns
selection range, valid only if a selection currently exists.
See also
setSelection()
virtual QString KTextEditor::View::selectionText ( ) const
pure virtual

Get the view's selected text.

Returns
the selected text
See also
setSelection()
virtual bool KTextEditor::View::setBlockSelection ( bool  on)
pure virtual

Set block selection mode to state on.

Parameters
onif true, block selection mode is turned on, otherwise off
Returns
true on success, otherwise false
See also
blockSelection()
virtual void KTextEditor::View::setContextMenu ( QMenu menu)
pure virtual

Set a context menu for this view to menu.

Note
any previously assigned menu is not deleted. If you are finished with the previous menu, you may delete it.
Warning
Use this with care! Plugin xml gui clients are not merged into this menu!
!!!!!! DON'T USE THIS FUNCTION, UNLESS YOU ARE SURE YOU DON'T WANT PLUGINS TO WORK !!!!!!
Parameters
menunew context menu object for this view
See also
contextMenu()
virtual bool KTextEditor::View::setCursorPosition ( Cursor  position)
pure virtual

Set the view's new cursor to position.

A TAB character is handeled as only on character.

Parameters
positionnew cursor position
Returns
true on success, otherwise false
See also
cursorPosition()
void View::setHorizontalScrollPosition ( int  x)

Horizontally scroll view to position.

Parameters
xthe pixel position to scroll to.
Since
5.33

Definition at line 384 of file ktexteditor.cpp.

virtual bool KTextEditor::View::setMouseTrackingEnabled ( bool  enable)
pure virtual

Try to enable or disable mouse tracking according to enable.

The return value contains the state of mouse tracking after the request. Mouse tracking is required to have the mousePositionChanged() signal emitted.

Note
Implementation Notes: An implementation is not forced to support this, and should always return false if it does not have support.
Parameters
enableif true, try to enable mouse tracking, otherwise disable it.
Returns
the current state of mouse tracking
See also
mouseTrackingEnabled(), mousePositionChanged()
void View::setScrollPosition ( KTextEditor::Cursor cursor)

Scroll view to cursor.

Parameters
cursorthe cursor position to scroll to.
Since
5.33

Definition at line 379 of file ktexteditor.cpp.

virtual bool KTextEditor::View::setSelection ( const Range range)
pure virtual

Set the view's selection to the range selection.

The old selection will be discarded.

Parameters
rangethe range of the new selection
Returns
true on success, otherwise false (e.g. when the cursor range is invalid)
See also
selectionRange(), selection()
void View::setStatusBarEnabled ( bool  enable)

Show/hide the status bar of the view.

Per default, the status bar is enabled.

Parameters
enableshould the status bar be enabled?

Definition at line 160 of file ktexteditor.cpp.

void View::setViewInputMode ( InputMode  inputMode)

Set the view's new input mode.

Parameters
inputModenew InputMode value
See also
viewInputMode()
Since
5.54 KF6: make virtual

Definition at line 175 of file ktexteditor.cpp.

void KTextEditor::View::statusBarEnabledChanged ( KTextEditor::View view,
bool  enabled 
)
signal

This signal is emitted whenever the status bar of view is toggled.

Parameters
enabledWhether the status bar is currently enabled or not
QRect View::textAreaRect ( ) const

Get the view's text area rectangle excluding border, scrollbars, etc.

Returns
the view's text area rectangle
Since
5.33

Definition at line 404 of file ktexteditor.cpp.

void KTextEditor::View::textInserted ( KTextEditor::View view,
const KTextEditor::Cursor position,
const QString text 
)
signal

This signal is emitted from view whenever the users inserts text at position, that means the user typed/pasted text.

Parameters
viewview in which the text was inserted
positionposition where the text was inserted
textthe text the user has typed into the editor
See also
insertText()
KSyntaxHighlighting::Theme View::theme ( ) const

Get the current active theme of this view.

Might change during runtime, configChanged() will be emitted in that cases.

Returns
current active theme
Since
5.79

Definition at line 180 of file ktexteditor.cpp.

void KTextEditor::View::verticalScrollPositionChanged ( KTextEditor::View view,
const KTextEditor::Cursor newPos 
)
signal

This signal should be emitted whenever the view is scrolled vertically.

Parameters
viewview which emitted the signal
newPosthe new scroll position
virtual InputMode KTextEditor::View::viewInputMode ( ) const
pure virtual

Get the view's current input mode.

The current mode can be and . For human translated version

See also
viewInputModeHuman.
Returns
the current input mode of this view
See also
viewInputModeChanged()
void KTextEditor::View::viewInputModeChanged ( KTextEditor::View view,
KTextEditor::View::InputMode  mode 
)
signal

This signal is emitted whenever the view's input mode changes.

Parameters
viewview which changed its input mode
modenew input mode
See also
viewInputMode()
virtual QString KTextEditor::View::viewInputModeHuman ( ) const
pure virtual

Get the view's current input mode in human readable form.

The string should be translated (i18n). For id like version

See also
viewInputMode
Returns
the current input mode of this view in human readable form
virtual ViewMode KTextEditor::View::viewMode ( ) const
pure virtual

Get the current view mode/state.

This can be used to detect the view's current mode. For example , or whatever other input modes are supported.

See also
viewModeHuman() for translated version.
Returns
current view mode/state
See also
viewModeChanged()
void KTextEditor::View::viewModeChanged ( KTextEditor::View view,
KTextEditor::View::ViewMode  mode 
)
signal

This signal is emitted whenever the view mode of view changes.

Parameters
viewthe view which changed its mode
modenew view mode
See also
viewMode()
virtual QString KTextEditor::View::viewModeHuman ( ) const
pure virtual

Get the current view mode state.

This can be used to visually indicate the view's current mode, for example INSERT mode, OVERWRITE mode or COMMAND mode - or whatever other edit modes are supported. The string should be translated (i18n), as this is a user aimed representation of the view state, which should be shown in the GUI, for example in the status bar. This string may be rich-text.

Returns
Human-readable version of the view mode state
See also
viewModeChanged()
virtual void KTextEditor::View::writeSessionConfig ( KConfigGroup config,
const QSet< QString > &  flags = QSetQString >() 
)
pure virtual

Write session settings to the config.

See readSessionConfig() for more details.

Parameters
configwrite the session settings to this KConfigGroup
flagsadditional flags
See also
readSessionConfig()

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jul 26 2021 22:58:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.