Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / language / duchain / forwarddeclaration.h
blobc022a7233b832b25ec9154552d45b92555e09e38
1 /* This file is part of KDevelop
2 Copyright 2006-2008 Hamish Rodda <rodda@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef FORWARDDECLARATION_H
20 #define FORWARDDECLARATION_H
22 #include "declaration.h"
23 #include "declarationdata.h"
25 namespace KDevelop
27 class KDEVPLATFORMLANGUAGE_EXPORT ForwardDeclarationData : public DeclarationData
29 public:
30 ForwardDeclarationData() {
32 ForwardDeclarationData( const ForwardDeclarationData& rhs )
33 : DeclarationData( rhs )
37 /**
38 * Represents a forward declaration
40 class KDEVPLATFORMLANGUAGE_EXPORT ForwardDeclaration : public Declaration
42 public:
43 /**
44 * Constructor.
46 * If \a context is in the symbol table, the declaration will automatically be added into the symbol table.
48 * \param url url of the document where this occurred
49 * \param range range of the alias declaration's identifier
50 * \param parentContext context in which this declaration occurred
51 * */
52 ForwardDeclaration(const SimpleRange& range, DUContext* context);
53 ForwardDeclaration(ForwardDeclarationData& data);
55 ///Copy-constructor for cloning
56 ForwardDeclaration(const ForwardDeclaration& rhs);
58 /// Destructor.
59 virtual ~ForwardDeclaration();
61 virtual bool isForwardDeclaration() const;
63 /**
64 * Resolved the forward-declaration using the given import-trace.
65 * The topcontext is needed for correct functionality, and may only be
66 * zero when the declaration is resolved starting from the top-context
67 * the forward-declaration is contained in.
69 * If this forward-declaration has a type assigned that is not derived from ForwardDeclarationType,
70 * and that is derived from IdentifiedType, the declaration of that type is returned here.
71 * */
72 virtual Declaration* resolve(const TopDUContext* topContext) const;
74 virtual DUContext * logicalInternalContext(const TopDUContext* topContext) const;
76 virtual QString toString() const;
78 enum {
79 Identity = 10
82 typedef Declaration BaseClass;
84 private:
85 virtual Declaration* clonePrivate() const;
86 DUCHAIN_DECLARE_DATA(ForwardDeclaration)
91 #endif // DECLARATION_H
93 // kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on