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

« back to all changes in this revision

Viewing changes to languages/lib/designer_integration/qtdesignerintegration.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) 2004 by Alexander Dymo                                  *
3
 
 *   adymo@kdevelop.org                                                    *
4
 
 *                                                                         *
5
 
 *   This program is free software; you can redistribute it and/or modify  *
6
 
 *   it under the terms of the GNU Library General Public License as       *
7
 
 *   published by the Free Software Foundation; either version 2 of the    *
8
 
 *   License, or (at your option) any later version.                       *
9
 
 *                                                                         *
10
 
 *   This program is distributed in the hope that it will be useful,       *
11
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 
 *   GNU General Public License for more details.                          *
14
 
 *                                                                         *
15
 
 *   You should have received a copy of the GNU Library General Public     *
16
 
 *   License along with this program; if not, write to the                 *
17
 
 *   Free Software Foundation, Inc.,                                       *
18
 
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 
 ***************************************************************************/
20
 
#ifndef QTDESIGNERINTEGRATION_H
21
 
#define QTDESIGNERINTEGRATION_H
22
 
 
23
 
#include <qmap.h>
24
 
 
25
 
#include <codemodel.h>
26
 
#include "kdevdesignerintegration.h"
27
 
 
28
 
class KDevLanguageSupport;
29
 
class ImplementationWidget;
30
 
 
31
 
/**
32
 
Qt Designer integration base class.
33
 
Contains language-independent implementation part of a @ref KDevDesignerIntegration interface.
34
 
Ready to use in KDevelop language support plugins.
35
 
 
36
 
Subclasses of this class should reimplement only pure virtual functions in the common case.
37
 
*/
38
 
class QtDesignerIntegration : public KDevDesignerIntegration
39
 
{
40
 
Q_OBJECT
41
 
public:
42
 
    QtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl,
43
 
        bool classHasDefinitions, const char* name = 0);
44
 
    virtual ~QtDesignerIntegration();
45
 
 
46
 
public slots:
47
 
    virtual void addFunction(const QString& formName, KInterfaceDesigner::Function function);
48
 
    virtual void editFunction(const QString& formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function);
49
 
    virtual void removeFunction(const QString& formName, KInterfaceDesigner::Function function);
50
 
 
51
 
    virtual void openFunction(const QString &formName, const QString &functionName);
52
 
    
53
 
    virtual void openSource(const QString &formName);
54
 
        
55
 
    virtual void saveSettings(QDomDocument dom, QString path);
56
 
    virtual void loadSettings(QDomDocument dom, QString path);
57
 
 
58
 
    bool selectImplementation(const QString &formName);
59
 
    
60
 
protected:
61
 
    /**Reimplement this to add a function to a class. This means you need to modify
62
 
    the source file and add actual code of a function.*/
63
 
    virtual void addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass) = 0;
64
 
    /**Modifies name to be a name of a implementation file for languages that have
65
 
    separate files for interface and implementation parts of a class. For example,
66
 
    C++ language support plugin will do:
67
 
    @code
68
 
    name.replace(".h", ".cpp");
69
 
    @endcode*/
70
 
    virtual void processImplementationName(QString &name);
71
 
    
72
 
    //Form file - derived class name 
73
 
    QMap<QString, ClassDom> m_implementations;
74
 
    
75
 
    KDevLanguageSupport *m_part;
76
 
    ImplementationWidget *m_impl;
77
 
    bool m_classHasDefinitions;
78
 
};
79
 
 
80
 
#endif