michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIRDFDataSource.h" michael@0: #include "nsIWindowMediatorListener.h" michael@0: #include "nsIWindowDataSource.h" michael@0: #include "nsIObserver.h" michael@0: michael@0: #include "nsHashKeys.h" michael@0: #include "nsIRDFService.h" michael@0: #include "nsIRDFContainer.h" michael@0: #include "nsInterfaceHashtable.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: michael@0: // {C744CA3D-840B-460a-8D70-7CE63C51C958} michael@0: #define NS_WINDOWDATASOURCE_CID \ michael@0: { 0xc744ca3d, 0x840b, 0x460a, \ michael@0: { 0x8d, 0x70, 0x7c, 0xe6, 0x3c, 0x51, 0xc9, 0x58 } } michael@0: michael@0: michael@0: class nsWindowDataSource : public nsIRDFDataSource, michael@0: public nsIObserver, michael@0: public nsIWindowMediatorListener, michael@0: public nsIWindowDataSource michael@0: { michael@0: public: michael@0: nsWindowDataSource() { } michael@0: virtual ~nsWindowDataSource(); michael@0: michael@0: nsresult Init(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowDataSource, michael@0: nsIRDFDataSource) michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_NSIWINDOWMEDIATORLISTENER michael@0: NS_DECL_NSIWINDOWDATASOURCE michael@0: NS_DECL_NSIRDFDATASOURCE michael@0: michael@0: private: michael@0: michael@0: // mapping of window -> RDF resource michael@0: nsInterfaceHashtable, nsIRDFResource> mWindowResources; michael@0: michael@0: static uint32_t windowCount; michael@0: static uint32_t gRefCnt; michael@0: michael@0: nsCOMPtr mInner; michael@0: nsCOMPtr mContainer; michael@0: michael@0: static nsIRDFResource* kNC_Name; michael@0: static nsIRDFResource* kNC_KeyIndex; michael@0: static nsIRDFResource* kNC_WindowRoot; michael@0: static nsIRDFService* gRDFService; michael@0: };