Eneboo - Documentación para desarrolladores
src/qt/tools/designer/designer/designerappiface.h
Ir a la documentación de este archivo.
00001  /**********************************************************************
00002 ** Copyright (C) 2000-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 DESIGNERAPPIFACE_H
00028 #define DESIGNERAPPIFACE_H
00029 
00030 #include "../interfaces/designerinterface.h"
00031 #include "project.h"
00032 
00033 class FormWindow;
00034 class MainWindow;
00035 class Project;
00036 class OutputWindow;
00037 class SourceFile;
00038 
00039 class DesignerInterfaceImpl : public DesignerInterface
00040 {
00041 public:
00042     DesignerInterfaceImpl( MainWindow *mw );
00043 
00044     DesignerProject *currentProject() const;
00045     DesignerFormWindow *currentForm() const;
00046     DesignerSourceFile *currentSourceFile() const;
00047     QPtrList<DesignerProject> projectList() const;
00048     void showStatusMessage( const QString &, int ms = 0 ) const;
00049     DesignerDock *createDock() const;
00050     DesignerOutputDock *outputDock() const;
00051     void setModified( bool b, QWidget *window );
00052     void updateFunctionList();
00053 
00054     void onProjectChange( QObject *receiver, const char *slot );
00055     void onFormChange( QObject *receiver, const char *slot );
00056 
00057     bool singleProjectMode() const;
00058     void showError( QWidget *widget, int line, const QString &message );
00059     void runFinished();
00060     void showStackFrame( QWidget *w, int line );
00061     void showDebugStep( QWidget *w, int line );
00062     void runProjectPrecondition();
00063     void runProjectPostcondition( QObjectList *l );
00064 
00065 
00066     QRESULT queryInterface( const QUuid &uuid, QUnknownInterface** iface );
00067     Q_REFCOUNT
00068 
00069 private:
00070     MainWindow *mainWindow;
00071 
00072 };
00073 
00074 class DesignerProjectImpl: public DesignerProject
00075 {
00076 public:
00077     DesignerProjectImpl( Project *pr );
00078 
00079     QPtrList<DesignerFormWindow> formList() const;
00080     QStringList formNames() const;
00081     QString formFileName( const QString &form ) const;
00082     void addForm( DesignerFormWindow * );
00083     void removeForm( DesignerFormWindow * );
00084     QString fileName() const;
00085     void setFileName( const QString & );
00086     QString projectName() const;
00087     void setProjectName( const QString & );
00088     QString databaseFile() const;
00089     void setDatabaseFile( const QString & );
00090     void setupDatabases() const;
00091     QPtrList<DesignerDatabase> databaseConnections() const;
00092     void addDatabase( DesignerDatabase * );
00093     void removeDatabase( DesignerDatabase * );
00094     void save() const;
00095     void setLanguage( const QString & );
00096     QString language() const;
00097     void setCustomSetting( const QString &key, const QString &value );
00098     QString customSetting( const QString &key ) const;
00099     DesignerPixmapCollection *pixmapCollection() const;
00100     void breakPoints( QMap<QString, QValueList<uint> > &bps ) const;
00101     QString breakPointCondition( QObject *o, int line ) const;
00102     void setBreakPointCondition( QObject *o, int line, const QString &condition );
00103     void clearAllBreakpoints() const;
00104     void setIncludePath( const QString &platform, const QString &path );
00105     void setLibs( const QString &platform, const QString &path );
00106     void setDefines( const QString &platform, const QString &path );
00107     void setConfig( const QString &platform, const QString &config );
00108     void setTemplate( const QString &t );
00109     QString config( const QString &platform ) const;
00110     QString libs( const QString &platform ) const;
00111     QString defines( const QString &platform ) const;
00112     QString includePath( const QString &platform ) const;
00113     QString templte() const;
00114     bool isGenericObject( QObject *o ) const;
00115 
00116 private:
00117     Project *project;
00118 
00119 };
00120 
00121 #ifndef QT_NO_SQL
00122 class QSqlDatabase;
00123 
00124 class DesignerDatabaseImpl: public DesignerDatabase
00125 {
00126 public:
00127     DesignerDatabaseImpl( DatabaseConnection *d );
00128 
00129     QString name() const;
00130     void setName( const QString & );
00131     QString driver() const;
00132     void setDriver( const QString & );
00133     QString database() const;
00134     void setDatabase( const QString & );
00135     QString userName() const;
00136     void setUserName( const QString & );
00137     QString password() const;
00138     void setPassword( const QString & );
00139     QString hostName() const;
00140     void setHostName( const QString & );
00141     QStringList tables() const;
00142     void setTables( const QStringList & );
00143     QMap<QString, QStringList> fields() const;
00144     void setFields( const QMap<QString, QStringList> & );
00145     void open( bool suppressDialog = TRUE ) const;
00146     void close() const;
00147     QSqlDatabase* connection();
00148 private:
00149     DatabaseConnection *db;
00150 
00151 };
00152 #endif
00153 
00154 class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
00155 {
00156 public:
00157     DesignerPixmapCollectionImpl( PixmapCollection *coll );
00158     void addPixmap( const QPixmap &p, const QString &name, bool force );
00159     QPixmap pixmap( const QString &name ) const;
00160 
00161 private:
00162     PixmapCollection *pixCollection;
00163 
00164 };
00165 
00166 class DesignerFormWindowImpl: public DesignerFormWindow
00167 {
00168 public:
00169     DesignerFormWindowImpl( FormWindow *fw );
00170 
00171     QString name() const;
00172     void setName( const QString &n );
00173     QString fileName() const;
00174     void setFileName( const QString & );
00175     void save() const;
00176     bool isModified() const;
00177     void insertWidget( QWidget * );
00178     QWidget *create( const char *className, QWidget *parent, const char *name );
00179     void removeWidget( QWidget * );
00180     QWidgetList widgets() const;
00181     void undo();
00182     void redo();
00183     void cut();
00184     void copy();
00185     void paste();
00186     void adjustSize();
00187     void editConnections();
00188     void checkAccels();
00189     void layoutH();
00190     void layoutV();
00191     void layoutHSplit();
00192     void layoutVSplit();
00193     void layoutG();
00194     void layoutHContainer( QWidget* w );
00195     void layoutVContainer( QWidget* w );
00196     void layoutGContainer( QWidget* w );
00197     void breakLayout();
00198     void selectWidget( QWidget * );
00199     void selectAll();
00200     void clearSelection();
00201     bool isWidgetSelected( QWidget * ) const;
00202     QWidgetList selectedWidgets() const;
00203     QWidget *currentWidget() const;
00204     QWidget *form() const;
00205     void setCurrentWidget( QWidget * );
00206     QPtrList<QAction> actionList() const;
00207     QAction *createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
00208                            QObject* parent, const char* name = 0, bool toggle = FALSE );
00209     void addAction( QAction * );
00210     void removeAction( QAction * );
00211     void preview() const;
00212     void addFunction( const QCString &function, const QString& specifier, const QString &access,
00213                       const QString &type, const QString &language, const QString &returnType );
00214     void addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot );
00215     void setProperty( QObject *o, const char *property, const QVariant &value );
00216     QVariant property( QObject *o, const char *property ) const;
00217     void setPropertyChanged( QObject *o, const char *property, bool changed );
00218     bool isPropertyChanged( QObject *o, const char *property ) const;
00219     void setColumnFields( QObject *o, const QMap<QString, QString> & );
00220     QStringList implementationIncludes() const;
00221     QStringList declarationIncludes() const;
00222     void setImplementationIncludes( const QStringList &lst );
00223     void setDeclarationIncludes( const QStringList &lst );
00224     QStringList forwardDeclarations() const;
00225     void setForwardDeclarations( const QStringList &lst );
00226     QStringList signalList() const;
00227     void setSignalList( const QStringList &lst );
00228     void addMenu( const QString &text, const QString &name );
00229     void addMenuAction( const QString &menu, QAction *a );
00230     void addMenuSeparator( const QString &menu );
00231     void addToolBar( const QString &text, const QString &name );
00232     void addToolBarAction( const QString &tb, QAction *a );
00233     void addToolBarSeparator( const QString &tb );
00234 
00235     void onModificationChange( QObject *receiver, const char *slot );
00236 
00237 private:
00238     FormWindow *formWindow;
00239 
00240 };
00241 
00242 class DesignerDockImpl: public DesignerDock
00243 {
00244 public:
00245     DesignerDockImpl();
00246 
00247     QDockWindow *dockWindow() const;
00248 };
00249 
00250 class DesignerOutputDockImpl: public DesignerOutputDock
00251 {
00252 public:
00253     DesignerOutputDockImpl( OutputWindow *ow );
00254 
00255     QWidget *addView( const QString &pageName );
00256     void appendDebug( const QString & );
00257     void clearDebug();
00258     void appendError( const QString &, int );
00259     void clearError();
00260 
00261 private:
00262     OutputWindow *outWin;
00263 
00264 };
00265 
00266 class DesignerSourceFileImpl : public DesignerSourceFile
00267 {
00268 public:
00269     DesignerSourceFileImpl( SourceFile *e );
00270     QString fileName() const;
00271 
00272 private:
00273     SourceFile *ed;
00274 
00275 };
00276 
00277 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'