~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to buildtools/autotools/autoprojectpart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
*   Copyright (C) 2001-2002 by Bernd Gehrmann                             *
3
 
*   bernd@kdevelop.org                                                    *
4
 
*                                                                         *
5
 
*   Copyright (C) 2002 by Victor R�er                                    *
6
 
*   victor_roeder@gmx.de                                                  *
7
 
*                                                                         *
8
 
*   This program is free software; you can redistribute it and/or modify  *
9
 
*   it under the terms of the GNU General Public License as published by  *
10
 
*   the Free Software Foundation; either version 2 of the License, or     *
11
 
*   (at your option) any later version.                                   *
12
 
*                                                                         *
13
 
***************************************************************************/
14
 
 
15
 
#ifndef _AUTOPROJECTPART_H_
16
 
#define _AUTOPROJECTPART_H_
17
 
 
18
 
#include <qdict.h>
19
 
#include <qguardedptr.h>
20
 
#include <qmap.h>
21
 
#include <qdatetime.h>
22
 
#include <qdir.h>
23
 
#include <kdevgenericfactory.h>
24
 
#include "kdevbuildtool.h"
25
 
 
26
 
class QDomElement;
27
 
class QStringList;
28
 
class KDialogBase;
29
 
class AutoProjectWidget;
30
 
class KSelectAction;
31
 
class TargetItem;
32
 
class ConfigWidgetProxy;
33
 
 
34
 
class AutoProjectPart : public KDevBuildTool
35
 
{
36
 
        Q_OBJECT
37
 
 
38
 
public:
39
 
        AutoProjectPart( QObject *parent, const char *name, const QStringList &args );
40
 
        virtual ~AutoProjectPart();
41
 
 
42
 
        /**
43
 
         * Implementation of the KDevProject interface.
44
 
         */
45
 
        virtual QString projectDirectory() const;
46
 
        virtual QString projectName() const;
47
 
        virtual DomUtil::PairList runEnvironmentVars() const;
48
 
        virtual QString runDirectory() const;
49
 
        virtual QString mainProgram() const;
50
 
        virtual QString debugArguments() const;
51
 
        virtual QString runArguments() const;
52
 
        virtual QString environString() const;
53
 
        virtual QString activeDirectory() const;
54
 
        virtual QStringList allFiles() const;
55
 
        virtual void addFile( const QString &fileName );
56
 
        virtual void addFiles ( const QStringList& fileList );
57
 
        virtual void removeFile( const QString &fileName );
58
 
        virtual void removeFiles ( const QStringList& fileList );
59
 
        virtual QString buildDirectory() const;
60
 
        virtual Options options() const;
61
 
 
62
 
        /**
63
 
         * Implementation of the KDevPlugin interface.
64
 
         */
65
 
        virtual void restorePartialProjectSession ( const QDomElement* el );
66
 
        virtual void savePartialProjectSession ( QDomElement* el );
67
 
 
68
 
        /**
69
 
         * automake specific methods.
70
 
         */
71
 
        QStringList allBuildConfigs() const;
72
 
        QString currentBuildConfig() const;
73
 
        QString topsourceDirectory() const;
74
 
        void startMakeCommand( const QString &dir, const QString &target, bool withKdesu = false );
75
 
        void startSimpleMakeCommand( const QString &dir, const QString &command, bool withKdesu = false );
76
 
        void buildTarget( QString relpath, TargetItem* titem );
77
 
        void executeTarget( const QDir& dir, const TargetItem* titem );
78
 
 
79
 
        void needMakefileCvs();
80
 
        bool isDirty();
81
 
        bool isKDE() const;
82
 
        QStringList distFiles() const;
83
 
        QString getAutoConfFile(const QString& dir);
84
 
 
85
 
protected:
86
 
        /**
87
 
         * Reimplemented from KDevProject. These methods are only
88
 
         * for use by the application core.
89
 
         */
90
 
        virtual void openProject( const QString &dirName, const QString &projectName );
91
 
        virtual void closeProject();
92
 
 
93
 
private slots:
94
 
        //    void projectConfigWidget(KDialogBase *dlg);
95
 
        void slotAddTranslation();
96
 
        void slotBuild();
97
 
        void slotBuildActiveTarget();
98
 
        void slotCompileFile();
99
 
        void slotClean();
100
 
        void slotDistClean();
101
 
        void slotInstall();
102
 
        void slotInstallWithKdesu();
103
 
        void slotMakefilecvs();
104
 
        void slotMakeMessages();
105
 
        void slotConfigure();
106
 
        void slotExecute();
107
 
        void slotExecute2();
108
 
        void slotExecuteTargetAfterBuild( const QString& command );
109
 
        void slotNotExecuteTargetAfterBuildFailed( const QString& command );
110
 
        void slotBuildConfigChanged( const QString &config );
111
 
        void slotBuildConfigAboutToShow();
112
 
        void slotCommandFinished( const QString& command );
113
 
        void slotCommandFailed( const QString& command );
114
 
        //void slotImportExisting();
115
 
        void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
116
 
 
117
 
 
118
 
private:
119
 
        QGuardedPtr<AutoProjectWidget> m_widget;
120
 
        QString m_projectName;
121
 
        QString m_projectPath;
122
 
        KSelectAction *buildConfigAction;
123
 
 
124
 
        QString makeEnvironment() const;
125
 
        void setWantautotools();
126
 
        QString makefileCvsCommand() const;
127
 
        QString configureCommand() const;
128
 
 
129
 
        QMap<QString, QDateTime> m_timestamp;
130
 
        bool m_executeAfterBuild;
131
 
        QString m_buildCommand;
132
 
        bool m_needMakefileCvs;
133
 
        bool m_lastCompilationFailed;
134
 
        bool m_isKDE;
135
 
        QPair<QDir, TargetItem*> m_executeTargetAfterBuild;
136
 
        QString m_runProg;
137
 
 
138
 
        ConfigWidgetProxy * _configProxy;
139
 
 
140
 
        // Enble AutoProjectWidget to emit our signals
141
 
        friend class AutoProjectWidget;
142
 
        friend class AddSubprojectDialog;
143
 
        friend class FileItem;
144
 
 
145
 
        // For make commands queuing
146
 
        QString constructMakeCommandLine( const QString &dir, const QString &target ) const;
147
 
        bool queueInternalLibDependenciesBuild( TargetItem* titem, QStringList& list );
148
 
};
149
 
 
150
 
typedef KDevGenericFactory<AutoProjectPart> AutoProjectFactory;
151
 
 
152
 
#endif
153
 
// kate: indent-mode csands; tab-width 4;