Eneboo - Documentación para desarrolladores
src/qt/tools/designer/designer/editfunctionsimpl.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 EDITFUNCTIONSIMPL_H
00028 #define EDITFUNCTIONSIMPL_H
00029 
00030 #include "editfunctions.h"
00031 #include "hierarchyview.h"
00032 #include "metadatabase.h"
00033 #include <qmap.h>
00034 
00035 class FormWindow;
00036 class QListViewItem;
00037 
00038 class EditFunctions : public EditFunctionsBase
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043     EditFunctions( QWidget *parent, FormWindow *fw, bool showOnlySlots = FALSE );
00044 
00045     void setCurrentFunction( const QString &function );
00046     void functionAdd( const QString &access = QString::null,
00047                       const QString &type = QString::null  );
00048     void functionAdd() { functionAdd( "public" ); }
00049 
00050 signals:
00051     void itemRenamed(const QString &);
00052 
00053 protected slots:
00054     void okClicked();
00055     void functionRemove();
00056     void currentItemChanged( QListViewItem * );
00057     void currentTextChanged( const QString &txt );
00058     void currentSpecifierChanged( const QString &s );
00059     void currentAccessChanged( const QString &a );
00060     void currentReturnTypeChanged( const QString &type );
00061     void currentTypeChanged( const QString &type );
00062     void displaySlots( bool justSlots );
00063     void emitItemRenamed( QListViewItem *, int, const QString & );
00064 
00065 private:
00066     enum Attribute { Name, Specifier, Access, ReturnType, Type };
00067     struct FunctItem {
00068         int id;
00069         QString oldName;
00070         QString newName;
00071         QString oldRetTyp;
00072         QString retTyp;
00073         QString spec;
00074         QString oldSpec;
00075         QString access;
00076         QString oldAccess;
00077         QString type;
00078         QString oldType;
00079 
00080         Q_DUMMY_COMPARISON_OPERATOR( FunctItem )
00081     };
00082 
00083     void changeItem( QListViewItem *item, Attribute a, const QString &nV );
00084 
00085     FormWindow *formWindow;
00086     QMap<QListViewItem*, int> functionIds;
00087     QStringList removedFunctions;
00088     QValueList<MetaDataBase::Function> itemList;
00089     QValueList<FunctItem> functList;
00090     int id;
00091     QString lastType;
00092 };
00093 
00094 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'