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

KTextEditor

  • interfaces
  • ktexteditor
markinterface.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
3 Copyright (C) 2005 Dominik Haumann (dhdev@gmx.de) (documentation)
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_MARKINTERFACE_H
22#define KDELIBS_KTEXTEDITOR_MARKINTERFACE_H
23
24#include <ktexteditor/ktexteditor_export.h>
25
26#include <QtCore/QHash>
27#include <QtCore/QObject>
28
29class QPixmap;
30class QPoint;
31class QMenu;
32
33namespace KTextEditor
34{
35
36class Document;
37
51class Mark
52{
53 public:
55 int line;
56
58 uint type;
59};
60
118class KTEXTEDITOR_EXPORT MarkInterface
119{
120 public:
121 MarkInterface ();
122
126 virtual ~MarkInterface ();
127
128 //
129 // slots !!!
130 //
131 public:
139 virtual uint mark (int line) = 0;
140
154 virtual void setMark (int line, uint markType) = 0;
155
161 virtual void clearMark (int line) = 0;
162
171 virtual void addMark (int line, uint markType) = 0;
172
179 virtual void removeMark (int line, uint markType) = 0;
180
186 virtual const QHash<int, KTextEditor::Mark*> &marks () = 0;
187
193 virtual void clearMarks () = 0;
194
201 static int reservedMarkersCount() { return 7; }
202
209 enum MarkTypes
210 {
212 markType01= 0x1,
214 markType02= 0x2,
216 markType03= 0x4,
218 markType04= 0x8,
220 markType05= 0x10,
222 markType06= 0x20,
224 markType07= 0x40,
225
226 markType08= 0x80,
227 markType09= 0x100,
228 markType10= 0x200,
229 markType11= 0x400,
230 markType12= 0x800,
231 markType13= 0x1000,
232 markType14= 0x2000,
233 markType15= 0x4000,
234 markType16= 0x8000,
235 markType17= 0x10000,
236 markType18= 0x20000,
237 markType19= 0x40000,
238 markType20= 0x80000,
239 markType21= 0x100000,
240 markType22= 0x200000,
241 markType23= 0x400000,
242 markType24= 0x800000,
243 markType25= 0x1000000,
244 markType26= 0x2000000,
245 markType27= 0x4000000,
246 markType28= 0x8000000,
247 markType29= 0x10000000,
248 markType30= 0x20000000,
249 markType31= 0x40000000,
250 markType32= 0x80000000,
251 /* reserved marks */
252 Bookmark = markType01,
253 BreakpointActive = markType02,
254 BreakpointReached = markType03,
255 BreakpointDisabled = markType04,
256 Execution = markType05,
257 Warning = markType06,
258 Error = markType07
259 };
260
261 //
262 // signals !!!
263 //
264 public:
270 virtual void marksChanged (KTextEditor::Document* document) = 0;
271
272 /*
273 * Methods to modify mark properties.
274 */
275 public:
282 virtual void setMarkPixmap( MarkTypes mark, const QPixmap &pixmap ) = 0;
283
290 virtual QPixmap markPixmap( MarkTypes mark ) const = 0;
291
298 virtual void setMarkDescription( MarkTypes mark, const QString &text ) = 0;
299
307 virtual QString markDescription( MarkTypes mark ) const = 0;
308
328 virtual void setEditableMarks( uint markMask ) = 0;
329
337 virtual uint editableMarks() const = 0;
338
343 enum MarkChangeAction {
344 MarkAdded=0,
345 MarkRemoved=1
346 };
347
348 //
349 // signals !!!
350 //
351 public:
359 virtual void markChanged ( KTextEditor::Document* document, KTextEditor::Mark mark,
360 KTextEditor::MarkInterface::MarkChangeAction action) = 0;
361
362 Q_SIGNALS:
363
372 void markToolTipRequested ( KTextEditor::Document* document, KTextEditor::Mark mark,
373 QPoint position, bool& handled );
374
383 void markContextMenuRequested( KTextEditor::Document* document, KTextEditor::Mark mark,
384 QPoint pos, bool& handled );
385
386
394 void markClicked( KTextEditor::Document* document, KTextEditor::Mark mark, bool& handled );
395
396 private:
397 class MarkInterfacePrivate* const d;
398};
399
400}
401
402Q_DECLARE_INTERFACE(KTextEditor::MarkInterface, "org.kde.KTextEditor.MarkInterface")
403
404#endif
405
406// kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:112
KTextEditor::MarkInterface
Mark extension interface for the Document.
Definition: markinterface.h:119
KTextEditor::MarkInterface::clearMarks
virtual void clearMarks()=0
Clear all marks in the entire document.
KTextEditor::MarkInterface::markToolTipRequested
void markToolTipRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint position, bool &handled)
The document emits this signal whenever the mark is hovered using the mouse, and the receiver may sho...
KTextEditor::MarkInterface::MarkTypes
MarkTypes
Predefined mark types.
Definition: markinterface.h:210
KTextEditor::MarkInterface::removeMark
virtual void removeMark(int line, uint markType)=0
Remove the mark mask of type markType from line.
KTextEditor::MarkInterface::markClicked
void markClicked(KTextEditor::Document *document, KTextEditor::Mark mark, bool &handled)
The document emits this signal whenever the mark is left-clicked.
KTextEditor::MarkInterface::marks
virtual const QHash< int, KTextEditor::Mark * > & marks()=0
Get a hash holding all marks in the document.
KTextEditor::MarkInterface::MarkChangeAction
MarkChangeAction
Possible actions on a mark.
Definition: markinterface.h:343
KTextEditor::MarkInterface::addMark
virtual void addMark(int line, uint markType)=0
Add marks of type markType to line.
KTextEditor::MarkInterface::setMark
virtual void setMark(int line, uint markType)=0
Set the line's mark types to markType.
KTextEditor::MarkInterface::setMarkPixmap
virtual void setMarkPixmap(MarkTypes mark, const QPixmap &pixmap)=0
Set the mark's pixmap to pixmap.
KTextEditor::MarkInterface::setEditableMarks
virtual void setEditableMarks(uint markMask)=0
Set the mark mask the user is allowed to toggle to markMask.
KTextEditor::MarkInterface::markContextMenuRequested
void markContextMenuRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint pos, bool &handled)
The document emits this signal whenever the mark is right-clicked to show a context menu.
KTextEditor::MarkInterface::markPixmap
virtual QPixmap markPixmap(MarkTypes mark) const =0
Get the mark's pixmap.
KTextEditor::MarkInterface::mark
virtual uint mark(int line)=0
Get all marks set on the line.
KTextEditor::MarkInterface::marksChanged
virtual void marksChanged(KTextEditor::Document *document)=0
The document emits this signal whenever a mark mask changed.
KTextEditor::MarkInterface::markDescription
virtual QString markDescription(MarkTypes mark) const =0
Get the mark's description to text.
KTextEditor::MarkInterface::editableMarks
virtual uint editableMarks() const =0
Get, which marks can be toggled by the user.
KTextEditor::MarkInterface::setMarkDescription
virtual void setMarkDescription(MarkTypes mark, const QString &text)=0
Set the mark's description to text.
KTextEditor::MarkInterface::markChanged
virtual void markChanged(KTextEditor::Document *document, KTextEditor::Mark mark, KTextEditor::MarkInterface::MarkChangeAction action)=0
The document emits this signal whenever the mark changes.
KTextEditor::MarkInterface::clearMark
virtual void clearMark(int line)=0
Clear all marks set in the line.
KTextEditor::MarkInterface::reservedMarkersCount
static int reservedMarkersCount()
Get the number of predefined mark types we have so far.
Definition: markinterface.h:201
KTextEditor::Mark
Mark class containing line and mark types.
Definition: markinterface.h:52
KTextEditor::Mark::type
uint type
The mark types in the line, combined with logical OR.
Definition: markinterface.h:58
KTextEditor::Mark::line
int line
The line that contains the mark.
Definition: markinterface.h:55
QHash
QMenu
ktexteditor_export.h
Error
Error
Warning
Warning
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
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