Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
nsStyleSheetService Class Reference

#include <nsStyleSheetService.h>

Inheritance diagram for nsStyleSheetService:
Inheritance graph
[legend]
Collaboration diagram for nsStyleSheetService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsStyleSheetService () NS_HIDDEN
 ~nsStyleSheetService () NS_HIDDEN
NS_DECL_ISUPPORTS
NS_DECL_NSISTYLESHEETSERVICE 
NS_HIDDEN_ (nsresult) Init()
nsCOMArray< nsIStyleSheet > * AgentStyleSheets ()
nsCOMArray< nsIStyleSheet > * UserStyleSheets ()
void loadAndRegisterSheet (in nsIURI sheetURI, in unsigned long type)
 Synchronously loads a style sheet from |sheetURI| and adds it to the list of user or agent style sheets.
boolean sheetRegistered (in nsIURI sheetURI, in unsigned long type)
 Returns true if a style sheet at |sheetURI| has previously been added to the list of style sheets specified by |type|.
void unregisterSheet (in nsIURI sheetURI, in unsigned long type)
 Remove the style sheet at |sheetURI| from the list of style sheets specified by |type|.

Public Attributes

const unsigned long AGENT_SHEET = 0
const unsigned long USER_SHEET = 1

Static Public Attributes

static nsStyleSheetServicegInstance = nsnull

Private Member Functions

 NS_HIDDEN_ (void) RegisterFromEnumerator(nsICategoryManager *aManager
 NS_HIDDEN_ (PRInt32) FindSheetByURI(const nsCOMArray< nsIStyleSheet > &sheets

Private Attributes

const char * aCategory
const char nsISimpleEnumeratoraEnumerator
const char nsISimpleEnumerator
PRUint32 
aSheetType
nsIURIsheetURI
nsCOMArray< nsIStyleSheetmSheets [2]

Detailed Description

Definition at line 55 of file nsStyleSheetService.h.


Constructor & Destructor Documentation

Definition at line 55 of file nsStyleSheetService.cpp.

{
  NS_ASSERTION(0 == AGENT_SHEET && 1 == USER_SHEET, "Invalid value for USER_SHEET or AGENT_SHEET");
  NS_ASSERTION(!gInstance, "Someone is using CreateInstance instead of GetService");
  gInstance = this;
}

Definition at line 62 of file nsStyleSheetService.cpp.


Member Function Documentation

Definition at line 66 of file nsStyleSheetService.h.

{ return &mSheets[AGENT_SHEET]; }
void nsIStyleSheetService::loadAndRegisterSheet ( in nsIURI  sheetURI,
in unsigned long  type 
) [inherited]

Synchronously loads a style sheet from |sheetURI| and adds it to the list of user or agent style sheets.

A user sheet loaded via this API will come before userContent.css and userChrome.css in the cascade (so the rules in it will have lower precedence than rules in those sheets).

An agent sheet loaded via this API will come after ua.css in the cascade (so the rules in it will have higher precedence than rules in ua.css).

The relative ordering of two user or two agent sheets loaded via this API is undefined.

NS_DECL_ISUPPORTS NS_DECL_NSISTYLESHEETSERVICE nsStyleSheetService::NS_HIDDEN_ ( nsresult  )
boolean nsIStyleSheetService::sheetRegistered ( in nsIURI  sheetURI,
in unsigned long  type 
) [inherited]

Returns true if a style sheet at |sheetURI| has previously been added to the list of style sheets specified by |type|.

void nsIStyleSheetService::unregisterSheet ( in nsIURI  sheetURI,
in unsigned long  type 
) [inherited]

Remove the style sheet at |sheetURI| from the list of style sheets specified by |type|.

All documents loaded after this call will no longer use the style sheet.

Definition at line 67 of file nsStyleSheetService.h.

{ return &mSheets[USER_SHEET]; }

Member Data Documentation

Definition at line 74 of file nsStyleSheetService.h.

Definition at line 74 of file nsStyleSheetService.h.

const unsigned long nsIStyleSheetService::AGENT_SHEET = 0 [inherited]

Definition at line 51 of file nsIStyleSheetService.idl.

Definition at line 74 of file nsStyleSheetService.h.

Definition at line 69 of file nsStyleSheetService.h.

Definition at line 81 of file nsStyleSheetService.h.

Definition at line 79 of file nsStyleSheetService.h.

const unsigned long nsIStyleSheetService::USER_SHEET = 1 [inherited]

Definition at line 52 of file nsIStyleSheetService.idl.


The documentation for this class was generated from the following files: