00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KDELIBS_KTEXTEDITOR_MARKINTERFACE_H
00022 #define KDELIBS_KTEXTEDITOR_MARKINTERFACE_H
00023
00024 #include <ktexteditor/ktexteditor_export.h>
00025
00026 #include <QtCore/QHash>
00027 #include <QtCore/QObject>
00028
00029 class QPixmap;
00030
00031 namespace KTextEditor
00032 {
00033
00034 class Document;
00035
00049 class Mark
00050 {
00051 public:
00053 int line;
00054
00056 uint type;
00057 };
00058
00116 class KTEXTEDITOR_EXPORT MarkInterface
00117 {
00118 public:
00119 MarkInterface ();
00120
00124 virtual ~MarkInterface ();
00125
00126
00127
00128
00129 public:
00137 virtual uint mark (int line) = 0;
00138
00152 virtual void setMark (int line, uint markType) = 0;
00153
00159 virtual void clearMark (int line) = 0;
00160
00169 virtual void addMark (int line, uint markType) = 0;
00170
00177 virtual void removeMark (int line, uint markType) = 0;
00178
00184 virtual const QHash<int, KTextEditor::Mark*> &marks () = 0;
00185
00190
00191 virtual void clearMarks () = 0;
00192
00199 static int reservedMarkersCount() { return 7; }
00200
00207 enum MarkTypes
00208 {
00210 markType01= 0x1,
00212 markType02= 0x2,
00214 markType03= 0x4,
00216 markType04= 0x8,
00218 markType05= 0x10,
00220 markType06= 0x20,
00222 markType07= 0x40,
00223
00224 markType08= 0x80,
00225 markType09= 0x100,
00226 markType10= 0x200,
00227 markType11= 0x400,
00228 markType12= 0x800,
00229 markType13= 0x1000,
00230 markType14= 0x2000,
00231 markType15= 0x4000,
00232 markType16= 0x8000,
00233 markType17= 0x10000,
00234 markType18= 0x20000,
00235 markType19= 0x40000,
00236 markType20= 0x80000,
00237 markType21= 0x100000,
00238 markType22= 0x200000,
00239 markType23= 0x400000,
00240 markType24= 0x800000,
00241 markType25= 0x1000000,
00242 markType26= 0x2000000,
00243 markType27= 0x4000000,
00244 markType28= 0x8000000,
00245 markType29= 0x10000000,
00246 markType30= 0x20000000,
00247 markType31= 0x40000000,
00248 markType32= 0x80000000,
00249
00250 Bookmark = markType01,
00251 BreakpointActive = markType02,
00252 BreakpointReached = markType03,
00253 BreakpointDisabled = markType04,
00254 Execution = markType05,
00255 Warning = markType06,
00256 Error = markType07
00257 };
00258
00259
00260
00261
00262 public:
00268 virtual void marksChanged (KTextEditor::Document* document) = 0;
00269
00270
00271
00272
00273 public:
00280 virtual void setMarkPixmap( MarkTypes mark, const QPixmap &pixmap ) = 0;
00281
00288 virtual QPixmap markPixmap( MarkTypes mark ) const = 0;
00289
00296 virtual void setMarkDescription( MarkTypes mark, const QString &text ) = 0;
00297
00305 virtual QString markDescription( MarkTypes mark ) const = 0;
00306
00326 virtual void setEditableMarks( uint markMask ) = 0;
00327
00335 virtual uint editableMarks() const = 0;
00336
00341 enum MarkChangeAction {
00342 MarkAdded=0,
00343 MarkRemoved=1
00344 };
00345
00346
00347
00348
00349 public:
00357 virtual void markChanged ( KTextEditor::Document* document, KTextEditor::Mark mark,
00358 KTextEditor::MarkInterface::MarkChangeAction action) = 0;
00359
00360 private:
00361 class MarkInterfacePrivate* const d;
00362 };
00363
00364 }
00365
00366 Q_DECLARE_INTERFACE(KTextEditor::MarkInterface, "org.kde.KTextEditor.MarkInterface")
00367
00368 #endif
00369
00370