summaryrefslogtreecommitdiffstats
path: root/buildtools/qmake/qmakescopeitem.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /buildtools/qmake/qmakescopeitem.h
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
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
Diffstat (limited to 'buildtools/qmake/qmakescopeitem.h')
-rw-r--r--buildtools/qmake/qmakescopeitem.h128
1 files changed, 128 insertions, 0 deletions
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 <qlistview.h>
+#include <qstring.h>
+
+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<GroupItem> installs;
+ QPtrList<FileItem> 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<GroupItem::GroupType, GroupItem*> 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<QString, QString> 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