summaryrefslogtreecommitdiffstats
path: root/lib/interfaces/tdevapi.h
blob: a2e38f7c945716de94359ec93246e3e9614f5c7a (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
/* This file is part of the KDE project
   Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
   Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.org>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/
#ifndef TDEVAPI_H
#define TDEVAPI_H

#include <tqobject.h>

class TQStringList;
class TQDomDocument;
class TDevCore;
class TDevProject;
class TDevLanguageSupport;
class CodeModel;
class TDevPartController;
class TDevMainWindow;
class TDevCodeRepository;
class TDevPlugin;
class TDevPluginController;

/**
@file tdevapi.h
KDevelop API interface.
*/

/**
The interface to KDevelop's core components.
Needs to be implemented in a shell. Developers do not need to use this
class because @ref TDevPlugin already provides API convenience methods.
*/
class TDevApi: public TQObject
{
    Q_OBJECT
  
public:
    /**Constructor.*/
    TDevApi();

    /**Destructor.*/
    virtual ~TDevApi();

    /**@return A reference to the toplevel widget.*/
    virtual TDevMainWindow *mainWindow() const = 0;

    /**@return A reference to the part controller which is used to manipulate loaded KParts.*/
    virtual TDevPartController *partController() const = 0;

    /**@return A reference to the plugin controller which is used to manipulate loaded plugin.*/
    virtual TDevPluginController *pluginController() const = 0;

    /**@return A reference to the application core - an object which provides
    basic functionalities for inter-parts communications / cooperation.*/
    virtual TDevCore *core() const = 0;

    /**@return A reference to the memory symbol store.*/
    virtual CodeModel *codeModel() const = 0;

    /**@return A reference to the DOM tree that represents the project file or 0 if no project is loaded.*/
    TQDomDocument *projectDom() const;

    /**Sets the Document Object Model for the current project.
    @param dom The project DOM.*/
    void setProjectDom(TQDomDocument *dom);

    /**@return A reference to the current project component or 0 if no project is loaded.*/
    TDevProject *project() const;

    /**Sets the current project.
    @param project The project plugin which becames the current project.*/
    void setProject(TDevProject *project);

    /**@return A reference to the language support component or 0 if no support available.*/
    TDevLanguageSupport *languageSupport() const;

    /**Sets the object charged of providing handling for the source files written in particular
    language (languages support component).
    @param languageSupport The language support plugin.*/
    void setLanguageSupport(TDevLanguageSupport *languageSupport);

    /**@return A reference to the code repository (accessor to persistent symbol stores).*/
    TDevCodeRepository *codeRepository() const;

private:
    class Private;
    Private *d;
};

#endif