• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

language/duchain

classdeclaration.h

00001 /* This file is part of KDevelop
00002     Copyright 2008 David Nolden <david.nolden@kdevelop.org>
00003     Copyright 2009 Lior Mualem <lior.m.kde@gmail.com>
00004     
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef CLASSDECLARATION_H
00021 #define CLASSDECLARATION_H
00022 
00023 #include <language/duchain/declaration.h>
00024 #include <language/duchain/declarationdata.h>
00025 #include <language/duchain/types/structuretype.h>
00026 #include <language/duchain/classmemberdeclarationdata.h>
00027 #include <language/duchain/classmemberdeclaration.h>
00028 
00029 namespace KDevelop {
00030   class QualifiedIdentifier;
00031   class DUContext;
00032   class TopDUContext;
00033   class HashedString;
00034   class SimpleRange;
00035 }
00036 
00037 namespace KDevelop {
00038 
00039 struct KDEVPLATFORMLANGUAGE_EXPORT BaseClassInstance
00040 {
00041   KDevelop::IndexedType baseClass; //May either be StructureType, or DelayedType
00042   KDevelop::Declaration::AccessPolicy access;
00043   bool virtualInheritance;
00044 };
00045 
00046 KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(ClassDeclarationData, baseClasses, BaseClassInstance)
00047 
00048 class KDEVPLATFORMLANGUAGE_EXPORT ClassDeclarationData : public KDevelop::ClassMemberDeclarationData
00049 {
00050 public:
00051   enum ClassType {
00052     Class,
00053     Struct,
00054     Union,
00055     Interface
00056   };
00057   
00058   enum ClassModifier {
00059     Final,
00060     Abstract,
00061     None
00062   };
00063   
00064   ClassDeclarationData() : m_classType(Class), m_classModifier(None) {
00065     initializeAppendedLists();
00066   }
00067 
00068   ~ClassDeclarationData() {
00069     freeAppendedLists();
00070   }
00071 
00072   ClassDeclarationData(const ClassDeclarationData& rhs) : KDevelop::ClassMemberDeclarationData(rhs) {
00073     initializeAppendedLists();
00074     copyListsFrom(rhs);
00075     m_classType = rhs.m_classType;
00076     m_classModifier = rhs.m_classModifier;
00077   }
00078   
00080   ClassType m_classType;
00082   ClassModifier m_classModifier;
00083 
00084   START_APPENDED_LISTS_BASE(ClassDeclarationData, KDevelop::ClassMemberDeclarationData);
00085   APPENDED_LIST_FIRST(ClassDeclarationData, BaseClassInstance, baseClasses);
00086   END_APPENDED_LISTS(ClassDeclarationData, baseClasses);
00087 };
00088 
00092 class KDEVPLATFORMLANGUAGE_EXPORT ClassDeclaration : public KDevelop::ClassMemberDeclaration
00093 {
00094 public:
00095   
00096   ClassDeclaration(const ClassDeclaration& rhs);
00097   ClassDeclaration(ClassDeclarationData& data);
00098   ClassDeclaration(const KDevelop::SimpleRange& range, KDevelop::DUContext* context);
00099   ClassDeclaration(ClassDeclarationData& data, const KDevelop::SimpleRange& range, KDevelop::DUContext* context);
00100   ~ClassDeclaration();
00101 
00102   void clearBaseClasses();
00104   uint baseClassesSize() const;
00106   const BaseClassInstance* baseClasses() const;
00107   void addBaseClass(BaseClassInstance klass);
00108   //Replaces the n'th base-class with the given one. The replaced base-class must have existed.
00109   void replaceBaseClass(uint n, BaseClassInstance klass);
00110 
00114   bool isPublicBaseClass( ClassDeclaration* base, const KDevelop::TopDUContext* topContext, int* baseConversionLevels  = 0 ) const;
00115 
00116   QString toString() const;
00117 
00118   void setClassType(ClassDeclarationData::ClassType type);
00119   
00120   ClassDeclarationData::ClassType classType() const;
00121   
00122   void setClassModifier(ClassDeclarationData::ClassModifier modifier);
00123   
00124   ClassDeclarationData::ClassModifier classModifier() const;
00125   
00126   enum {
00127     Identity = 17
00128   };
00129 
00130 private:
00131   virtual KDevelop::Declaration* clonePrivate() const;
00132   DUCHAIN_DECLARE_DATA(ClassDeclaration)
00133 };
00134 
00135 }
00136 
00137 #endif // CLASSDECLARATION_H
00138 

language/duchain

Skip menu "language/duchain"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal