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
 
typedef  RenderFlags
 
- Public Types inherited from QObject
typedef  QObjectList
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 

Signals

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

Public Member Functions

 ~View () override
 
virtual void abortCompletion ()=0
 
virtual KTextEditor::AbstractAnnotationItemDelegateannotationItemDelegate () const =0
 
virtual AnnotationModelannotationModel () const =0
 
virtual bool blockSelection () const =0
 
virtual QList< CodeCompletionModel * > codeCompletionModels () const =0
 
virtual QStringList configKeys () const =0
 
virtual QVariant configValue (const QString &key)=0
 
virtual QMenucontextMenu () const =0
 
virtual KTextEditor::Cursor coordinatesToCursor (const QPoint &coord) const =0
 
virtual Cursor cursorPosition () const =0
 
virtual QPoint cursorPositionCoordinates () const =0
 
QList< KTextEditor::CursorcursorPositions () const
 
virtual Cursor cursorPositionVirtual () const =0
 
virtual QPoint cursorToCoordinate (KTextEditor::Cursor cursor) const =0
 
virtual QMenudefaultContextMenu (QMenu *menu=nullptr) const =0
 
virtual QExplicitlySharedDataPointer< KTextEditor::AttributedefaultStyleAttribute (KSyntaxHighlighting::Theme::TextStyle defaultStyle) const =0
 
virtual Documentdocument () const =0
 
int firstDisplayedLine (LineType lineType=RealLine) const
 
virtual void forceCompletion ()=0
 
virtual QScrollBarhorizontalScrollBar () const =0
 
bool insertTemplate (KTextEditor::Cursor insertPosition, const QString &templateString, const QString &script=QString())
 
virtual bool insertText (const QString &text)
 
virtual bool isAnnotationBorderVisible () const =0
 
virtual bool isAutomaticInvocationEnabled () const =0
 
virtual bool isCompletionActive () const =0
 
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 void registerCompletionModel (CodeCompletionModel *model)=0
 
virtual void registerInlineNoteProvider (KTextEditor::InlineNoteProvider *provider)=0
 
virtual void registerTextHintProvider (KTextEditor::TextHintProvider *provider)=0
 
virtual bool removeSelection ()=0
 
virtual bool removeSelectionText ()=0
 
virtual bool selection () const =0
 
virtual Range selectionRange () const =0
 
QList< KTextEditor::RangeselectionRanges () const
 
virtual QString selectionText () const =0
 
virtual void setAnnotationBorderVisible (bool visible)=0
 
virtual void setAnnotationItemDelegate (KTextEditor::AbstractAnnotationItemDelegate *delegate)=0
 
virtual void setAnnotationModel (AnnotationModel *model)=0
 
virtual void setAnnotationUniformItemSizes (bool uniformItemSizes)=0
 
virtual void setAutomaticInvocationEnabled (bool enabled=true)=0
 
virtual bool setBlockSelection (bool on)=0
 
virtual void setConfigValue (const QString &key, const QVariant &value)=0
 
virtual void setContextMenu (QMenu *menu)=0
 
virtual bool setCursorPosition (Cursor position)=0
 
void setCursorPositions (const QList< KTextEditor::Cursor > &positions)
 
void setHorizontalScrollPosition (int x)
 
virtual bool setMouseTrackingEnabled (bool enable)=0
 
void setScrollPosition (KTextEditor::Cursor cursor)
 
virtual bool setSelection (Range range)=0
 
void setSelections (const QList< KTextEditor::Range > &ranges)
 
void setStatusBarEnabled (bool enable)
 
virtual void setTextHintDelay (int delay)=0
 
virtual void setViewInputMode (InputMode inputMode)=0
 
virtual void startCompletion (const Range &word, const QList< CodeCompletionModel * > &models=QList< CodeCompletionModel * >(), KTextEditor::CodeCompletionModel::InvocationType invocationType=KTextEditor::CodeCompletionModel::ManualInvocation)=0
 
virtual void startCompletion (Range word, CodeCompletionModel *model)=0
 
QRect textAreaRect () const
 
virtual int textHintDelay () const =0
 
KSyntaxHighlighting::Theme theme () const
 
virtual bool uniformAnnotationItemSizes () const =0
 
virtual void unregisterCompletionModel (CodeCompletionModel *model)=0
 
virtual void unregisterInlineNoteProvider (KTextEditor::InlineNoteProvider *provider)=0
 
virtual void unregisterTextHintProvider (KTextEditor::TextHintProvider *provider)=0
 
virtual QScrollBarverticalScrollBar () const =0
 
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 ()
 
QActionaddAction (const QIcon &icon, const QString &text)
 
QActionaddAction (const QIcon &icon, const QString &text, Args &&... args)
 
QActionaddAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut)
 
QActionaddAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, Args &&... args)
 
QActionaddAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, const QObject *receiver, const char *member, Qt::ConnectionType type)
 
QActionaddAction (const QIcon &icon, const QString &text, const QObject *receiver, const char *member, Qt::ConnectionType type)
 
QActionaddAction (const QString &text)
 
QActionaddAction (const QString &text, Args &&... args)
 
QActionaddAction (const QString &text, const QKeySequence &shortcut)
 
QActionaddAction (const QString &text, const QKeySequence &shortcut, Args &&... args)
 
QActionaddAction (const QString &text, const QKeySequence &shortcut, const QObject *receiver, const char *member, Qt::ConnectionType type)
 
QActionaddAction (const QString &text, const QObject *receiver, const char *member, Qt::ConnectionType type)
 
void addAction (QAction *action)
 
void addActions (const QList< QAction * > &actions)
 
void adjustSize ()
 
bool autoFillBackground () const const
 
QPalette::ColorRole backgroundRole () const const
 
QBackingStorebackingStore () const const
 
QSize baseSize () const const
 
QWidgetchildAt (const QPoint &p) const const
 
QWidgetchildAt (int x, int y) 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
 
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, const 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 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
 
QPointF mapFrom (const QWidget *parent, const QPointF &pos) const const
 
QPoint mapFromGlobal (const QPoint &pos) const const
 
QPointF mapFromGlobal (const QPointF &pos) const const
 
QPoint mapFromParent (const QPoint &pos) const const
 
QPointF mapFromParent (const QPointF &pos) const const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const const
 
QPointF mapTo (const QWidget *parent, const QPointF &pos) const const
 
QPoint mapToGlobal (const QPoint &pos) const const
 
QPointF mapToGlobal (const QPointF &pos) const const
 
QPoint mapToParent (const QPoint &pos) const const
 
QPointF mapToParent (const QPointF &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 (const QPoint &)
 
void move (int x, int y)
 
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, RenderFlags renderFlags)
 
void render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags)
 
void repaint ()
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &rgn)
 
void repaint (int x, int y, int w, int h)
 
void resize (const QSize &)
 
void resize (int w, int h)
 
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 (const QSize &)
 
void setBaseSize (int basew, int baseh)
 
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 ()
 
void setFocus (Qt::FocusReason reason)
 
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 (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 
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)
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 
void setScreen (QScreen *screen)
 
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 ()
 
void update (const QRect &rect)
 
void update (const QRegion &rgn)
 
void update (int x, int y, int w, int h)
 
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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
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 setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from QPaintDevice
int colorCount () const const
 
int depth () const const
 
qreal 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)
 
virtual QActionaction (const QDomElement &element) const
 
QActionaction (const QString &name) 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 (QEnterEvent *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 (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, qintptr *result)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
void updateMicroFocus (Qt::InputMethodQuery query)
 
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 QPaintDevice
- 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)
 
void setTabOrder (std::initializer_list< QWidget * > widgets)
 
- 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)
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findVersionNumber (const QString &xml)
 
- Public Attributes inherited from QWidget
 DrawChildren
 
 DrawWindowBackground
 
 IgnoreMask
 
