KTextEditor
annotationinterface.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 * Copyright 2008 Andreas Pakulat <apaku@gmx.de> 00003 * Copyright 2008 Dominik Haumann <dhaumann kde org> 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_ANNOTATIONINTERFACE_H 00022 #define KDELIBS_KTEXTEDITOR_ANNOTATIONINTERFACE_H 00023 00024 #include <ktexteditor/ktexteditor_export.h> 00025 00026 #include <QtCore/QObject> 00027 00028 class QMenu; 00029 00030 namespace KTextEditor 00031 { 00032 00033 class View; 00034 00053 class KTEXTEDITOR_EXPORT AnnotationModel : public QObject 00054 { 00055 Q_OBJECT 00056 public: 00057 00058 virtual ~AnnotationModel() {} 00059 00076 virtual QVariant data( int line, Qt::ItemDataRole role ) const = 0; 00077 00078 Q_SIGNALS: 00089 void reset(); 00090 00098 void lineChanged( int line ); 00099 }; 00100 00101 00150 class KTEXTEDITOR_EXPORT AnnotationInterface 00151 { 00152 public: 00153 virtual ~AnnotationInterface() {} 00154 00161 virtual void setAnnotationModel( AnnotationModel* model ) = 0; 00162 00168 virtual AnnotationModel* annotationModel() const = 0; 00169 00170 }; 00171 00172 00210 class KTEXTEDITOR_EXPORT AnnotationViewInterface : public AnnotationInterface 00211 { 00212 public: 00213 virtual ~AnnotationViewInterface() {} 00214 00221 virtual void setAnnotationBorderVisible( bool visible ) = 0; 00222 00226 virtual bool isAnnotationBorderVisible() const = 0; 00227 00228 // 00229 // SIGNALS!!! 00230 // 00231 public: 00243 virtual void annotationContextMenuAboutToShow( KTextEditor::View* view, QMenu* menu, int line ) = 0; 00244 00253 virtual void annotationActivated( KTextEditor::View* view, int line ) = 0; 00254 00261 virtual void annotationBorderVisibilityChanged( KTextEditor::View* view, bool visible ) = 0; 00262 00263 }; 00264 00265 } 00266 00267 Q_DECLARE_INTERFACE(KTextEditor::AnnotationInterface, "org.kde.KTextEditor.AnnotationInterface") 00268 Q_DECLARE_INTERFACE(KTextEditor::AnnotationViewInterface, "org.kde.KTextEditor.AnnotationViewInterface") 00269 00270 #endif 00271 00272 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE 4.6 API Reference