KDevelop API Documentation

editors/qeditor/qeditor_view.h

Go to the documentation of this file.
00001 /* $Id: qeditor_view.h,v 1.27 2003/12/09 19:06:16 aclu Exp $ 00002 * 00003 * Copyright (C) 2001 Roberto Raggi (roberto@kdevelop.org) 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU 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 program 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 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; see the file COPYING. If not, write to 00017 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 * Boston, MA 02111-1307, USA. 00019 * 00020 */ 00021 #ifndef qeditor_view_h 00022 #define qeditor_view_h 00023 00024 #include <kdeversion.h> 00025 #include <ktexteditor/view.h> 00026 #include <ktexteditor/viewcursorinterface.h> 00027 #include <ktexteditor/clipboardinterface.h> 00028 00029 class QPopupMenu; 00030 #include <ktexteditor/popupmenuinterface.h> 00031 #include <ktexteditor/codecompletioninterface.h> 00032 #if defined(KDE_MAKE_VERSION) 00033 # if KDE_VERSION >= KDE_MAKE_VERSION(3,1,90) 00034 # include <ktexteditor/texthintinterface.h> 00035 # else 00036 # include "kde30x_texthintinterface.h" 00037 # endif 00038 #else 00039 # include "kde30x_texthintinterface.h" 00040 #endif 00041 00042 class QEditor; 00043 class QEditorPart; 00044 class QEditorCodeCompletion; 00045 class LineNumberWidget; 00046 class MarkerWidget; 00047 class LevelWidget; 00048 class KoFindDialog; 00049 class KoReplaceDialog; 00050 class KoFind; 00051 class KoReplace; 00052 class QTextParagraph; 00053 class QEditorTextHint; 00054 00055 class QEditorView: 00056 public KTextEditor::View, 00057 public KTextEditor::ClipboardInterface, 00058 public KTextEditor::ViewCursorInterface, 00059 public KTextEditor::PopupMenuInterface, 00060 public KTextEditor::CodeCompletionInterface, 00061 public KTextEditor::TextHintInterface 00062 { 00063 Q_OBJECT 00064 public: 00065 QEditorView( QEditorPart*, QWidget* =0, const char* =0 ); 00066 virtual ~QEditorView(); 00067 00068 KTextEditor::Document* document() const; 00069 QEditorPart* doc() const { return m_document; } 00070 QEditor* editor() const { return m_editor; } 00071 00072 QString currentTextLine() const; 00073 void insertText( const QString& ); 00074 00075 QString language() const; 00076 00077 bool isMarkerWidgetVisible() const; 00078 void setMarkerWidgetVisible( bool ); 00079 MarkerWidget* markerWidget() { return m_markerWidget; } 00080 00081 bool isLineNumberWidgetVisible() const; 00082 void setLineNumberWidgetVisible( bool ); 00083 00084 bool isLevelWidgetVisible() const; 00085 void setLevelWidgetVisible( bool ); 00086 00087 int tabStop() const; 00088 void setTabStop( int ); 00089 00090 public slots: 00091 void configChanged(); 00092 void gotoLine(); 00093 void setLanguage( const QString& ); 00094 void doFind(); 00095 void doReplace(); 00096 void indent(); 00097 void ensureTextIsVisible( QTextParagraph* ); 00098 void expandBlock( QTextParagraph* ); 00099 void collapseBlock( QTextParagraph* ); 00100 void expandAllBlocks(); 00101 void collapseAllBlocks(); 00102 00103 protected slots: 00104 void highlight( const QString&, int, int, const QRect& ); 00105 void replace( const QString&, int, int, int, const QRect& ); 00106 00107 protected: 00108 void proceed(); 00109 bool find_real( QTextParagraph* firstParag, int firstIndex, 00110 QTextParagraph* lastParag, int lastIndex ); 00111 bool process( const QString& ); 00112 void doRepaint(); 00113 void internalEnsureVisibleBlock( QTextParagraph* ); 00114 void internalExpandBlock( QTextParagraph* ); 00115 void internalCollapseBlock( QTextParagraph* ); 00116 00117 private: 00118 void setupActions(); 00119 00120 private: 00121 QTextParagraph* m_currentParag; 00122 KoFindDialog* m_findDialog; 00123 KoReplaceDialog* m_replaceDialog; 00124 KoFind* m_find; 00125 KoReplace* m_replace; 00126 long m_options; 00127 int m_offset; 00128 00129 // ViewCursorInterface ---------------------------------------------------------------------- 00130 public: 00134 virtual QPoint cursorCoordinates (); 00135 00139 virtual void cursorPosition (unsigned int *line, unsigned int *col); 00140 00144 virtual void cursorPositionReal (unsigned int *line, unsigned int *col); 00145 00149 virtual bool setCursorPosition (unsigned int line, unsigned int col); 00150 00154 virtual bool setCursorPositionReal (unsigned int line, unsigned int col); 00155 00156 virtual unsigned int cursorLine (); 00157 virtual unsigned int cursorColumn (); 00158 virtual unsigned int cursorColumnReal (); 00159 00160 signals: 00161 void cursorPositionChanged (); 00162 00163 // -- ClipboardInterface ---------------------------------------------------------------------- 00164 public slots: 00168 virtual void copy ( ) const; 00169 00173 virtual void cut ( ); 00174 00178 virtual void paste ( ); 00179 00183 virtual void selectAll ( ); 00184 00185 // -- PopupMenuInterface ---------------------------------------------------------------------- 00186 public: 00191 virtual void installPopup ( class QPopupMenu *rmb_Menu ); 00192 00193 // -- CodeCompletionInterface ---------------------------------------------------------------------- 00197 virtual void showArgHint (QStringList functionList, const QString& strWrapping, const QString& strDelimiter); 00198 00205 virtual void showCompletionBox (QValueList<KTextEditor::CompletionEntry> complList,int offset=0, bool casesensitive=true); 00206 00207 signals: 00218 void completionAborted(); 00219 00231 void completionDone(); 00232 00247 void completionDone(KTextEditor::CompletionEntry); 00248 00259 void argHintHidden(); 00260 00274 void filterInsertString(KTextEditor::CompletionEntry*,QString*); 00275 00276 void aboutToShowCompletionBox(); 00277 00278 public: 00279 QString computeTextHint( int line, int column ); 00280 void enableTextHints( int timeout ); 00281 void disableTextHints(); 00282 00283 signals: 00284 void needTextHint( int line, int column, QString& ); 00285 void newStatus(); 00286 00287 private: 00288 QEditorPart* m_document; 00289 QEditor* m_editor; 00290 QEditorCodeCompletion* m_pCodeCompletion; 00291 LineNumberWidget* m_lineNumberWidget; 00292 MarkerWidget* m_markerWidget; 00293 LevelWidget* m_levelWidget; 00294 QEditorTextHint* m_textHintToolTip; 00295 }; 00296 00297 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:38:56 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003