|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 * |
|
7 * This Original Code has been modified by IBM Corporation. |
|
8 * Modifications made by IBM described herein are |
|
9 * Copyright (c) International Business Machines |
|
10 * Corporation, 2000 |
|
11 * |
|
12 * Modifications to Mozilla code or documentation |
|
13 * identified per MPL Section 3.3 |
|
14 * |
|
15 * Date Modified by Description of modification |
|
16 * 03/27/2000 IBM Corp. Added PR_CALLBACK for Optlink |
|
17 * use in OS2 |
|
18 */ |
|
19 |
|
20 #ifndef nsRDFService_h__ |
|
21 #define nsRDFService_h__ |
|
22 |
|
23 #include "nsIRDFService.h" |
|
24 #include "nsWeakReference.h" |
|
25 #include "nsIFactory.h" |
|
26 #include "nsCOMPtr.h" |
|
27 #include "pldhash.h" |
|
28 #include "nsString.h" |
|
29 |
|
30 struct PLHashTable; |
|
31 class nsIRDFLiteral; |
|
32 class nsIRDFInt; |
|
33 class nsIRDFDate; |
|
34 class BlobImpl; |
|
35 |
|
36 class RDFServiceImpl : public nsIRDFService, |
|
37 public nsSupportsWeakReference |
|
38 { |
|
39 protected: |
|
40 PLHashTable* mNamedDataSources; |
|
41 PLDHashTable mResources; |
|
42 PLDHashTable mLiterals; |
|
43 PLDHashTable mInts; |
|
44 PLDHashTable mDates; |
|
45 PLDHashTable mBlobs; |
|
46 |
|
47 nsAutoCString mLastURIPrefix; |
|
48 nsCOMPtr<nsIFactory> mLastFactory; |
|
49 nsCOMPtr<nsIFactory> mDefaultResourceFactory; |
|
50 |
|
51 RDFServiceImpl(); |
|
52 nsresult Init(); |
|
53 virtual ~RDFServiceImpl(); |
|
54 |
|
55 public: |
|
56 static RDFServiceImpl *gRDFService NS_VISIBILITY_HIDDEN; |
|
57 static nsresult CreateSingleton(nsISupports* aOuter, |
|
58 const nsIID& aIID, void **aResult); |
|
59 |
|
60 // nsISupports |
|
61 NS_DECL_ISUPPORTS |
|
62 |
|
63 // nsIRDFService |
|
64 NS_DECL_NSIRDFSERVICE |
|
65 |
|
66 // Implementation methods |
|
67 nsresult RegisterLiteral(nsIRDFLiteral* aLiteral); |
|
68 nsresult UnregisterLiteral(nsIRDFLiteral* aLiteral); |
|
69 nsresult RegisterInt(nsIRDFInt* aInt); |
|
70 nsresult UnregisterInt(nsIRDFInt* aInt); |
|
71 nsresult RegisterDate(nsIRDFDate* aDate); |
|
72 nsresult UnregisterDate(nsIRDFDate* aDate); |
|
73 nsresult RegisterBlob(BlobImpl* aBlob); |
|
74 nsresult UnregisterBlob(BlobImpl* aBlob); |
|
75 |
|
76 nsresult GetDataSource(const char *aURI, bool aBlock, nsIRDFDataSource **aDataSource ); |
|
77 }; |
|
78 |
|
79 #endif // nsRDFService_h__ |