michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * 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: * This Original Code has been modified by IBM Corporation. michael@0: * Modifications made by IBM described herein are michael@0: * Copyright (c) International Business Machines michael@0: * Corporation, 2000 michael@0: * michael@0: * Modifications to Mozilla code or documentation michael@0: * identified per MPL Section 3.3 michael@0: * michael@0: * Date Modified by Description of modification michael@0: * 03/27/2000 IBM Corp. Added PR_CALLBACK for Optlink michael@0: * use in OS2 michael@0: */ michael@0: michael@0: #ifndef nsRDFService_h__ michael@0: #define nsRDFService_h__ michael@0: michael@0: #include "nsIRDFService.h" michael@0: #include "nsWeakReference.h" michael@0: #include "nsIFactory.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "pldhash.h" michael@0: #include "nsString.h" michael@0: michael@0: struct PLHashTable; michael@0: class nsIRDFLiteral; michael@0: class nsIRDFInt; michael@0: class nsIRDFDate; michael@0: class BlobImpl; michael@0: michael@0: class RDFServiceImpl : public nsIRDFService, michael@0: public nsSupportsWeakReference michael@0: { michael@0: protected: michael@0: PLHashTable* mNamedDataSources; michael@0: PLDHashTable mResources; michael@0: PLDHashTable mLiterals; michael@0: PLDHashTable mInts; michael@0: PLDHashTable mDates; michael@0: PLDHashTable mBlobs; michael@0: michael@0: nsAutoCString mLastURIPrefix; michael@0: nsCOMPtr mLastFactory; michael@0: nsCOMPtr mDefaultResourceFactory; michael@0: michael@0: RDFServiceImpl(); michael@0: nsresult Init(); michael@0: virtual ~RDFServiceImpl(); michael@0: michael@0: public: michael@0: static RDFServiceImpl *gRDFService NS_VISIBILITY_HIDDEN; michael@0: static nsresult CreateSingleton(nsISupports* aOuter, michael@0: const nsIID& aIID, void **aResult); michael@0: michael@0: // nsISupports michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: // nsIRDFService michael@0: NS_DECL_NSIRDFSERVICE michael@0: michael@0: // Implementation methods michael@0: nsresult RegisterLiteral(nsIRDFLiteral* aLiteral); michael@0: nsresult UnregisterLiteral(nsIRDFLiteral* aLiteral); michael@0: nsresult RegisterInt(nsIRDFInt* aInt); michael@0: nsresult UnregisterInt(nsIRDFInt* aInt); michael@0: nsresult RegisterDate(nsIRDFDate* aDate); michael@0: nsresult UnregisterDate(nsIRDFDate* aDate); michael@0: nsresult RegisterBlob(BlobImpl* aBlob); michael@0: nsresult UnregisterBlob(BlobImpl* aBlob); michael@0: michael@0: nsresult GetDataSource(const char *aURI, bool aBlock, nsIRDFDataSource **aDataSource ); michael@0: }; michael@0: michael@0: #endif // nsRDFService_h__