- 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*
KXMLGUIFactory * guiFactory()
Accessor to the XMLGUIFactory.
virtual KTextEditor::MainWindow * mainWindow() const =0
Get the view's main window, if any.
void addClient(KXMLGUIClient *client)

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 );
void removeClient(KXMLGUIClient *client)

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 \InputMode 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 Config

Config provides methods to access and modify the low level config information for a given View KTextEditor::View has support for the following keys:

  • line-numbers [bool], show/hide line numbers
  • icon-bar [bool], show/hide icon bar
  • folding-bar [bool], show/hide the folding bar
  • folding-preview [bool], enable/disable folding preview when mouse hovers on folded region
  • dynamic-word-wrap [bool], enable/disable dynamic word wrap
  • background-color [QColor], read/set the default background color
  • selection-color [QColor], read/set the default color for selections
  • search-highlight-color [QColor], read/set the background color for search
  • replace-highlight-color [QColor], read/set the background color for replaces
  • default-mark-type [uint], read/set the default mark type
  • allow-mark-menu [bool], enable/disable the menu shown when right clicking on the left gutter. When disabled, click on the gutter will always set or clear the mark of default type.
  • icon-border-color [QColor] read/set the icon border color (on the left, with the line numbers)
  • folding-marker-color [QColor] read/set folding marker colors (in the icon border)
  • line-number-color [QColor] read/set line number colors (in the icon border)
  • current-line-number-color [QColor] read/set current line number color (in the icon border)
  • modification-markers [bool] read/set whether the modification markers are shown
  • word-count [bool] enable/disable the counting of words and characters in the statusbar
  • line-count [bool] show/hide the total number of lines in the status bar (
    Since
    5.66)
  • scrollbar-minimap [bool] enable/disable scrollbar minimap
  • scrollbar-preview [bool] enable/disable scrollbar text preview on hover
  • font [QFont] change the font
  • theme [QString] change the theme
  • word-completion-minimal-word-length [int] minimal word length to trigger word completion
  • enter-to-insert-completion [bool] enable/disable whether pressing enter inserts completion

You can retrieve the value of a config key using configValue() and set the value for a config key using setConfigValue().

Annotation Interface

The Annotation Interface allows to do these things:

  • (1) show/hide the annotation border along with the possibility to add actions into its context menu.
  • (2) set a separate AnnotationModel for the View: Note that this interface inherits the AnnotationInterface.
  • (3) set a custom AbstractAnnotationItemDelegate for the View.

For a more detailed explanation about whether you want to set a custom delegate for rendering the annotations, read the detailed documentation about the AbstractAnnotationItemDelegate.

Inline Notes

The inline notes interface provides a way to render arbitrary things in the text. The text layout of the line is adapted to create space for the note. Possible applications include showing a name of a function parameter in a function call or rendering a square with a color preview next to CSS color property.

Inline note showing a CSS color preview

To register as inline note provider, call registerInlineNoteProvider() with an instance that inherits InlineNoteProvider. Finally, make sure you remove your inline note provider by calling unregisterInlineNoteProvider().

Introduction

The text hint interface provides a way to show tool tips for text located under the mouse. Possible applications include showing a value of a variable when debugging an application, or showing a complete path of an include directive.

Text hint showing the contents of a variable

To register as text hint provider, call registerTextHintProvider() with an instance that inherits TextHintProvider. Finally, make sure you remove your text hint provider by calling unregisterTextHintProvider().

Text hints are shown after the user hovers with the mouse for a delay of textHintDelay() milliseconds over the same word. To change the delay, call setTextHintDelay().

Completion Interface

The Completion Interface is designed to provide code completion functionality for a KTextEditor::View. This interface provides the basic mechanisms to display a list of completions, update this list according to user input, and allow the user to select a completion.

Essentially, this provides an item view for the available completions. In order to use this interface, you will need to implement a CodeCompletionModel that generates the relevant completions given the current input.

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

See also
KTextEditor::Document, KXMLGUIClient
Author
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>

Definition at line 243 of file view.h.

Member Enumeration Documentation

◆ InputMode

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 286 of file view.h.

