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

language/duchain

duchain.h

00001 /* This file is part of KDevelop
00002     Copyright 2006-2008 Hamish Rodda <rodda@kde.org>
00003     Copyright 2007-2008 David Nolden <david.nolden.kdevelop@art-master.de>
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 DUCHAIN_H
00021 #define DUCHAIN_H
00022 
00023 #include <QtCore/QObject>
00024 
00025 #include "duchainobserver.h"
00026 #include "topducontext.h"
00027 
00028 class KUrl;
00029 
00030 namespace KDevelop
00031 {
00032 
00033 class IDocument;
00034 class TopDUContext;
00035 class DUChainLock;
00036 
00037 class IdentifiedFile;
00038 class ParsingEnvironmentManager;
00039 class ParsingEnvironment;
00040 class ParsingEnvironmentFile;
00041 typedef KSharedPtr<ParsingEnvironmentFile> ParsingEnvironmentFilePointer;
00042 class Definitions;
00043 class Uses;
00044 
00055 class KDEVPLATFORMLANGUAGE_EXPORT DUChain : public QObject
00056 {
00057   Q_OBJECT
00058 
00059 public:
00063   Q_SCRIPTABLE QList<TopDUContext*> allChains() const;
00064 
00079    Q_SCRIPTABLE void updateContextForUrl(const IndexedString& document, TopDUContext::Features minFeatures, QObject* notifyReady = 0) const;
00080   
00091    KDevelop::ReferencedTopDUContext waitForUpdate(const IndexedString& document, TopDUContext::Features minFeatures, bool wantProxyContext = false);
00092    
00098   Q_SCRIPTABLE TopDUContext* chainForDocument(const KUrl& document) const;
00099   Q_SCRIPTABLE TopDUContext* chainForDocument(const IndexedString& document) const;
00100 
00105   Q_SCRIPTABLE QList<TopDUContext*> chainsForDocument(const KUrl& document) const;
00106 
00112   Q_SCRIPTABLE QList<TopDUContext*> chainsForDocument(const IndexedString& document) const;
00113 
00119   Q_SCRIPTABLE TopDUContext* chainForDocument(const KUrl& document, const ParsingEnvironment* environment, bool onlyProxyContexts = false, bool noProxyContexts = false) const;
00120 
00128   Q_SCRIPTABLE TopDUContext* chainForDocument(const IndexedString& document, const ParsingEnvironment* environment, bool onlyProxyContexts = false, bool noProxyContexts = false) const;
00129 
00140   Q_SCRIPTABLE ParsingEnvironmentFilePointer environmentFileForDocument(const IndexedString& document, const ParsingEnvironment* environment, bool onlyProxyContexts = false, bool noProxyContexts = false) const;  
00141 
00142   Q_SCRIPTABLE ParsingEnvironmentFilePointer environmentFileForDocument(IndexedTopDUContext topContext) const;  
00143   
00147   Q_SCRIPTABLE QList<ParsingEnvironmentFilePointer> allEnvironmentFiles(const IndexedString& document);
00148   
00151   Q_SCRIPTABLE TopDUContext* chainForIndex(uint index) const;
00152 
00154   Q_SCRIPTABLE IndexedString urlForIndex(uint index) const;
00155   
00157   Q_SCRIPTABLE QList<KUrl> documents() const;
00158 
00162   Q_SCRIPTABLE void addDocumentChain(TopDUContext* chain);
00163 
00165   Q_SCRIPTABLE static bool deleted();
00166   
00168   Q_SCRIPTABLE static DUChain* self();
00169 
00171   Q_SCRIPTABLE static Definitions* definitions();
00172 
00174   static Uses* uses();
00175 
00186   Q_SCRIPTABLE static DUChainLock* lock();
00187 
00189   Q_SCRIPTABLE static DUChainObserver* notifier();
00190 
00191   // Distribute the notifications
00192   /*static void contextChanged(DUContext* context, DUChainObserver::Modification change, DUChainObserver::Relationship relationship, DUChainBase* relatedObject = 0);
00193   static void declarationChanged(Declaration* declaration, DUChainObserver::Modification change, DUChainObserver::Relationship relationship, DUChainBase* relatedObject = 0);
00194   static void definitionChanged(Definition* definition, DUChainObserver::Modification change, DUChainObserver::Relationship relationship, DUChainBase* relatedObject = 0);
00195   static void useChanged(Use* use, DUChainObserver::Modification change, DUChainObserver::Relationship relationship, DUChainBase* relatedObject = 0);*/
00196 
00198   Q_SCRIPTABLE static void branchAdded(DUContext* context);
00200   Q_SCRIPTABLE static void branchModified(DUContext* context);
00202   Q_SCRIPTABLE static void branchRemoved(DUContext* context);
00203 
00205   Q_SCRIPTABLE bool isInMemory(uint topContextIndex) const;
00206   
00210   Q_SCRIPTABLE void updateContextEnvironment( TopDUContext* context, ParsingEnvironmentFile* file );
00211 
00213   static uint newTopContextIndex();
00214   
00217   void disablePersistentStorage();
00218   
00221   void storeToDisk();
00222   
00227   bool compareToDisk();
00228   
00235   void finalCleanup();
00236   
00237 Q_SIGNALS:
00239   void declarationSelected(DeclarationPointer decl);
00240 public Q_SLOTS:
00242   void removeDocumentChain(TopDUContext* document);
00244   void emitDeclarationSelected(DeclarationPointer decl);
00245 
00246 private Q_SLOTS:
00247   void documentActivated(KDevelop::IDocument* doc);
00248   void documentAboutToBeDeleted(KTextEditor::Document* doc);
00249   void documentAboutToBeDeletedFinal(KTextEditor::Document* doc);
00250   void documentLoadedPrepare(KDevelop::IDocument* document);
00251   void documentRenamed(KDevelop::IDocument* document);
00252   void aboutToQuit();
00253 private:
00257   void refCountUp(TopDUContext* top);
00258 
00261   void refCountDown(TopDUContext* top);
00262   
00263   void addToEnvironmentManager( TopDUContext * chain );
00264   void removeFromEnvironmentManager( TopDUContext * chain );
00265   DUChain();
00266   ~DUChain();
00267 
00268   friend class DUChainPrivate;
00269   friend class ReferencedTopDUContext;
00270 };
00271 
00272 }
00273 
00274 #endif // DUCHAIN_H
00275 
00276 // kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on

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