File indexing completed on 2024-05-05 16:41:08
0001 /* 0002 SPDX-FileCopyrightText: 2014 Heinz Wiesinger <pprkut@liwjatan.at> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef TRAITMETHODALIASDECLARATION_H 0008 #define TRAITMETHODALIASDECLARATION_H 0009 0010 #include "classmethoddeclaration.h" 0011 0012 namespace Php 0013 { 0014 0015 class TraitMethodAliasDeclarationData; 0016 0017 /** 0018 * inherits ClassMethodDeclaration to allow some trait specific functionality 0019 */ 0020 class KDEVPHPDUCHAIN_EXPORT TraitMethodAliasDeclaration : public ClassMethodDeclaration 0021 { 0022 public: 0023 TraitMethodAliasDeclaration(const TraitMethodAliasDeclaration &rhs); 0024 TraitMethodAliasDeclaration(const KDevelop::RangeInRevision &range, KDevelop::DUContext *context); 0025 TraitMethodAliasDeclaration(TraitMethodAliasDeclarationData &data); 0026 TraitMethodAliasDeclaration(TraitMethodAliasDeclarationData &data, const KDevelop::RangeInRevision &range, KDevelop::DUContext *context); 0027 ~TraitMethodAliasDeclaration() override; 0028 0029 QString toString() const override; 0030 0031 /** 0032 * Set the declaration that is aliased by this declaration. 0033 * 0034 * \param decl the declaration that this declaration references 0035 */ 0036 void setAliasedDeclaration(const KDevelop::IndexedDeclaration& decl); 0037 0038 /** 0039 * Access the declaration that is aliased by this declaration. 0040 * 0041 * \returns the aliased declaration 0042 */ 0043 KDevelop::IndexedDeclaration aliasedDeclaration() const; 0044 0045 /** 0046 * Set the identifier for a context that contains a declaration overridden by this one. 0047 * 0048 * \param ids the identifiers of the context that contain an overridden declaration 0049 */ 0050 void setOverrides(const QVector< KDevelop::IndexedQualifiedIdentifier >& ids); 0051 0052 /** 0053 * Check whether a given identifier is registered as containing an overridden declaration 0054 * 0055 * \returns whether a given identifier is registered as containing an overridden declaration 0056 */ 0057 bool isOverriding(const KDevelop::IndexedQualifiedIdentifier& id) const; 0058 0059 enum { 0060 Identity = 131 0061 }; 0062 0063 KDevelop::Declaration* clonePrivate() const override; 0064 private: 0065 DUCHAIN_DECLARE_DATA(TraitMethodAliasDeclaration) 0066 }; 0067 0068 } 0069 0070 #endif // TRAITMETHODALIASDECLARATION_H 0071