◆ LineType

Possible line types.

Since
5.33
Enumerator
RealLine 

Real line.

VisibleLine 

Visible line.

Line that is not folded.

Definition at line 311 of file view.h.

◆ ViewMode

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 295 of file view.h.

Constructor & Destructor Documentation

◆ View()

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 222 of file ktexteditor.cpp.

◆ ~View()

View::~View ( )
overridedefault

Virtual destructor.

Member Function Documentation

◆ abortCompletion()

virtual void KTextEditor::View::abortCompletion ( )
pure virtual

Abort the currently displayed code completion without executing any currently selected completion.

This is safe, even when the completion box is not currently active.

See also
isCompletionActive()

◆ annotationActivated

void KTextEditor::View::annotationActivated ( KTextEditor::View * view,
int line )
signal

This signal is emitted when an entry on the annotation border was activated, for example by clicking or double-clicking it.

This follows the KDE wide setting for activation via click or double-clcik

Parameters
viewthe view to which the activated border belongs to
linethe document line that the activated position belongs to

◆ annotationBorderVisibilityChanged

void KTextEditor::View::annotationBorderVisibilityChanged ( KTextEditor::View * view,
bool visible )
signal

This signal is emitted when the annotation border is shown or hidden.

Parameters
viewthe view to which the border belongs to
visiblethe current visibility state

◆ annotationContextMenuAboutToShow

void KTextEditor::View::annotationContextMenuAboutToShow ( KTextEditor::View * view,
QMenu * menu,
int line )
signal

This signal is emitted before a context menu is shown on the annotation border for the given line and view.

Note
Kate Part implementation detail: In Kate Part, the menu has an entry to hide the annotation border.
Parameters
viewthe view that the annotation border belongs to
menuthe context menu that will be shown
linethe annotated line for which the context menu is shown

◆ annotationItemDelegate()

virtual KTextEditor::AbstractAnnotationItemDelegate * KTextEditor::View::annotationItemDelegate ( ) const
pure virtual

Returns the currently used AbstractAnnotationItemDelegate.

Returns
the current AbstractAnnotationItemDelegate
Since
6.0

◆ annotationModel()

virtual AnnotationModel * KTextEditor::View::annotationModel ( ) const
pure virtual

returns the currently set AnnotationModel or 0 if there's none set

Returns
the current AnnotationModel

◆ blockSelection()

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()

◆ codeCompletionModels()

virtual QList< CodeCompletionModel * > KTextEditor::View::codeCompletionModels ( ) const
pure virtual

Obtain the list of registered code completion models.

Returns
a list of a models that are currently registered
See also
registerCompletionModel(CodeCompletionModel*)

◆ configChanged

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

◆ configKeys()

virtual QStringList KTextEditor::View::configKeys ( ) const
pure virtual

View Config.

Get a list of all available keys.

◆ configValue()

virtual QVariant KTextEditor::View::configValue ( const QString & key)
pure virtual

Get a value for the key.

◆ contextMenu()

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()

◆ contextMenuAboutToShow

void KTextEditor::View::contextMenuAboutToShow ( KTextEditor::View * view,
QMenu * menu )
signal

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

◆ coordinatesToCursor()

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().

◆ cursorPosition()

virtual Cursor KTextEditor::View::cursorPosition ( ) const
pure virtual

Get the view's current cursor position.

A TAB character is handled as only one character.

Returns
current cursor position
See also
setCursorPosition()

◆ cursorPositionChanged

void KTextEditor::View::cursorPositionChanged ( KTextEditor::View * view,
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()

◆ cursorPositionCoordinates()

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()

◆ cursorPositions()

QList< KTextEditor::Cursor > View::cursorPositions ( ) const

Get the view's current cursor positions.

A TAB character is handled as only one character.

The returned vector contains the primary cursor as first element.

Since
5.95
Returns
all currently existing cursors

Definition at line 189 of file ktexteditor.cpp.

◆ cursorPositionVirtual()

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()

◆ cursorToCoordinate()

virtual QPoint KTextEditor::View::cursorToCoordinate ( 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()

◆ defaultContextMenu()

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;
}
}
}
KXMLGUIClient * parentClient() const
KXMLGUIFactory * factory() const
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

