Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qsaeditorinterface.h 1.1.5 edited 2006-02-23T15:39:57$ 00003 ** 00004 ** Copyright (C) 2001-2006 Trolltech AS. All rights reserved. 00005 ** 00006 ** This file is part of the Qt Script for Applications framework (QSA). 00007 ** 00008 ** This file may be distributed and/or modified under the terms of the 00009 ** GNU General Public License version 2 as published by the Free Software 00010 ** Foundation and appearing in the file LICENSE.GPL included in the 00011 ** packaging of this file. 00012 ** 00013 ** Licensees holding a valid Qt Script for Applications license may use 00014 ** this file in accordance with the Qt Script for Applications License 00015 ** Agreement provided with the Software. 00016 ** 00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00019 ** 00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00021 ** information about QSA Commercial License Agreements. 00022 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00023 ** 00024 ** Contact info@trolltech.com if any conditions of this licensing are 00025 ** not clear to you. 00026 ** 00027 *****************************************************************************/ 00028 00029 #ifndef QUICKEDITORINTERFACE_H 00030 #define QUICKEDITORINTERFACE_H 00031 00032 #include <qobject.h> 00033 #include <qguardedptr.h> 00034 00035 class QTimer; 00036 class ViewManager; 00037 class QAction; 00038 class QTextEdit; 00039 00040 class QSAEditorInterface : public QObject 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 QSAEditorInterface(); 00046 virtual ~QSAEditorInterface(); 00047 00048 QWidget *editor( bool readonly, QWidget *parent ); 00049 00050 void setText( const QString &txt ); 00051 QString text() const; 00052 bool isUndoAvailable() const; 00053 bool isRedoAvailable() const; 00054 void undo(); 00055 void redo(); 00056 void cut(); 00057 void copy(); 00058 void paste(); 00059 void selectAll(); 00060 bool find( const QString &expr, bool cs, bool wo, bool forward, bool startAtCursor ); 00061 bool replace( const QString &find, const QString &replace, bool cs, bool wo, 00062 bool forward, bool startAtCursor, bool replaceAll ); 00063 void gotoLine( int line ); 00064 void indent(); 00065 void scrollTo( const QString &txt, const QString &first ); 00066 void splitView(); 00067 void setContext( QObject *this_ ); 00068 void readSettings(); 00069 00070 void setError( int line ); 00071 void clearError(); 00072 void setStep( int line ); 00073 void clearStep(); 00074 void clearStackFrame(); 00075 void setStackFrame( int line ); 00076 void setModified( bool b ); 00077 bool isModified() const; 00078 00079 int numLines() const; 00080 00081 // void breakPoints( QValueList<uint> & ) const; 00082 // void setBreakPoints( const QValueList<uint> & ); 00083 00084 // void setMode( Mode m ); 00085 00086 // void onBreakPointChange( QObject *receiver, const char *slot ); 00087 00088 ViewManager *view_manager() const { return viewManager; } 00089 00090 // void toggleDebugger( bool enable ); 00091 00092 protected: 00093 bool eventFilter( QObject*, QEvent* ); 00094 00095 private slots: 00096 void modificationChanged( bool m ); 00097 void update(); 00098 void intervalChanged(); 00099 // void toggleBreakpoint(); 00100 // void editBreakpoints(); 00101 // void isBreakpointPossible( bool &possible, const QString &code, int line ); 00102 00103 private: 00104 QTextEdit *activeEditor( QSAEditorInterface **iface ) const; 00105 00106 private: 00107 QGuardedPtr<ViewManager> viewManager; 00108 QTimer *updateTimer; 00109 // QAction *actionToggleBreakPoint; 00110 // QAction *actionEditBreakpoints; 00111 static bool debuggerEnabled; 00112 00113 }; 00114 00115 #endif