From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- buildtools/qmake/qmakescopeitem.h | 128 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 buildtools/qmake/qmakescopeitem.h (limited to 'buildtools/qmake/qmakescopeitem.h') diff --git a/buildtools/qmake/qmakescopeitem.h b/buildtools/qmake/qmakescopeitem.h new file mode 100644 index 00000000..b2c84345 --- /dev/null +++ b/buildtools/qmake/qmakescopeitem.h @@ -0,0 +1,128 @@ +/*************************************************************************** +* Copyright (C) 2006 by Andreas Pakulat * +* apaku@gmx.de * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef _QMAKESCOPEITEM_H_ +#define _QMAKESCOPEITEM_H_ + +#include +#include + +class Scope; +class QMakeScopeItem; +class FileItem; +class TrollProjectWidget; + +/** + * Base class for all items appearing in ProjectOverview and ProjectDetails. + */ +class qProjectItem : public QListViewItem +{ +public: + enum Type { Subproject, Group, File }; + + qProjectItem( Type type, QListView *parent, const QString &text ); + qProjectItem( Type type, qProjectItem *parent, const QString &text ); + + QString scopeString; + Type type() + { return typ; } + +private: + Type typ; + void init(); + +}; + + +class GroupItem : public qProjectItem +{ +public: + enum GroupType {NoType, Sources, Headers, Forms, Distfiles, Images, Resources, Lexsources, Yaccsources, Translations, IDLs, InstallRoot, InstallObject, MaxTypeEnum }; + + static GroupType groupTypeForExtension( const QString &ext ); + static void groupTypeMeanings( GroupItem::GroupType type, QString& title, QString& ext ); + + GroupItem( QListView *lv, GroupType type, const QString &text, QMakeScopeItem* spitem ); + + void removeFileFromScope( const QString& filename); + void addFileToScope( const QString& filename); + void addInstallObject( const QString& objectname); + void removeInstallObject( GroupItem* item ); + + // qmake INSTALLS support + QPtrList installs; + QPtrList files; + +// QStringList str_files; +// QStringList str_files_exclude; + // end qmake INSTALLS support + GroupType groupType; + QMakeScopeItem* owner; + +protected: + void paintCell( QPainter* p, const QColorGroup& cg, int column, int width, int align ); +}; + + +// Not sure if this complexity is really necessary... +class FileItem : public qProjectItem +{ +public: + FileItem( QListView *lv, const QString &text ); + + QString uiFileLink; + QString localFilePath; +}; + +/** + * Stores one Scope + */ +class QMakeScopeItem : public qProjectItem +{ +public: + QMakeScopeItem( QListView *parent, const QString &text, Scope *s, TrollProjectWidget* widget ); + QMakeScopeItem( QMakeScopeItem *parent, const QString &text, Scope* ); + void updateValues( const QString& var, const QStringList& values ); + void addValue( const QString& var, const QString& value ); + void removeValue( const QString& var, const QString& value ); + void addValues( const QString& var, const QStringList& values ); + void removeValues( const QString& var, const QStringList& values ); + void disableSubprojects( const QStringList& ); + void reloadProject(); + int compare( QListViewItem* i, int col, bool ascending ) const; + ~QMakeScopeItem(); + + QMap groups; + + Scope* scope; + QString relativePath(); + QString getLibAddPath( QString ); + QString getLibAddObject( QString ); + QString getSharedLibAddObject( QString ); + QString getApplicationObject( QString ); + QString getIncAddPath( QString downDirs ); + FileItem* createFileItem(const QString& file); + GroupItem* createGroupItem(GroupItem::GroupType type, const QString& name, QMakeScopeItem* scopeitem); + QMap getLibInfos( QString ); + + QMakeScopeItem* projectFileItem(); + + TrollProjectWidget* m_widget; +private: + void init(); + void buildSubTree(); + void buildGroups(); +}; + + +#endif + +// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on -- cgit v1.2.1