◆ defaultStyleAttribute()

virtual QExplicitlySharedDataPointer< KTextEditor::Attribute > KTextEditor::View::defaultStyleAttribute ( KSyntaxHighlighting::Theme::TextStyle defaultStyle) const
pure virtual

Returns the attribute for the default style defaultStyle.

Parameters
defaultStyledefault style to get the attribute for
See also
KTextEditor::Attribute

◆ displayRangeChanged

void KTextEditor::View::displayRangeChanged ( KTextEditor::View * view)
signal

This signal is emitted whenever the displayed range changes.

See also
firstDisplayedLine()
lastDisplayedLine()
Since
6.8

◆ document()

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

◆ firstDisplayedLine()

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 398 of file ktexteditor.cpp.

◆ focusIn

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()

◆ 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()

◆ forceCompletion()

virtual void KTextEditor::View::forceCompletion ( )
pure virtual

Force execution of the currently selected completion, and hide the code completion box.

◆ horizontalScrollBar()

virtual QScrollBar * KTextEditor::View::horizontalScrollBar ( ) const
pure virtual
Returns
The horizontal scrollbar of this view
Since
6.0

◆ horizontalScrollPositionChanged

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

◆ insertTemplate()

bool View::insertTemplate ( 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 174 of file ktexteditor.cpp.

◆ insertText()

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 148 of file ktexteditor.cpp.

◆ isAnnotationBorderVisible()

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

Checks whether the View's annotation border is visible.

◆ isAutomaticInvocationEnabled()

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

Determine the status of automatic code completion invocation.

◆ isCompletionActive()

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

Completion.

Query whether the code completion box is currently displayed.

◆ isStatusBarEnabled()

bool View::isStatusBarEnabled ( ) const

Is the status bar enabled?

Returns
status bar enabled?

Definition at line 157 of file ktexteditor.cpp.

◆ lastDisplayedLine()

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 403 of file ktexteditor.cpp.

◆ lineAttributes()

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.

◆ mainWindow()

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

◆ maxScrollPosition()

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 393 of file ktexteditor.cpp.

◆ mousePositionChanged

void KTextEditor::View::mousePositionChanged ( KTextEditor::View * view,
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()

◆ 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()

◆ print()

virtual bool KTextEditor::View::print ( )
pure virtual

Print the document.

This should result in showing the print dialog.

Returns
true if document was printed

◆ printPreview()

virtual void KTextEditor::View::printPreview ( )
pure virtual

Shows the print preview dialog/.

◆ readSessionConfig()

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()

◆ registerCompletionModel()

virtual void KTextEditor::View::registerCompletionModel ( CodeCompletionModel * model)
pure virtual

Register a new code completion model.

Parameters
modelnew completion model
See also
unregisterCompletionModel()

◆ registerInlineNoteProvider()

virtual void KTextEditor::View::registerInlineNoteProvider ( KTextEditor::InlineNoteProvider * provider)
pure virtual

Inline Note.

Register the inline note provider provider.

Whenever a line is painted, the provider will be queried for notes that should be painted in it. When the provider is about to be destroyed, make sure to call unregisterInlineNoteProvider() to avoid a dangling pointer.

Parameters
providerinline note provider
See also
unregisterInlineNoteProvider(), InlineNoteProvider

◆ registerTextHintProvider()

virtual void KTextEditor::View::registerTextHintProvider ( KTextEditor::TextHintProvider * provider)
pure virtual

Text Hint.

Register the text hint provider provider.

Whenever the user hovers over text, provider will be asked for a text hint. When the provider is about to be destroyed, make sure to call unregisterTextHintProvider() to avoid a dangling pointer.

Parameters
providertext hint provider
See also
unregisterTextHintProvider(), TextHintProvider

◆ removeSelection()

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()

◆ 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()

◆ selection()

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()

◆ selectionChanged

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()

◆ selectionRange()

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()

◆ selectionRanges()

QList< KTextEditor::Range > View::selectionRanges ( ) const

Get the ranges occupied by the current selections.

Returns
selection ranges, valid only if a selection currently exists.
See also
setSelections()
Since
5.95

Definition at line 199 of file ktexteditor.cpp.

◆ selectionText()

virtual QString KTextEditor::View::selectionText ( ) const
pure virtual

Get the view's selected text.

Returns
the selected text
See also
setSelection()

◆ setAnnotationBorderVisible()

virtual void KTextEditor::View::setAnnotationBorderVisible ( bool visible)
pure virtual

This function can be used to show or hide the annotation border The annotation border is hidden by default.

Parameters
visibleif true the annotation border is shown, otherwise hidden

◆ setAnnotationItemDelegate()

virtual void KTextEditor::View::setAnnotationItemDelegate ( KTextEditor::AbstractAnnotationItemDelegate * delegate)
pure virtual

Sets the AbstractAnnotationItemDelegate for this view and the model to provide custom rendering of annotation information for each line.

Ownership is not transferred.

Parameters
delegatethe new AbstractAnnotationItemDelegate, or nullptr to reset to the default delegate
Since
6.0

◆ setAnnotationModel()

virtual void KTextEditor::View::setAnnotationModel ( AnnotationModel * model)
pure virtual

View Annotation Interface.

Sets a new AnnotationModel for this document to provide annotation information for each line.

Parameters
modelthe new AnnotationModel

◆ setAnnotationUniformItemSizes()

virtual void KTextEditor::View::setAnnotationUniformItemSizes ( bool uniformItemSizes)
pure virtual

This function can be used to declare whether it is known that the annotation items rendered by the set delegate all have the same size.

This enables the view to do some optimizations for performance purposes.

By default the value of this property is false .

Parameters
uniformItemSizesif true the annotation items are considered to all have the same size
Since
6.0

◆ setAutomaticInvocationEnabled()

virtual void KTextEditor::View::setAutomaticInvocationEnabled ( bool enabled = true)
pure virtual

Enable or disable automatic code completion invocation.

◆ setBlockSelection()

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()

◆ setConfigValue()

virtual void KTextEditor::View::setConfigValue ( const QString & key,
const QVariant & value )
pure virtual

Set a the key's value to value.

◆ setContextMenu()

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()

◆ setCursorPosition()

virtual bool KTextEditor::View::setCursorPosition ( Cursor position)
pure virtual

Set the view's new cursor to position.

A TAB character is handled as only on character.

Parameters
positionnew cursor position
Returns
true on success, otherwise false
See also
cursorPosition()

◆ setCursorPositions()

void View::setCursorPositions ( const QList< KTextEditor::Cursor > & positions)

Set the view's new cursors to positions.

A TAB character is handled as only on character.

This allows to create multiple cursors in this view.

The first passed position will be used for the primary cursor just like if you would call setCursorPosition.

Parameters
positionsnew cursor positions
See also
cursorPositions()
Since
5.95

Definition at line 184 of file ktexteditor.cpp.

◆ setHorizontalScrollPosition()

void View::setHorizontalScrollPosition ( int x)

Horizontally scroll view to position.

Parameters
xthe pixel position to scroll to.
Since
5.33

Definition at line 388 of file ktexteditor.cpp.

◆ setMouseTrackingEnabled()

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()

◆ setScrollPosition()

void View::setScrollPosition ( KTextEditor::Cursor cursor)

Scroll view to cursor.

Parameters
cursorthe cursor position to scroll to.
Since
5.33

Definition at line 383 of file ktexteditor.cpp.

◆ setSelection()

virtual bool KTextEditor::View::setSelection ( 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()

◆ setSelections()

void View::setSelections ( const QList< KTextEditor::Range > & ranges)

Set the view's selection to the range selection.

The old selection will be discarded.

Parameters
rangesthe ranges of the new selections
See also
selectionRanges(), selection()
Since
5.95

Definition at line 194 of file ktexteditor.cpp.

◆ setStatusBarEnabled()

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 163 of file ktexteditor.cpp.

◆ setTextHintDelay()

virtual void KTextEditor::View::setTextHintDelay ( int delay)
pure virtual

Set the text hint delay to delay milliseconds.

The delay specifies the time the user needs to hover over the text before the tool tip is shown. Therefore, delay should not be too large, a value of 500 milliseconds is recommended and set by default.

If delay is <= 0, the default delay will be set.

Parameters
delaytool tip delay in milliseconds

◆ setViewInputMode()

virtual void KTextEditor::View::setViewInputMode ( InputMode inputMode)
pure virtual

Set the view's new input mode.

Parameters
inputModenew InputMode value
See also
viewInputMode()
Since
5.54

◆ startCompletion() [1/2]

virtual void KTextEditor::View::startCompletion ( const Range & word,
const QList< CodeCompletionModel * > & models = QListCodeCompletionModel * >(),
KTextEditor::CodeCompletionModel::InvocationType invocationType = KTextEditor::CodeCompletionModel::ManualInvocation )
pure virtual

Invoke code completion over a given range, with specific models and invocation type.

Parameters
modelslist of models to start. If this is an empty list, all registered models are started.

◆ startCompletion() [2/2]

virtual void KTextEditor::View::startCompletion ( Range word,
CodeCompletionModel * model )
pure virtual

Invoke code completion over a given range, with a specific model.

◆ statusBarEnabledChanged

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

◆ textAreaRect()

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 408 of file ktexteditor.cpp.

◆ textHintDelay()

virtual int KTextEditor::View::textHintDelay ( ) const
pure virtual

Get the text hint delay in milliseconds.

By default, the text hint delay is set to 500 milliseconds. It can be changed by calling setTextHintDelay().

◆ textInserted

void KTextEditor::View::textInserted ( KTextEditor::View * view,
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()

◆ theme()

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 179 of file ktexteditor.cpp.

◆ uniformAnnotationItemSizes()

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

Checks whether the annotation items all have the same size.

Since
6.0

◆ unregisterCompletionModel()

virtual void KTextEditor::View::unregisterCompletionModel ( CodeCompletionModel * model)
pure virtual

Unregister a code completion model.

Parameters
modelthe model that should be unregistered
See also
registerCompletionModel()

◆ unregisterInlineNoteProvider()

virtual void KTextEditor::View::unregisterInlineNoteProvider ( KTextEditor::InlineNoteProvider * provider)
pure virtual

Unregister the inline note provider provider.

Parameters
providerinline note provider to unregister
See also
registerInlineNoteProvider(), InlineNoteProvider

◆ unregisterTextHintProvider()

virtual void KTextEditor::View::unregisterTextHintProvider ( KTextEditor::TextHintProvider * provider)
pure virtual

Unregister the text hint provider provider.

Parameters
providertext hint provider to unregister
See also
registerTextHintProvider(), TextHintProvider

◆ verticalScrollBar()

virtual QScrollBar * KTextEditor::View::verticalScrollBar ( ) const
pure virtual
Returns
The vertical scrollbar of this view
Since
6.0

◆ verticalScrollPositionChanged

void KTextEditor::View::verticalScrollPositionChanged ( KTextEditor::View * view,
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

◆ viewInputMode()

virtual InputMode KTextEditor::View::viewInputMode ( ) const
pure virtual

Get the view's current input mode.

The current mode can be \NormalInputMode and \ViInputMode. For human translated version

See also
viewInputModeHuman.
Returns
the current input mode of this view
See also
viewInputModeChanged()

◆ 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()

◆ viewInputModeHuman()

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

◆ viewMode()

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 \NormalInputMode, \ViInputMode or whatever other input modes are supported.

See also
viewModeHuman() for translated version.
Returns
current view mode/state
See also
viewModeChanged()

◆ 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()

◆ viewModeHuman()

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()

◆ writeSessionConfig()

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-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.