KTextEditor
markinterface.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) 00003 Copyright (C) 2005 Dominik Haumann (dhdev@gmx.de) (documentation) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 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 class QPoint; 00031 class QMenu; 00032 00033 namespace KTextEditor 00034 { 00035 00036 class Document; 00037 00051 class Mark 00052 { 00053 public: 00055 int line; 00056 00058 uint type; 00059 }; 00060 00118 class KTEXTEDITOR_EXPORT MarkInterface 00119 { 00120 public: 00121 MarkInterface (); 00122 00126 virtual ~MarkInterface (); 00127 00128 // 00129 // slots !!! 00130 // 00131 public: 00139 virtual uint mark (int line) = 0; 00140 00154 virtual void setMark (int line, uint markType) = 0; 00155 00161 virtual void clearMark (int line) = 0; 00162 00171 virtual void addMark (int line, uint markType) = 0; 00172 00179 virtual void removeMark (int line, uint markType) = 0; 00180 00186 virtual const QHash<int, KTextEditor::Mark*> &marks () = 0; 00187 00192 00193 virtual void clearMarks () = 0; 00194 00201 static int reservedMarkersCount() { return 7; } 00202 00209 enum MarkTypes 00210 { 00212 markType01= 0x1, 00214 markType02= 0x2, 00216 markType03= 0x4, 00218 markType04= 0x8, 00220 markType05= 0x10, 00222 markType06= 0x20, 00224 markType07= 0x40, 00225 00226 markType08= 0x80, 00227 markType09= 0x100, 00228 markType10= 0x200, 00229 markType11= 0x400, 00230 markType12= 0x800, 00231 markType13= 0x1000, 00232 markType14= 0x2000, 00233 markType15= 0x4000, 00234 markType16= 0x8000, 00235 markType17= 0x10000, 00236 markType18= 0x20000, 00237 markType19= 0x40000, 00238 markType20= 0x80000, 00239 markType21= 0x100000, 00240 markType22= 0x200000, 00241 markType23= 0x400000, 00242 markType24= 0x800000, 00243 markType25= 0x1000000, 00244 markType26= 0x2000000, 00245 markType27= 0x4000000, 00246 markType28= 0x8000000, 00247 markType29= 0x10000000, 00248 markType30= 0x20000000, 00249 markType31= 0x40000000, 00250 markType32= 0x80000000, 00251 /* reserved marks */ 00252 Bookmark = markType01, 00253 BreakpointActive = markType02, 00254 BreakpointReached = markType03, 00255 BreakpointDisabled = markType04, 00256 Execution = markType05, 00257 Warning = markType06, 00258 Error = markType07 00259 }; 00260 00261 // 00262 // signals !!! 00263 // 00264 public: 00270 virtual void marksChanged (KTextEditor::Document* document) = 0; 00271 00272 /* 00273 * Methods to modify mark properties. 00274 */ 00275 public: 00282 virtual void setMarkPixmap( MarkTypes mark, const QPixmap &pixmap ) = 0; 00283 00290 virtual QPixmap markPixmap( MarkTypes mark ) const = 0; 00291 00298 virtual void setMarkDescription( MarkTypes mark, const QString &text ) = 0; 00299 00307 virtual QString markDescription( MarkTypes mark ) const = 0; 00308 00328 virtual void setEditableMarks( uint markMask ) = 0; 00329 00337 virtual uint editableMarks() const = 0; 00338 00343 enum MarkChangeAction { 00344 MarkAdded=0, 00345 MarkRemoved=1 00346 }; 00347 00348 // 00349 // signals !!! 00350 // 00351 public: 00359 virtual void markChanged ( KTextEditor::Document* document, KTextEditor::Mark mark, 00360 KTextEditor::MarkInterface::MarkChangeAction action) = 0; 00361 00362 Q_SIGNALS: 00363 00372 void markToolTipRequested ( KTextEditor::Document* document, KTextEditor::Mark mark, 00373 QPoint position, bool& handled ); 00374 00383 void markContextMenuRequested( KTextEditor::Document* document, KTextEditor::Mark mark, 00384 QPoint pos, bool& handled ); 00385 00386 00394 void markClicked( KTextEditor::Document* document, KTextEditor::Mark mark, bool& handled ); 00395 00396 private: 00397 class MarkInterfacePrivate* const d; 00398 }; 00399 00400 } 00401 00402 Q_DECLARE_INTERFACE(KTextEditor::MarkInterface, "org.kde.KTextEditor.MarkInterface") 00403 00404 #endif 00405 00406 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE 4.6 API Reference