summaryrefslogtreecommitdiffstats
path: root/parts/doxygen/doxygenpart.h
blob: 49fb87e8e994371d405a2667297dd84e4866187d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/***************************************************************************
 *   Copyright (C) 2001 by Bernd Gehrmann                                  *
 *   [email protected]                                                    *
 *   Copyright (C) 2004 by Jonas Jacobi                                    *
 *   [email protected]                                                   *
 *                                                                         *
 *   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 _DOXYGENPART_H_
#define _DOXYGENPART_H_

#include <qguardedptr.h>
#include <kdialogbase.h>
#include <kprocess.h>
#include <ktempdir.h>
#include <qstring.h>

#include "kdevplugin.h"

class DoxygenDialog;
class QPopupMenu;
class Context;
class KAction;
class KDialogBase;
class ConfigWidgetProxy;

namespace KParts{
    class Part;
}
namespace KTextEditor{
    class ViewCursorInterface;
    class EditInterface;
}

class DoxygenPart : public KDevPlugin
{
    Q_OBJECT

public:
    DoxygenPart( QObject *parent, const char *name, const QStringList & );
    ~DoxygenPart();

private slots:
    /**
     * Configuration dialog under "Project Options..." that alows
     * to specify doxygen configuration options and store them to
     * a configuration file. The file name is "Doxyfile" and it's stored
     * in the project root.
     */
//    void projectConfigWidget(KDialogBase *dlg);
	void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );

    /** run doxygen to generate API documentation */
    void slotDoxygen();

    /** clean the html API docs (delete the generated html files) */
    void slotDoxClean();

    /**
     * Gets called, when the Doxygen process for previewing is finished
     * and shows its output then.
     */
    void slotPreviewProcessExited();

    /**
      * If the current part is KTextEditor::Document, run Doxygen over it.
      * When the process exited slotPreviewProcessExited gets called.
      */
    void slotRunPreview();

    /**
     * Gets called when the currently active part changed.
     *  When the new part is a KTextEditor::Document the filepath gets
     * internally stored and gets processed if slotRunPreview() is called.
     * @see KTextEditor::Document
     */
    void slotActivePartChanged(KParts::Part*);

    /**
     * Inserts a documentation template above a function declaration/definition.
     */
    void slotDocumentFunction();


private:

    /**
     * If a Doxygen configuration file doesn't exist, create one.
     * And copy some of the project settings to it.
     */
    void adjustDoxyfile();

    DoxygenDialog *m_dialog;
	ConfigWidgetProxy * _configProxy;

    //needed for doxygen preview
    QString m_file;
    KTempDir m_tmpDir;
    KAction* m_action;

    //needed for documentFunction
    KAction* m_actionDocumentFunction;
    KAction* m_actionPreview;
    KTextEditor::EditInterface* m_activeEditor;
    KTextEditor::ViewCursorInterface* m_cursor;
};

#endif