language/duchain
duchainutils.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DUCHAINUTILS_H
00024 #define DUCHAINUTILS_H
00025
00026 #include <KDE/KIcon>
00027
00028 #include <ktexteditor/codecompletionmodel.h>
00029
00030 #include "../languageexport.h"
00031
00032 class KUrl;
00033
00034 namespace KDevelop {
00035
00036 class Declaration;
00037 class DUChainBase;
00038 class DUContext;
00039 class SimpleCursor;
00040 class HashedString;
00041 class TopDUContext;
00042 class IndexedDUContext;
00043 class IndexedDeclaration;
00044
00048 namespace DUChainUtils {
00049 KDEVPLATFORMLANGUAGE_EXPORT KTextEditor::CodeCompletionModel::CompletionProperties completionProperties(const Declaration* dec);
00050 KDEVPLATFORMLANGUAGE_EXPORT QIcon iconForProperties(KTextEditor::CodeCompletionModel::CompletionProperties p);
00051 KDEVPLATFORMLANGUAGE_EXPORT QIcon iconForDeclaration(const Declaration* dec);
00054 KDEVPLATFORMLANGUAGE_EXPORT KDevelop::TopDUContext* standardContextForUrl(const KUrl& url);
00057 KDEVPLATFORMLANGUAGE_EXPORT Declaration* itemUnderCursor(const KUrl& url, const SimpleCursor& cursor);
00060 KDEVPLATFORMLANGUAGE_EXPORT Declaration* declarationForDefinition(Declaration* definition, TopDUContext* topContext = 0);
00062 KDEVPLATFORMLANGUAGE_EXPORT Declaration* declarationInLine(const KDevelop::SimpleCursor& cursor, KDevelop::DUContext* ctx);
00063
00064 class KDEVPLATFORMLANGUAGE_EXPORT DUChainItemFilter {
00065 public:
00066 virtual bool accept(Declaration* decl) = 0;
00067
00068 virtual bool accept(DUContext* ctx) = 0;
00069 virtual ~DUChainItemFilter();
00070 };
00073 KDEVPLATFORMLANGUAGE_EXPORT void collectItems( DUContext* context, DUChainItemFilter& filter );
00074
00075 KDEVPLATFORMLANGUAGE_EXPORT DUContext* getArgumentContext(Declaration* decl);
00076
00079 KDEVPLATFORMLANGUAGE_EXPORT QList<IndexedDeclaration> collectAllVersions(Declaration* decl);
00080
00086 KDEVPLATFORMLANGUAGE_EXPORT QList<Declaration*> getInheriters(const Declaration* decl, uint& maxAllowedSteps, bool collectVersions = true);
00087
00090 KDEVPLATFORMLANGUAGE_EXPORT QList<Declaration*> getOverriders(const Declaration* currentClass, const Declaration* overriddenDeclaration, uint& maxAllowedSteps);
00091
00093 KDEVPLATFORMLANGUAGE_EXPORT bool contextHasUse(DUContext* context, Declaration* declaration);
00094
00096 KDEVPLATFORMLANGUAGE_EXPORT uint contextCountUses(DUContext* context, Declaration* declaration);
00097
00099 KDEVPLATFORMLANGUAGE_EXPORT Declaration* getOverridden(const Declaration* decl);
00100
00103 KDEVPLATFORMLANGUAGE_EXPORT DUContext* getFunctionContext(Declaration* decl);
00104 }
00105 }
00106
00107 #endif // DUCHAINUTILS_H