2
KDevelop Autotools Support
3
Copyright (c) 2001-2002 by Bernd Gehrmann <bernd@kdevelop.org>
4
Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
5
Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
7
***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************
17
#ifndef _AUTOPROJECTWIDGET_H_
18
#define _AUTOPROJECTWIDGET_H_
21
#include <qlistview.h>
26
#include <qtoolbutton.h>
27
#include <kiconloader.h>
31
#include "makefilehandler.h"
33
class AutoProjectPart;
34
class AutoSubprojectView;
35
class AutoDetailsView;
46
class MakefileHandler;
48
class AutoProjectWidget : public QVBox
51
friend class RemoveFileDialog;
52
friend class TargetOptionsDialog; // to access projectDom() via m_part->projectDom()
54
AutoProjectWidget( AutoProjectPart *part, bool kde );
57
void openProject( const QString &dirName );
61
* A list of the (relative) names of all subprojects (== subdirectories)
63
QStringList allSubprojects();
65
* A list of all Subproject items in the overview KListView
67
QPtrList <SubprojectItem> allSubprojectItems();
69
* A list of the (relative) names of all libraries
71
QStringList allLibraries();
73
* A list of all files that belong to the project
75
QStringList allFiles();
77
* The top level directory of the project.
79
QString projectDirectory() const;
81
* The directory of the currently shown subproject.
83
QString subprojectDirectory();
93
* Sets the given target active. The argument is given
94
* relative to the project directory.
96
void setActiveTarget( const QString &targetPath );
98
* Returns the active target as path relative to
99
* the project directory.
101
QString activeDirectory();
104
* Adds a file to the active target.
105
* If the file does not contain a "/" character, it is added
106
* to the active target.
107
* If it does contain "/" character(s), ... @todo .. add to appropriate target
109
void addFiles( const QStringList &list );
111
* Removes the file fileName from the directory directory.
112
* (not implemented currently)
114
void removeFiles( const QStringList &list );
117
* Returns the currently selected target. Returns 0 if
118
* no target is selected.
120
TargetItem *selectedTarget();
123
* Returns the currently selected file. Returns 0 if
124
* no file is selected.
126
FileItem *selectedFile();
129
* Returns the currently selected subproject (directory with Makefile.am). Returns 0 if
130
* no subproject is selected.
132
SubprojectItem* selectedSubproject();
135
* Creates a TargetItem instance without a parent item.
137
TargetItem *createTargetItem( const QString &name,
138
const QString &prefix, const QString &primary,
141
* Creates a FileItem instance without a parent item.
143
FileItem *createFileItem( const QString &name, SubprojectItem *subproject );
146
* Returns the Subproject that contains the Active Target. The Active Target is a special target
147
* to which e.g. all files are added to.
149
SubprojectItem* activeSubproject ();
150
void setActiveSubproject( SubprojectItem* spitem );
153
* Returns the Active Target. The Active Target is a special target
154
* to which e.g. all files are added to.
156
TargetItem* activeTarget();
159
* Returns the sub project item, if any, for a given path. The path supplied can be either
160
* absolute, or relative to the project directory. If no subproject item is found for the
161
* path, null is returned.
163
SubprojectItem* subprojectItemForPath( const QString & path, bool pathIsAbsolute = false );
166
* Returns the projectdir-relative path for a target item
168
QString pathForTarget( const TargetItem *item ) const;
171
* Adds file fileName to target titem in subproject spitem
173
void addToTarget( const QString & fileName, SubprojectItem* spitem, TargetItem* titem );
176
* Restores the last settings of the AutoProjectWidget
178
void restoreSession ( const QDomElement* el );
181
* Saves the latest changes of the AutoProjectWidget to the session file.
183
void saveSession ( QDomElement* el );
185
AutoSubprojectView* getSubprojectView ();
186
AutoDetailsView* getDetailsView ();
189
void emitAddedFile ( const QString& name );
190
void emitAddedFiles( const QStringList &fileList );
191
void emitRemovedFile ( const QString& name );
192
void emitRemovedFiles( const QStringList &fileList );
194
void parse( SubprojectItem *item );
196
enum AutoProjectView { SubprojectView, DetailsView };
197
void setLastFocusedView( AutoProjectView view );
199
MakefileHandler* makefileHandler();
202
void slotOverviewSelectionChanged( QListViewItem *item );
205
void initOverview ( QWidget* parent );
206
void initDetailview ( QWidget* parent );
209
virtual void focusInEvent( QFocusEvent *e );
213
AutoSubprojectView* m_subprojectView;
214
AutoDetailsView* m_detailView;
217
AutoProjectPart *m_part;
218
SubprojectItem *m_activeSubproject;
219
TargetItem *m_activeTarget;
220
TargetItem *m_choosenTarget;
221
SubprojectItem *m_shownSubproject;
223
AutoProjectView m_lastFocusedView;
225
MakefileHandler *m_makefileHandler;
229
// kate: indent-mode csands; tab-width 4;