~ubuntu-branches/ubuntu/utopic/kdevelop-php/utopic

« back to all changes in this revision

Viewing changes to duchain/classmethoddeclaration.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2010-01-17 17:10:22 UTC
  • Revision ID: james.westby@ubuntu.com-20100117171022-q2xlgd9ekewo2ijx
Tags: upstream-1.0.0~beta2
ImportĀ upstreamĀ versionĀ 1.0.0~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   This file is part of KDevelop                                         *
 
3
 *   Copyright 2008 Milian Wolff <mail@milianw.de>                         *
 
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
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 
19
 ***************************************************************************/
 
20
 
 
21
#ifndef CLASSMETHODDECLARATION_H
 
22
#define CLASSMETHODDECLARATION_H
 
23
 
 
24
#include <language/duchain/classfunctiondeclaration.h>
 
25
 
 
26
#include <language/duchain/declaration.h>
 
27
#include <language/duchain/declarationdata.h>
 
28
#include <language/duchain/indexedstring.h>
 
29
 
 
30
#include "phpduchainexport.h"
 
31
 
 
32
namespace Php
 
33
{
 
34
 
 
35
class KDEVPHPDUCHAIN_EXPORT ClassMethodDeclarationData : public KDevelop::ClassFunctionDeclarationData
 
36
{
 
37
public:
 
38
    ClassMethodDeclarationData()
 
39
            : KDevelop::ClassFunctionDeclarationData() {}
 
40
 
 
41
    ClassMethodDeclarationData(const ClassMethodDeclarationData& rhs)
 
42
            : KDevelop::ClassFunctionDeclarationData(rhs)
 
43
    {
 
44
        prettyName = rhs.prettyName;
 
45
    }
 
46
 
 
47
    ~ClassMethodDeclarationData() {}
 
48
 
 
49
    KDevelop::IndexedString prettyName;
 
50
};
 
51
 
 
52
/**
 
53
 * inherits ClassFunctionDeclaration to overwrite some stuff for PHP specific behaviour
 
54
 */
 
55
class KDEVPHPDUCHAIN_EXPORT ClassMethodDeclaration : public KDevelop::ClassFunctionDeclaration
 
56
{
 
57
public:
 
58
    ClassMethodDeclaration(const ClassMethodDeclaration &rhs);
 
59
    ClassMethodDeclaration(const KDevelop::SimpleRange &range, KDevelop::DUContext *context);
 
60
    ClassMethodDeclaration(ClassMethodDeclarationData &data);
 
61
    ClassMethodDeclaration(ClassMethodDeclarationData &data, const KDevelop::SimpleRange &range, KDevelop::DUContext *context);
 
62
    ~ClassMethodDeclaration();
 
63
 
 
64
    /// overwritten to check for __construct() method
 
65
    virtual bool isConstructor() const;
 
66
    /// overwritten to check for __destruct() method
 
67
    virtual bool isDestructor() const;
 
68
 
 
69
    virtual QString toString() const;
 
70
 
 
71
    void setPrettyName(const QString& name);
 
72
    QString prettyName() const;
 
73
 
 
74
    enum {
 
75
        Identity = 84
 
76
    };
 
77
 
 
78
    virtual KDevelop::Declaration* clonePrivate() const;
 
79
private:
 
80
    DUCHAIN_DECLARE_DATA(ClassMethodDeclaration)
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif // CLASSMETHODDECLARATION_H
 
86