KDevelop API Documentation

autoprojectwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002 *   Copyright (C) 2001-2002 by Bernd Gehrmann                             *
00003 *   bernd@kdevelop.org                                                    *
00004 *                                                                         *
00005 *   Copyright (C) 2002 by Victor Rder                                    *
00006 *   victor_roeder@gmx.de                                                  *
00007 *                                                                         *
00008 *   This program is free software; you can redistribute it and/or modify  *
00009 *   it under the terms of the GNU General Public License as published by  *
00010 *   the Free Software Foundation; either version 2 of the License, or     *
00011 *   (at your option) any later version.                                   *
00012 *                                                                         *
00013 ***************************************************************************/
00014 
00015 #ifndef _AUTOPROJECTWIDGET_H_
00016 #define _AUTOPROJECTWIDGET_H_
00017 
00018 #include <qlayout.h>
00019 #include <qdict.h>
00020 #include <qlistview.h>
00021 #include <qmap.h>
00022 #include <qvbox.h>
00023 #include <qhbox.h>
00024 #include <qtoolbutton.h>
00025 #include <kiconloader.h>
00026 #include <klocale.h>
00027 
00028 #include "domutil.h"
00029 
00030 class AutoProjectPart;
00031 class AutoSubprojectView;
00032 class AutoDetailsView;
00033 class SubprojectItem;
00034 class TargetItem;
00035 class FileItem;
00036 class KAction;
00037 class QDomElement;
00038 class QToolButton;
00039 class QStringList;
00040 
00041 
00042 class AutoProjectWidget : public QVBox
00043 {
00044     Q_OBJECT
00045     friend class RemoveFileDialog;
00046     friend class TargetOptionsDialog;  // to access projectDom() via m_part->projectDom()
00047 public:
00048     AutoProjectWidget(AutoProjectPart *part, bool kde);
00049     ~AutoProjectWidget();
00050 
00051     void openProject(const QString &dirName);
00052     void closeProject();
00053 
00057     QStringList allSubprojects();
00061     QPtrList <SubprojectItem> allSubprojectItems();
00065     QStringList allLibraries();
00069     QStringList allFiles();
00073     QString projectDirectory() const;
00077     QString subprojectDirectory();
00081     bool kdeMode() const
00082     { return m_kdeMode; }
00083 
00088     void setActiveTarget(const QString &targetPath);
00093     QString activeDirectory();
00094 
00101     void addFiles(const QStringList &list);
00106     void removeFiles(const QStringList &list);
00107 
00112     TargetItem *selectedTarget();
00113 
00118     FileItem *selectedFile();
00119 
00124     SubprojectItem* selectedSubproject();
00125 
00129     TargetItem *createTargetItem(const QString &name,
00130                      const QString &prefix, const QString &primary, 
00131                      bool take=true );
00135     FileItem *createFileItem(const QString &name, SubprojectItem *subproject);
00136 
00141     SubprojectItem* activeSubproject ();
00142     void setActiveSubproject( SubprojectItem* spitem );
00143 
00148     TargetItem* activeTarget();
00149 
00155         SubprojectItem* subprojectItemForPath(const QString & path, bool pathIsAbsolute=false);
00156 
00160         QString pathForTarget(const TargetItem *item) const;
00161 
00165         void addToTarget(const QString & fileName, SubprojectItem* spitem, TargetItem* titem);
00166 
00170     void restoreSession ( const QDomElement* el );
00171 
00175     void saveSession ( QDomElement* el );
00176     
00177     AutoSubprojectView* getSubprojectView ();
00178     AutoDetailsView* getDetailsView ();
00179         
00180 
00181     void emitAddedFile ( const QString& name );
00182     void emitAddedFiles(const QStringList &fileList);
00183     void emitRemovedFile ( const QString& name );
00184     void emitRemovedFiles(const QStringList &fileList);
00185 
00186     void parse(SubprojectItem *item);
00187  
00188         enum AutoProjectView { SubprojectView, DetailsView };
00189         void setLastFocusedView(AutoProjectView view);
00190 
00191 public slots:
00192     void slotOverviewSelectionChanged(QListViewItem *item);
00193     void slotDetailsSelectionChanged(QListViewItem *item);
00194 
00195 protected:
00196     void initOverview ( QWidget* parent );
00197     void initDetailview ( QWidget* parent );
00198     void initActions ();
00199         
00200         virtual void focusInEvent(QFocusEvent *e);
00201 
00202 private:
00203 
00204     QToolButton *subProjectOptionsButton, *addSubprojectButton, *addExistingSubprojectButton;
00205     QToolButton *addTargetButton, *addServiceButton, *addApplicationButton;
00206     QToolButton *buildSubprojectButton, *targetOptionsButton;
00207     QToolButton *addNewFileButton, *addExistingFileButton;
00208     QToolButton *buildTargetButton, *executeTargetButton, *removeButton;
00209 
00210     AutoSubprojectView* m_subprojectView;
00211     AutoDetailsView* m_detailView;
00212     
00213     bool m_kdeMode;
00214     AutoProjectPart *m_part;
00215     SubprojectItem *m_activeSubproject;
00216     TargetItem *m_activeTarget;
00217     TargetItem *m_choosenTarget;
00218     SubprojectItem *m_shownSubproject;
00219  
00220         AutoProjectView m_lastFocusedView;
00221 };
00222 
00223 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:39 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003