• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • kde-4.14
  • applications
  • kate
  • 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 
29 class QPixmap;
30 class QPoint;
31 class QMenu;
32 
33 namespace KTextEditor
34 {
35 
36 class Document;
37 
51 class Mark
52 {
53  public:
55  int line;
56 
58  uint type;
59 };
60 
118 class 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 
192  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 
402 Q_DECLARE_INTERFACE(KTextEditor::MarkInterface, "org.kde.KTextEditor.MarkInterface")
403 
404 #endif
405 
406 // kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Mark::type
uint type
The mark types in the line, combined with logical OR.
Definition: markinterface.h:58
KTextEditor::MarkInterface
Mark extension interface for the Document.
Definition: markinterface.h:118
QPoint
KTextEditor::Mark::line
int line
The line that contains the mark.
Definition: markinterface.h:55
KTextEditor::MarkInterface::MarkChangeAction
MarkChangeAction
Possible actions on a mark.
Definition: markinterface.h:343
QHash
ktexteditor_export.h
KTextEditor::Document
A KParts derived class representing a text document.
Definition: document.h:111
KTextEditor::Mark
Mark class containing line and mark types.
Definition: markinterface.h:51
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
QString
QPixmap
QMenu
KTextEditor::MarkInterface::MarkTypes
MarkTypes
Predefined mark types.
Definition: markinterface.h:209
KTextEditor::MarkInterface::reservedMarkersCount
static int reservedMarkersCount()
Get the number of predefined mark types we have so far.
Definition: markinterface.h:201
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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