• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • interfaces
  • ktexteditor
annotationinterface.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 * Copyright 2008 Andreas Pakulat <apaku@gmx.de>
3 * Copyright 2008 Dominik Haumann <dhaumann kde org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA
19 */
20
21#ifndef KDELIBS_KTEXTEDITOR_ANNOTATIONINTERFACE_H
22#define KDELIBS_KTEXTEDITOR_ANNOTATIONINTERFACE_H
23
24#include <ktexteditor/ktexteditor_export.h>
25
26#include <QtCore/QObject>
27
28class QMenu;
29
30namespace KTextEditor
31{
32
33class View;
34
53class KTEXTEDITOR_EXPORT AnnotationModel : public QObject
54{
55 Q_OBJECT
56 public:
57
58 virtual ~AnnotationModel() {}
59
60 enum {
61 GroupIdentifierRole = Qt::UserRole
62 };
63
83 virtual QVariant data( int line, Qt::ItemDataRole role ) const = 0;
84
85 Q_SIGNALS:
96 void reset();
97
105 void lineChanged( int line );
106};
107
108
157class KTEXTEDITOR_EXPORT AnnotationInterface
158{
159 public:
160 virtual ~AnnotationInterface() {}
161
168 virtual void setAnnotationModel( AnnotationModel* model ) = 0;
169
175 virtual AnnotationModel* annotationModel() const = 0;
176
177};
178
179
217class KTEXTEDITOR_EXPORT AnnotationViewInterface : public AnnotationInterface
218{
219 public:
220 virtual ~AnnotationViewInterface() {}
221
228 virtual void setAnnotationBorderVisible( bool visible ) = 0;
229
233 virtual bool isAnnotationBorderVisible() const = 0;
234
235 //
236 // SIGNALS!!!
237 //
238 public:
250 virtual void annotationContextMenuAboutToShow( KTextEditor::View* view, QMenu* menu, int line ) = 0;
251
260 virtual void annotationActivated( KTextEditor::View* view, int line ) = 0;
261
268 virtual void annotationBorderVisibilityChanged( KTextEditor::View* view, bool visible ) = 0;
269
270};
271
272}
273
274Q_DECLARE_INTERFACE(KTextEditor::AnnotationInterface, "org.kde.KTextEditor.AnnotationInterface")
275Q_DECLARE_INTERFACE(KTextEditor::AnnotationViewInterface, "org.kde.KTextEditor.AnnotationViewInterface")
276
277#endif
278
279// kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::AnnotationInterface
A Document extension interface for handling Annotations.
Definition: annotationinterface.h:158
KTextEditor::AnnotationInterface::annotationModel
virtual AnnotationModel * annotationModel() const =0
returns the currently set AnnotationModel or 0 if there's none set
KTextEditor::AnnotationInterface::setAnnotationModel
virtual void setAnnotationModel(AnnotationModel *model)=0
Sets a new AnnotationModel for this document to provide annotation information for each line.
KTextEditor::AnnotationInterface::~AnnotationInterface
virtual ~AnnotationInterface()
Definition: annotationinterface.h:160
KTextEditor::AnnotationModel
An model for providing line annotation information.
Definition: annotationinterface.h:54
KTextEditor::AnnotationModel::data
virtual QVariant data(int line, Qt::ItemDataRole role) const =0
data() is used to retrieve the information needed to present the annotation information from the anno...
KTextEditor::AnnotationModel::~AnnotationModel
virtual ~AnnotationModel()
Definition: annotationinterface.h:58
KTextEditor::AnnotationModel::reset
void reset()
The model should emit the signal reset() when the text of almost all lines changes.
KTextEditor::AnnotationModel::lineChanged
void lineChanged(int line)
The model should emit the signal lineChanged() when a line has to be updated.
KTextEditor::AnnotationViewInterface
Annotation interface for the View.
Definition: annotationinterface.h:218
KTextEditor::AnnotationViewInterface::annotationActivated
virtual void annotationActivated(KTextEditor::View *view, int line)=0
This signal is emitted when an entry on the annotation border was activated, for example by clicking ...
KTextEditor::AnnotationViewInterface::setAnnotationBorderVisible
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...
KTextEditor::AnnotationViewInterface::annotationContextMenuAboutToShow
virtual void annotationContextMenuAboutToShow(KTextEditor::View *view, QMenu *menu, int line)=0
This signal is emitted before a context menu is shown on the annotation border for the given line and...
KTextEditor::AnnotationViewInterface::~AnnotationViewInterface
virtual ~AnnotationViewInterface()
Definition: annotationinterface.h:220
KTextEditor::AnnotationViewInterface::isAnnotationBorderVisible
virtual bool isAnnotationBorderVisible() const =0
Checks whether the View's annotation border is visible.
KTextEditor::AnnotationViewInterface::annotationBorderVisibilityChanged
virtual void annotationBorderVisibilityChanged(KTextEditor::View *view, bool visible)=0
This signal is emitted when the annotation border is shown or hidden.
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:146
QMenu
QObject
ktexteditor_export.h
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
org
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal