1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpfe/components/windowds/nsWindowDataSource.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsIRDFDataSource.h" 1.10 +#include "nsIWindowMediatorListener.h" 1.11 +#include "nsIWindowDataSource.h" 1.12 +#include "nsIObserver.h" 1.13 + 1.14 +#include "nsHashKeys.h" 1.15 +#include "nsIRDFService.h" 1.16 +#include "nsIRDFContainer.h" 1.17 +#include "nsInterfaceHashtable.h" 1.18 +#include "nsCycleCollectionParticipant.h" 1.19 + 1.20 +// {C744CA3D-840B-460a-8D70-7CE63C51C958} 1.21 +#define NS_WINDOWDATASOURCE_CID \ 1.22 +{ 0xc744ca3d, 0x840b, 0x460a, \ 1.23 + { 0x8d, 0x70, 0x7c, 0xe6, 0x3c, 0x51, 0xc9, 0x58 } } 1.24 + 1.25 + 1.26 +class nsWindowDataSource : public nsIRDFDataSource, 1.27 + public nsIObserver, 1.28 + public nsIWindowMediatorListener, 1.29 + public nsIWindowDataSource 1.30 +{ 1.31 + public: 1.32 + nsWindowDataSource() { } 1.33 + virtual ~nsWindowDataSource(); 1.34 + 1.35 + nsresult Init(); 1.36 + 1.37 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.38 + NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowDataSource, 1.39 + nsIRDFDataSource) 1.40 + NS_DECL_NSIOBSERVER 1.41 + NS_DECL_NSIWINDOWMEDIATORLISTENER 1.42 + NS_DECL_NSIWINDOWDATASOURCE 1.43 + NS_DECL_NSIRDFDATASOURCE 1.44 + 1.45 + private: 1.46 + 1.47 + // mapping of window -> RDF resource 1.48 + nsInterfaceHashtable<nsPtrHashKey<nsIXULWindow>, nsIRDFResource> mWindowResources; 1.49 + 1.50 + static uint32_t windowCount; 1.51 + static uint32_t gRefCnt; 1.52 + 1.53 + nsCOMPtr<nsIRDFDataSource> mInner; 1.54 + nsCOMPtr<nsIRDFContainer> mContainer; 1.55 + 1.56 + static nsIRDFResource* kNC_Name; 1.57 + static nsIRDFResource* kNC_KeyIndex; 1.58 + static nsIRDFResource* kNC_WindowRoot; 1.59 + static nsIRDFService* gRDFService; 1.60 +};