You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdevelop/buildtools/qmake/qmakescopeitem.h

129 lines
4.1 KiB

/***************************************************************************
* 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 _TQMAKESCOPEITEM_H_
#define _TQMAKESCOPEITEM_H_
#include <tqlistview.h>
#include <tqstring.h>
class Scope;
class TQMakeScopeItem;
class FileItem;
class TrollProjectWidget;
/**
* Base class for all items appearing in ProjectOverview and ProjectDetails.
*/
class qProjectItem : public TQListViewItem
{
public:
enum Type { Subproject, Group, File };
qProjectItem( Type type, TQListView *tqparent, const TQString &text );
qProjectItem( Type type, qProjectItem *tqparent, const TQString &text );
TQString 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 TQString &ext );
static void groupTypeMeanings( GroupItem::GroupType type, TQString& title, TQString& ext );
GroupItem( TQListView *lv, GroupType type, const TQString &text, TQMakeScopeItem* spitem );
void removeFileFromScope( const TQString& filename);
void addFileToScope( const TQString& filename);
void addInstallObject( const TQString& objectname);
void removeInstallObject( GroupItem* item );
// qmake INSTALLS support
TQPtrList<GroupItem> installs;
TQPtrList<FileItem> files;
// TQStringList str_files;
// TQStringList str_files_exclude;
// end qmake INSTALLS support
GroupType groupType;
TQMakeScopeItem* owner;
protected:
void paintCell( TQPainter* p, const TQColorGroup& cg, int column, int width, int align );
};
// Not sure if this complexity is really necessary...
class FileItem : public qProjectItem
{
public:
FileItem( TQListView *lv, const TQString &text );
TQString uiFileLink;
TQString localFilePath;
};
/**
* Stores one Scope
*/
class TQMakeScopeItem : public qProjectItem
{
public:
TQMakeScopeItem( TQListView *tqparent, const TQString &text, Scope *s, TrollProjectWidget* widget );
TQMakeScopeItem( TQMakeScopeItem *tqparent, const TQString &text, Scope* );
void updateValues( const TQString& var, const TQStringList& values );
void addValue( const TQString& var, const TQString& value );
void removeValue( const TQString& var, const TQString& value );
void addValues( const TQString& var, const TQStringList& values );
void removeValues( const TQString& var, const TQStringList& values );
void disableSubprojects( const TQStringList& );
void reloadProject();
int compare( TQListViewItem* i, int col, bool ascending ) const;
~TQMakeScopeItem();
TQMap<GroupItem::GroupType, GroupItem*> groups;
Scope* scope;
TQString relativePath();
TQString getLibAddPath( TQString );
TQString getLibAddObject( TQString );
TQString getSharedLibAddObject( TQString );
TQString getApplicationObject( TQString );
TQString getIncAddPath( TQString downDirs );
FileItem* createFileItem(const TQString& file);
GroupItem* createGroupItem(GroupItem::GroupType type, const TQString& name, TQMakeScopeItem* scopeitem);
TQMap<TQString, TQString> getLibInfos( TQString );
TQMakeScopeItem* projectFileItem();
TrollProjectWidget* m_widget;
private:
void init();
void buildSubTree();
void buildGroups();
};
#endif
// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on