Eneboo - Documentación para desarrolladores
src/qt/tools/designer/designer/sourceeditor.h
Ir a la documentación de este archivo.
00001 /**********************************************************************
00002 ** Copyright (C) 2005-2007 Trolltech ASA.  All rights reserved.
00003 **
00004 ** This file is part of Qt Designer.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00012 ** licenses may use this file in accordance with the Qt Commercial License
00013 ** Agreement provided with the Software.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00019 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00020 **   information about Qt Commercial License Agreements.
00021 **
00022 ** Contact info@trolltech.com if any conditions of this licensing are
00023 ** not clear to you.
00024 **
00025 **********************************************************************/
00026 
00027 #ifndef SOURCEEDITOR_H
00028 #define SOURCEEDITOR_H
00029 
00030 #include "../interfaces/editorinterface.h"
00031 #include <qvbox.h>
00032 #include <qguardedptr.h>
00033 
00034 class FormWindow;
00035 class QCloseEvent;
00036 struct LanguageInterface;
00037 class Project;
00038 class SourceFile;
00039 
00040 class SourceEditor : public QVBox
00041 {
00042     Q_OBJECT
00043 
00044 public:
00045     SourceEditor( QWidget *parent, EditorInterface *iface, LanguageInterface *liface );
00046     ~SourceEditor();
00047 
00048     void setObject( QObject *fw, Project *p );
00049     QObject *object() const { return obj; }
00050     Project *project() const { return pro; }
00051     void setFunction( const QString &func, const QString &clss = QString::null );
00052     void setClass( const QString &clss );
00053     void save();
00054     bool saveAs();
00055     void setModified( bool b );
00056     bool isModified() const;
00057 
00058     static QString sourceOfObject( QObject *fw, const QString &lang, EditorInterface *iface, LanguageInterface *lIface );
00059 
00060     QString language() const;
00061     void setLanguage( const QString &l );
00062 
00063     void editCut();
00064     void editCopy();
00065     void editPaste();
00066     bool editIsUndoAvailable();
00067     bool editIsRedoAvailable();
00068     void editUndo();
00069     void editRedo();
00070     void editSelectAll();
00071 
00072     void configChanged();
00073     void refresh( bool allowSave );
00074     void resetContext();
00075 
00076     EditorInterface *editorInterface() const { return iFace; }
00077 
00078     void setFocus();
00079     int numLines() const;
00080     void saveBreakPoints();
00081     void clearStep();
00082     void clearStackFrame();
00083     void resetBreakPoints();
00084 
00085     QString text() const;
00086 
00087     void checkTimeStamp();
00088 
00089     SourceFile *sourceFile() const;
00090     FormWindow *formWindow() const;
00091 
00092 protected:
00093     void closeEvent( QCloseEvent *e );
00094 
00095 
00096 private:
00097     EditorInterface *iFace;
00098     LanguageInterface *lIface;
00099     QGuardedPtr<QObject> obj;
00100     Project *pro;
00101     QString lang;
00102     QGuardedPtr<QWidget> editor;
00103 
00104 };
00105 
00106 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'