KTextEditor
view.h
134 * implementation. The getter viewInputMode() returns enum \InputMode representing the current mode.
137 * \e NormalModeInsert and \e NormalModeOverwrite. You can use viewMode() getter to obtain those.
289 };
314 };
427 * \warning !!!!!! DON'T USE THIS FUNCTION, UNLESS YOU ARE SURE YOU DON'T WANT PLUGINS TO WORK !!!!!!
800 bool insertTemplate(KTextEditor::Cursor insertPosition, const QString &templateString, const QString &script = QString());
942 virtual void readSessionConfig(const KConfigGroup &config, const QSet<QString> &flags = QSet<QString>()) = 0;
952 virtual void writeSessionConfig(KConfigGroup &config, const QSet<QString> &flags = QSet<QString>()) = 0;
960 virtual QExplicitlySharedDataPointer<KTextEditor::Attribute> defaultStyleAttribute(KSyntaxHighlighting::Theme::TextStyle defaultStyle) const = 0;
1033 * \param delegate the new AbstractAnnotationItemDelegate, or \c nullptr to reset to the default delegate
1037 virtual void setAnnotationItemDelegate(KTextEditor::AbstractAnnotationItemDelegate *delegate) = 0;
1055 * @param uniformItemSizes if \c true the annotation items are considered to all have the same size
1224 * \param models list of models to start. If this is an empty list, all registered models are started.
A delegate for rendering line annotation information and handling events.
Definition abstractannotationitemdelegate.h:122
An model for providing line annotation information.
Definition annotationinterface.h:42
An item model for providing code completion, and meta information for enhanced presentation.
Definition codecompletionmodel.h:68
A source of inline notes for a document.
Definition inlinenoteprovider.h:29
This class allows the application that embeds the KTextEditor component to allow it to access parts o...
Definition mainwindow.h:47
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
Class to provide text hints for a View.
Definition texthintinterface.h:42
void horizontalScrollPositionChanged(KTextEditor::View *view)
This signal should be emitted whenever the view is scrolled horizontally.
virtual int textHintDelay() const =0
Get the text hint delay in milliseconds.
virtual void setConfigValue(const QString &key, const QVariant &value)=0
Set a the key's value to value.
void displayRangeChanged(KTextEditor::View *view)
This signal is emitted whenever the displayed range changes.
virtual QMenu * defaultContextMenu(QMenu *menu=nullptr) const =0
Populate menu with default text editor actions.
virtual void setViewInputMode(InputMode inputMode)=0
Set the view's new input mode.
virtual bool isAutomaticInvocationEnabled() const =0
Determine the status of automatic code completion invocation.
virtual bool uniformAnnotationItemSizes() const =0
Checks whether the annotation items all have the same size.
virtual QVariant configValue(const QString &key)=0
Get a value for the key.
virtual bool setCursorPosition(Cursor position)=0
Set the view's new cursor to position.
virtual void forceCompletion()=0
Force execution of the currently selected completion, and hide the code completion box.
void annotationContextMenuAboutToShow(KTextEditor::View *view, QMenu *menu, int line)
This signal is emitted before a context menu is shown on the annotation border for the given line and...
void configChanged(KTextEditor::View *view)
This signal is emitted whenever the current view configuration is changed.
virtual InputMode viewInputMode() const =0
Get the view's current input mode.
void textInserted(KTextEditor::View *view, KTextEditor::Cursor position, const QString &text)
This signal is emitted from view whenever the users inserts text at position, that means the user typ...
virtual bool setMouseTrackingEnabled(bool enable)=0
Try to enable or disable mouse tracking according to enable.
void statusBarEnabledChanged(KTextEditor::View *view, bool enabled)
This signal is emitted whenever the status bar of view is toggled.
void viewInputModeChanged(KTextEditor::View *view, KTextEditor::View::InputMode mode)
This signal is emitted whenever the view's input mode changes.
virtual void registerInlineNoteProvider(KTextEditor::InlineNoteProvider *provider)=0
Inline Note.
virtual Document * document() const =0
Get the view's document, that means the view is a view of the returned document.
virtual void startCompletion(const Range &word, const QList< CodeCompletionModel * > &models=QList< CodeCompletionModel * >(), KTextEditor::CodeCompletionModel::InvocationType invocationType=KTextEditor::CodeCompletionModel::ManualInvocation)=0
Invoke code completion over a given range, with specific models and invocation type.
virtual bool removeSelectionText()=0
Remove the view's current selection including the selected text.
ViewMode
Possible view modes These correspond to various modes the text editor might be in.
Definition view.h:295
virtual bool blockSelection() const =0
Get the status of the selection mode.
virtual QScrollBar * horizontalScrollBar() const =0
virtual QPoint cursorPositionCoordinates() const =0
Get the screen coordinates (x, y) of the cursor position in pixels.
virtual QScrollBar * verticalScrollBar() const =0
virtual void setAnnotationItemDelegate(KTextEditor::AbstractAnnotationItemDelegate *delegate)=0
Sets the AbstractAnnotationItemDelegate for this view and the model to provide custom rendering of an...
virtual QList< CodeCompletionModel * > codeCompletionModels() const =0
Obtain the list of registered code completion models.
virtual AnnotationModel * annotationModel() const =0
returns the currently set AnnotationModel or 0 if there's none set
void focusOut(KTextEditor::View *view)
This signal is emitted whenever the view loses the focus.
virtual Cursor cursorPosition() const =0
Get the view's current cursor position.
void annotationActivated(KTextEditor::View *view, int line)
This signal is emitted when an entry on the annotation border was activated, for example by clicking ...
virtual QString viewInputModeHuman() const =0
Get the view's current input mode in human readable form.
void focusIn(KTextEditor::View *view)
This signal is emitted whenever the view gets the focus.
virtual void readSessionConfig(const KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
Read session settings from the given config.
virtual void registerTextHintProvider(KTextEditor::TextHintProvider *provider)=0
Text Hint.
virtual QMenu * contextMenu() const =0
Get the context menu for this view.
virtual bool isAnnotationBorderVisible() const =0
Checks whether the View's annotation border is visible.
virtual void setAnnotationModel(AnnotationModel *model)=0
View Annotation Interface.
virtual QString viewModeHuman() const =0
Get the current view mode state.
virtual void writeSessionConfig(KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
Write session settings to the config.
virtual void setAnnotationUniformItemSizes(bool uniformItemSizes)=0
This function can be used to declare whether it is known that the annotation items rendered by the se...
virtual bool mouseTrackingEnabled() const =0
Check, whether mouse tracking is enabled.
virtual void setAutomaticInvocationEnabled(bool enabled=true)=0
Enable or disable automatic code completion invocation.
virtual void abortCompletion()=0
Abort the currently displayed code completion without executing any currently selected completion.
virtual KTextEditor::Cursor coordinatesToCursor(const QPoint &coord) const =0
Get the text-cursor in the document from the screen coordinates, relative to the view widget.
virtual QList< KTextEditor::AttributeBlock > lineAttributes(int line)=0
Get the list of AttributeBlocks for a given line in the document.
void cursorPositionChanged(KTextEditor::View *view, KTextEditor::Cursor newPosition)
This signal is emitted whenever the view's cursor position changed.
virtual bool setSelection(Range range)=0
Set the view's selection to the range selection.
virtual void setContextMenu(QMenu *menu)=0
Set a context menu for this view to menu.
virtual bool selection() const =0
Query the view whether it has selected text, i.e.
virtual Cursor cursorPositionVirtual() const =0
Get the current virtual cursor position, virtual means the tabulator character (TAB) counts multiple ...
virtual QExplicitlySharedDataPointer< KTextEditor::Attribute > defaultStyleAttribute(KSyntaxHighlighting::Theme::TextStyle defaultStyle) const =0
Returns the attribute for the default style defaultStyle.
virtual void unregisterInlineNoteProvider(KTextEditor::InlineNoteProvider *provider)=0
Unregister the inline note provider provider.
virtual Range selectionRange() const =0
Get the range occupied by the current selection.
virtual void setAnnotationBorderVisible(bool visible)=0
This function can be used to show or hide the annotation border The annotation border is hidden by de...
void mousePositionChanged(KTextEditor::View *view, KTextEditor::Cursor newPosition)
This signal is emitted whenever the position of the mouse changes over this view.
virtual KTextEditor::AbstractAnnotationItemDelegate * annotationItemDelegate() const =0
Returns the currently used AbstractAnnotationItemDelegate.
virtual void registerCompletionModel(CodeCompletionModel *model)=0
Register a new code completion model.
void viewModeChanged(KTextEditor::View *view, KTextEditor::View::ViewMode mode)
This signal is emitted whenever the view mode of view changes.
virtual void setTextHintDelay(int delay)=0
Set the text hint delay to delay milliseconds.
void selectionChanged(KTextEditor::View *view)
This signal is emitted whenever the view's selection changes.
void annotationBorderVisibilityChanged(KTextEditor::View *view, bool visible)
This signal is emitted when the annotation border is shown or hidden.
virtual QPoint cursorToCoordinate(KTextEditor::Cursor cursor) const =0
Get the screen coordinates (x, y) of the supplied cursor relative to the view widget in pixels.
virtual bool setBlockSelection(bool on)=0
Set block selection mode to state on.
void contextMenuAboutToShow(KTextEditor::View *view, QMenu *menu)
Signal which is emitted immediately prior to showing the current context menu.
virtual bool removeSelection()=0
Remove the view's current selection, without deleting the selected text.
virtual void unregisterTextHintProvider(KTextEditor::TextHintProvider *provider)=0
Unregister the text hint provider provider.
virtual void unregisterCompletionModel(CodeCompletionModel *model)=0
Unregister a code completion model.
virtual KTextEditor::MainWindow * mainWindow() const =0
Get the view's main window, if any.
virtual QString selectionText() const =0
Get the view's selected text.
virtual void startCompletion(Range word, CodeCompletionModel *model)=0
Invoke code completion over a given range, with a specific model.
void verticalScrollPositionChanged(KTextEditor::View *view, KTextEditor::Cursor newPos)
This signal should be emitted whenever the view is scrolled vertically.
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
Range
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
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.