1999-12-01 11:44:43 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
2000-03-21 13:42:22 +03:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
1999-12-01 11:44:43 +03:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsIRDFService;
|
|
|
|
class nsIRDFDataSource;
|
|
|
|
class nsIRDFResource;
|
2000-05-19 00:27:37 +04:00
|
|
|
class nsIRDFNode;
|
1999-12-01 11:44:43 +03:00
|
|
|
class nsICSSLoader;
|
|
|
|
class nsISimpleEnumerator;
|
|
|
|
class nsSupportsHashtable;
|
|
|
|
class nsIRDFContainer;
|
2000-03-22 04:30:04 +03:00
|
|
|
class nsIRDFContainerUtils;
|
1999-12-01 11:44:43 +03:00
|
|
|
class nsIDOMWindow;
|
|
|
|
class nsIDocument;
|
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
#include "nsIRDFCompositeDataSource.h"
|
2000-04-29 03:34:12 +04:00
|
|
|
#include "nsICSSStyleSheet.h"
|
2000-03-21 13:42:22 +03:00
|
|
|
|
1999-12-01 11:44:43 +03:00
|
|
|
class nsChromeRegistry : public nsIChromeRegistry
|
|
|
|
{
|
|
|
|
public:
|
2000-03-21 13:42:22 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIChromeRegistry methods:
|
|
|
|
NS_DECL_NSICHROMEREGISTRY
|
|
|
|
|
|
|
|
// nsChromeRegistry methods:
|
|
|
|
nsChromeRegistry();
|
|
|
|
virtual ~nsChromeRegistry();
|
1999-12-01 11:44:43 +03:00
|
|
|
|
|
|
|
public:
|
2000-03-21 13:42:22 +03:00
|
|
|
static nsresult FollowArc(nsIRDFDataSource *aDataSource,
|
|
|
|
nsCString& aResult, nsIRDFResource* aChromeResource,
|
|
|
|
nsIRDFResource* aProperty);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
static nsresult UpdateArc(nsIRDFDataSource *aDataSource, nsIRDFResource* aSource, nsIRDFResource* aProperty,
|
|
|
|
nsIRDFNode *aTarget, PRBool aRemove);
|
|
|
|
|
1999-12-01 11:44:43 +03:00
|
|
|
protected:
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD GetDynamicDataSource(nsIURI *aChromeURL, PRBool aIsOverlay, PRBool aUseProfile, nsIRDFDataSource **aResult);
|
|
|
|
NS_IMETHOD GetDynamicInfo(nsIURI *aChromeURL, PRBool aIsOverlay, nsISimpleEnumerator **aResult);
|
|
|
|
|
|
|
|
nsresult GetResource(const nsCString& aChromeType, nsIRDFResource** aResult);
|
2000-04-29 03:34:12 +04:00
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD UpdateDynamicDataSource(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource,
|
|
|
|
PRBool aIsOverlay, PRBool aUseProfile, PRBool aRemove);
|
|
|
|
NS_IMETHOD UpdateDynamicDataSources(nsIRDFDataSource *aDataSource, PRBool aIsOverlay,
|
|
|
|
PRBool aUseProfile, PRBool aRemove);
|
|
|
|
NS_IMETHOD WriteInfoToDataSource(char *aDocURI, const PRUnichar *aOverlayURI,
|
|
|
|
PRBool aIsOverlay, PRBool aUseProfile, PRBool aRemove);
|
|
|
|
|
2000-04-29 03:34:12 +04:00
|
|
|
void LoadStyleSheet(nsICSSStyleSheet** aSheet, const nsCString & aURL);
|
|
|
|
void GetUserSheetURL(nsCString & aURL);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
|
|
|
private:
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD LoadDataSource(const nsCString &aFileName, nsIRDFDataSource **aResult,
|
2000-03-21 13:42:22 +03:00
|
|
|
PRBool aUseProfileDirOnly = PR_FALSE);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD GetProfileRoot(nsCString& aFileURL);
|
|
|
|
NS_IMETHOD GetInstallRoot(nsCString& aFileURL);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
NS_IMETHOD RefreshWindow(nsIDOMWindow* aWindow);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
NS_IMETHOD ProcessStyleSheet(nsIURL* aURL, nsICSSLoader* aLoader, nsIDocument* aDocument);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
NS_IMETHOD GetArcs(nsIRDFDataSource* aDataSource,
|
2000-05-19 00:27:37 +04:00
|
|
|
const nsCString& aType,
|
2000-03-21 13:42:22 +03:00
|
|
|
nsISimpleEnumerator** aResult);
|
1999-12-01 11:44:43 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
NS_IMETHOD AddToCompositeDataSource(PRBool aUseProfile);
|
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD GetBaseURL(const nsCString& aPackage, const nsCString& aProvider,
|
|
|
|
nsCString& aBaseURL);
|
2000-03-21 13:42:22 +03:00
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD FindProvider(const nsCString& aPackage,
|
|
|
|
const nsCString& aProvider,
|
2000-05-14 01:42:56 +04:00
|
|
|
nsIRDFResource *aArc,
|
|
|
|
nsIRDFNode **aSelectedProvider);
|
|
|
|
|
|
|
|
NS_IMETHOD SelectPackageInProvider(nsIRDFResource *aPackageList,
|
2000-05-19 00:27:37 +04:00
|
|
|
const nsCString& aPackage,
|
|
|
|
const nsCString& aProvider,
|
|
|
|
const nsCString& aProviderName,
|
2000-05-14 01:42:56 +04:00
|
|
|
nsIRDFResource *aArc,
|
|
|
|
nsIRDFNode **aSelectedProvider);
|
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD SetProvider(const nsCString& aProvider,
|
2000-03-21 13:42:22 +03:00
|
|
|
nsIRDFResource* aSelectionArc,
|
|
|
|
const PRUnichar* aProviderName,
|
|
|
|
PRBool aAllUsers, PRBool aIsAdding);
|
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD SetProviderForPackage(const nsCString& aProvider,
|
2000-03-21 13:42:22 +03:00
|
|
|
nsIRDFResource* aPackageResource,
|
|
|
|
nsIRDFResource* aProviderPackageResource,
|
|
|
|
nsIRDFResource* aSelectionArc,
|
|
|
|
PRBool aAllUsers, PRBool aIsAdding);
|
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD SelectProviderForPackage(const nsCString& aProviderType,
|
2000-03-21 14:01:58 +03:00
|
|
|
const PRUnichar *aProviderName,
|
|
|
|
const PRUnichar *aPackageName,
|
|
|
|
nsIRDFResource* aSelectionArc,
|
|
|
|
PRBool aUseProfile, PRBool aIsAdding);
|
|
|
|
|
2000-05-19 00:27:37 +04:00
|
|
|
NS_IMETHOD InstallProvider(const nsCString& aProviderType,
|
|
|
|
const nsCString& aBaseURL,
|
|
|
|
PRBool aUseProfile, PRBool aRemove);
|
2000-03-22 04:30:04 +03:00
|
|
|
|
2000-05-14 01:42:56 +04:00
|
|
|
void ProcessNewChromeBuffer(char *aBuffer, PRInt32 aLength);
|
2000-03-21 14:01:58 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
protected:
|
|
|
|
PRBool mInstallInitialized;
|
|
|
|
PRBool mProfileInitialized;
|
2000-05-19 00:27:37 +04:00
|
|
|
nsCString mProfileRoot;
|
|
|
|
nsCString mInstallRoot;
|
2000-03-21 13:42:22 +03:00
|
|
|
|
|
|
|
nsCOMPtr<nsIRDFCompositeDataSource> mChromeDataSource;
|
2000-03-21 15:43:25 +03:00
|
|
|
nsIRDFDataSource* mUIDataSource; // [WEAK] Composite holds on to us.
|
2000-03-21 14:57:39 +03:00
|
|
|
|
2000-03-21 13:42:22 +03:00
|
|
|
nsSupportsHashtable* mDataSourceTable;
|
|
|
|
nsIRDFService* mRDFService;
|
2000-03-22 04:30:04 +03:00
|
|
|
nsIRDFContainerUtils* mRDFContainerUtils;
|
2000-03-21 13:42:22 +03:00
|
|
|
|
|
|
|
// Resources
|
|
|
|
nsCOMPtr<nsIRDFResource> mSelectedSkin;
|
|
|
|
nsCOMPtr<nsIRDFResource> mSelectedLocale;
|
|
|
|
nsCOMPtr<nsIRDFResource> mBaseURL;
|
|
|
|
nsCOMPtr<nsIRDFResource> mPackages;
|
|
|
|
nsCOMPtr<nsIRDFResource> mPackage;
|
2000-05-14 01:42:56 +04:00
|
|
|
nsCOMPtr<nsIRDFResource> mName;
|
2000-05-19 00:27:37 +04:00
|
|
|
nsCOMPtr<nsIRDFResource> mLocType;
|
2000-04-29 03:34:12 +04:00
|
|
|
|
|
|
|
// Style Sheets
|
|
|
|
nsCOMPtr<nsICSSStyleSheet> mScrollbarSheet;
|
|
|
|
nsCOMPtr<nsICSSStyleSheet> mUserSheet;
|
1999-12-01 11:44:43 +03:00
|
|
|
};
|