gecko-dev/chrome/src/nsChromeRegistry.h

139 lines
4.9 KiB
C
Raw Normal View History

1999-12-01 08:44:43 +00: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.
*
*
* Original Author: David W. Hyatt (hyatt@netscape.com)
1999-12-01 08:44:43 +00:00
*
* Contributor(s):
*/
class nsIRDFService;
class nsIRDFDataSource;
class nsIRDFResource;
class nsICSSLoader;
class nsISimpleEnumerator;
class nsSupportsHashtable;
class nsIRDFContainer;
2000-03-22 01:30:04 +00:00
class nsIRDFContainerUtils;
1999-12-01 08:44:43 +00:00
class nsIDOMWindow;
class nsIDocument;
#include "nsIRDFCompositeDataSource.h"
#include "nsICSSStyleSheet.h"
1999-12-01 08:44:43 +00:00
class nsChromeRegistry : public nsIChromeRegistry
{
public:
NS_DECL_ISUPPORTS
// nsIChromeRegistry methods:
NS_DECL_NSICHROMEREGISTRY
// nsChromeRegistry methods:
nsChromeRegistry();
virtual ~nsChromeRegistry();
1999-12-01 08:44:43 +00:00
public:
static nsresult FollowArc(nsIRDFDataSource *aDataSource,
nsCString& aResult, nsIRDFResource* aChromeResource,
nsIRDFResource* aProperty);
1999-12-01 08:44:43 +00:00
protected:
NS_IMETHOD GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFDataSource **aResult);
nsresult GetResource(const nsCAutoString& aChromeType, nsIRDFResource** aResult);
NS_IMETHOD RemoveOverlay(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource);
NS_IMETHOD RemoveOverlays(nsAutoString aPackage,
nsAutoString aProvider,
nsIRDFContainer *aContainer,
nsIRDFDataSource *aDataSource);
void LoadStyleSheet(nsICSSStyleSheet** aSheet, const nsCString & aURL);
void GetUserSheetURL(nsCString & aURL);
1999-12-01 08:44:43 +00:00
private:
NS_IMETHOD ReallyRemoveOverlayFromDataSource(const PRUnichar *aDocURI, char *aOverlayURI);
NS_IMETHOD LoadDataSource(const nsCAutoString &aFileName, nsIRDFDataSource **aResult,
PRBool aUseProfileDirOnly = PR_FALSE);
1999-12-01 08:44:43 +00:00
NS_IMETHOD GetProfileRoot(nsCAutoString& aFileURL);
NS_IMETHOD GetInstallRoot(nsCAutoString& aFileURL);
1999-12-01 08:44:43 +00:00
NS_IMETHOD RefreshWindow(nsIDOMWindow* aWindow);
1999-12-01 08:44:43 +00:00
NS_IMETHOD ProcessStyleSheet(nsIURL* aURL, nsICSSLoader* aLoader, nsIDocument* aDocument);
1999-12-01 08:44:43 +00:00
NS_IMETHOD GetArcs(nsIRDFDataSource* aDataSource,
const nsCAutoString& aType,
nsISimpleEnumerator** aResult);
1999-12-01 08:44:43 +00:00
NS_IMETHOD AddToCompositeDataSource(PRBool aUseProfile);
NS_IMETHOD GetBaseURL(const nsCAutoString& aPackage, const nsCAutoString& aProvider,
nsCAutoString& aBaseURL);
NS_IMETHOD SetProvider(const nsCAutoString& aProvider,
nsIRDFResource* aSelectionArc,
const PRUnichar* aProviderName,
PRBool aAllUsers, PRBool aIsAdding);
NS_IMETHOD SetProviderForPackage(const nsCAutoString& aProvider,
nsIRDFResource* aPackageResource,
nsIRDFResource* aProviderPackageResource,
nsIRDFResource* aSelectionArc,
PRBool aAllUsers, PRBool aIsAdding);
NS_IMETHOD SelectProviderForPackage(const nsCAutoString& aProviderType,
const PRUnichar *aProviderName,
const PRUnichar *aPackageName,
nsIRDFResource* aSelectionArc,
PRBool aUseProfile, PRBool aIsAdding);
2000-03-22 01:30:04 +00:00
NS_IMETHOD InstallProvider(const nsCAutoString& aProviderType,
const nsCAutoString& aBaseURL,
PRBool aUseProfile);
protected:
PRBool mInstallInitialized;
PRBool mProfileInitialized;
nsCAutoString mProfileRoot;
nsCAutoString mInstallRoot;
nsCOMPtr<nsIRDFCompositeDataSource> mChromeDataSource;
nsIRDFDataSource* mUIDataSource; // [WEAK] Composite holds on to us.
nsSupportsHashtable* mDataSourceTable;
nsIRDFService* mRDFService;
2000-03-22 01:30:04 +00:00
nsIRDFContainerUtils* mRDFContainerUtils;
// Resources
nsCOMPtr<nsIRDFResource> mSelectedSkin;
nsCOMPtr<nsIRDFResource> mSelectedLocale;
nsCOMPtr<nsIRDFResource> mBaseURL;
nsCOMPtr<nsIRDFResource> mPackages;
nsCOMPtr<nsIRDFResource> mPackage;
// Style Sheets
nsCOMPtr<nsICSSStyleSheet> mScrollbarSheet;
nsCOMPtr<nsICSSStyleSheet> mUserSheet;
1999-12-01 08:44:43 +00:00
};