Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Protected Attributes
CSSImportRuleImpl Class Reference
Inheritance diagram for CSSImportRuleImpl:
Inheritance graph
[legend]
Collaboration diagram for CSSImportRuleImpl:
Collaboration graph
[legend]

List of all members.

Public Types

enum  {
  UNKNOWN_RULE = 0, STYLE_RULE = 1, IMPORT_RULE = 2, MEDIA_RULE = 3,
  FONT_FACE_RULE = 4, PAGE_RULE = 5, CHARSET_RULE = 6, NAMESPACE_RULE = 7,
  DOCUMENT_RULE = 8
}

Public Member Functions

 CSSImportRuleImpl (nsMediaList *aMedia)
 CSSImportRuleImpl (const CSSImportRuleImpl &aCopy)
virtual ~CSSImportRuleImpl (void)
NS_DECL_ISUPPORTS_INHERITED
DECL_STYLE_RULE_INHERIT
NS_IMETHOD 
GetType (PRInt32 &aType) const
NS_IMETHOD Clone (nsICSSRule *&aClone) const
NS_IMETHOD SetURLSpec (const nsString &aURLSpec)
NS_IMETHOD GetURLSpec (nsString &aURLSpec) const
NS_IMETHOD SetMedia (const nsString &aMedia)
NS_IMETHOD GetMedia (nsString &aMedia) const
NS_IMETHOD SetSheet (nsICSSStyleSheet *)
 NS_IMETHOD_ (nsrefcnt) AddRef()
 NS_IMETHOD_ (nsrefcnt) Release()
NS_IMETHOD GetStyleSheet (nsIStyleSheet *&aSheet) const
NS_IMETHOD SetStyleSheet (nsICSSStyleSheet *aSheet)
NS_IMETHOD SetParentRule (nsICSSGroupRule *aRule)
NS_IMETHOD MapRuleInfoInto (nsRuleData *aRuleData)
NS_IMETHOD GetStyleSheet (nsIStyleSheet *&aSheet) const =0
NS_IMETHOD SetStyleSheet (nsICSSStyleSheet *aSheet)=0
NS_IMETHOD SetParentRule (nsICSSGroupRule *aRule)=0
NS_IMETHOD GetDOMRule (nsIDOMCSSRule **aDOMRule)=0
NS_IMETHOD MapRuleInfoInto (nsRuleData *aRuleData)=0
 |nsIStyleRule::MapRuleInfoInto| is a request to copy all stylistic data represented by the rule that:

Public Attributes

readonly attribute DOMString href
readonly attribute nsIDOMMediaList media
readonly attribute
nsIDOMCSSStyleSheet 
styleSheet
const unsigned short UNKNOWN_RULE = 0
const unsigned short STYLE_RULE = 1
const unsigned short CHARSET_RULE = 2
const unsigned short IMPORT_RULE = 3
const unsigned short MEDIA_RULE = 4
const unsigned short FONT_FACE_RULE = 5
const unsigned short PAGE_RULE = 6
readonly attribute unsigned short type
attribute DOMString cssText
readonly attribute
nsIDOMCSSStyleSheet 
parentStyleSheet
readonly attribute nsIDOMCSSRule parentRule

Protected Attributes

nsString mURLSpec
nsCOMPtr< nsMediaListmMedia
nsCOMPtr< nsICSSStyleSheetmChildSheet
nsAutoRefCnt mRefCnt
nsICSSStyleSheetmSheet
nsICSSGroupRulemParentRule

Detailed Description

Definition at line 339 of file nsCSSRules.cpp.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
UNKNOWN_RULE 
STYLE_RULE 
IMPORT_RULE 
MEDIA_RULE 
FONT_FACE_RULE 
PAGE_RULE 
CHARSET_RULE 
NAMESPACE_RULE 
DOCUMENT_RULE 

Definition at line 55 of file nsICSSRule.h.


Constructor & Destructor Documentation

Definition at line 382 of file nsCSSRules.cpp.

  : nsCSSRule()
  , mURLSpec()
  , mMedia(aMedia)
{
  // XXXbz This is really silly.... the mMedia here will be replaced
  // with itself if we manage to load a sheet.  Which should really
  // never fail nowadays, in sane cases.
}

Here is the caller graph for this function:

Definition at line 392 of file nsCSSRules.cpp.

  : nsCSSRule(aCopy),
    mURLSpec(aCopy.mURLSpec)
{
  nsCOMPtr<nsICSSStyleSheet> sheet;
  if (aCopy.mChildSheet) {
    aCopy.mChildSheet->Clone(nsnull, this, nsnull, nsnull,
                             getter_AddRefs(sheet));
  }
  SetSheet(sheet);
  // SetSheet sets mMedia appropriately
}

Here is the call graph for this function:

Definition at line 405 of file nsCSSRules.cpp.

{
  if (mChildSheet) {
    mChildSheet->SetOwnerRule(nsnull);
  }
}

Member Function Documentation

NS_IMETHODIMP CSSImportRuleImpl::Clone ( nsICSSRule *&  aClone) const [virtual]

Implements nsICSSRule.

Definition at line 456 of file nsCSSRules.cpp.

{
  CSSImportRuleImpl* clone = new CSSImportRuleImpl(*this);
  if (clone) {
    return CallQueryInterface(clone, &aClone);
  }
  aClone = nsnull;
  return NS_ERROR_OUT_OF_MEMORY;
}

Here is the call graph for this function:

NS_IMETHOD nsICSSRule::GetDOMRule ( nsIDOMCSSRule **  aDOMRule) [pure virtual, inherited]

Implemented in CSSStyleRuleImpl.

Here is the caller graph for this function:

NS_IMETHODIMP CSSImportRuleImpl::GetMedia ( nsString aMedia) const [virtual]

Implements nsICSSImportRule.

Definition at line 491 of file nsCSSRules.cpp.

{
  if (mMedia) {
    return mMedia->GetText(aMedia);
  } else {
    aMedia.Truncate();
    return NS_OK;
  }
}
NS_IMETHODIMP nsCSSRule::GetStyleSheet ( nsIStyleSheet *&  aSheet) const [inherited]

Reimplemented in CSSStyleRuleImpl.

Definition at line 64 of file nsCSSRule.cpp.

{
  NS_IF_ADDREF(mSheet);
  aSheet = mSheet;
  return NS_OK;
}
NS_IMETHOD nsICSSRule::GetStyleSheet ( nsIStyleSheet *&  aSheet) const [pure virtual, inherited]

Implemented in CSSStyleRuleImpl.

Here is the caller graph for this function:

NS_IMETHODIMP CSSImportRuleImpl::GetType ( PRInt32 aType) const [virtual]

Implements nsICSSRule.

Definition at line 449 of file nsCSSRules.cpp.

{
  aType = nsICSSRule::IMPORT_RULE;
  return NS_OK;
}
NS_IMETHODIMP CSSImportRuleImpl::GetURLSpec ( nsString aURLSpec) const [virtual]

Implements nsICSSImportRule.

Definition at line 474 of file nsCSSRules.cpp.

{
  aURLSpec = mURLSpec;
  return NS_OK;
}
NS_IMETHODIMP nsCSSRule::MapRuleInfoInto ( nsRuleData aRuleData) [inherited]

Reimplemented in CSSStyleRuleImpl.

Definition at line 92 of file nsCSSRule.cpp.

{
  // The nsIStyleRule contract is not appropriate for all CSS rules.
  NS_NOTREACHED("nsCSSRule::MapRuleInfoInto");
  return NS_OK;
}
NS_IMETHOD nsIStyleRule::MapRuleInfoInto ( nsRuleData aRuleData) [pure virtual, inherited]

|nsIStyleRule::MapRuleInfoInto| is a request to copy all stylistic data represented by the rule that:

  • are relevant for |aRuleData->mSID| (the style struct ID)
  • are not already filled into the data struct into the appropriate data struct in |aRuleData|. It is important that only empty data are filled in, since the rule tree is walked from highest priority rule to least, so that the walk can stop if all needed data are found. Thus overwriting non-empty data will break CSS cascading rules.

Implemented in CSSStyleRuleImpl, CSSImportantRule, nsHTMLStyleSheet::TableUngroupedColRule, nsHTMLStyleSheet::TableColRule, nsHTMLStyleSheet::TableColgroupRule, nsHTMLStyleSheet::TableRowRule, nsHTMLStyleSheet::TableTbodyRule, nsHTMLStyleSheet::TableTHRule, nsHTMLStyleSheet::GenericTableRule, nsHTMLStyleSheet::HTMLColorRule, CSSFirstLetterRule, nsMappedAttributes, CSSFirstLineRule, and BodyRule.

Here is the caller graph for this function:

nsCSSRule::NS_IMETHOD_ ( nsrefcnt  ) [inherited]
nsCSSRule::NS_IMETHOD_ ( nsrefcnt  ) [inherited]

Implements nsICSSImportRule.

Definition at line 481 of file nsCSSRules.cpp.

{
  if (mMedia) {
    return mMedia->SetText(aMedia);
  } else {
    return NS_OK;
  }
}

Reimplemented in CSSStyleRuleImpl.

Definition at line 82 of file nsCSSRule.cpp.

{
  // We don't reference count this up reference. The group rule
  // will tell us when it's going away or when we're detached from
  // it.
  mParentRule = aRule;
  return NS_OK;
}
NS_IMETHOD nsICSSRule::SetParentRule ( nsICSSGroupRule aRule) [pure virtual, inherited]

Implemented in CSSStyleRuleImpl.

Here is the caller graph for this function:

Implements nsICSSImportRule.

Definition at line 502 of file nsCSSRules.cpp.

{
  nsresult rv;
  NS_ENSURE_ARG_POINTER(aSheet);
  
  // set the new sheet
  mChildSheet = aSheet;
  aSheet->SetOwnerRule(this);

  // set our medialist to be the same as the sheet's medialist
  nsCOMPtr<nsIDOMStyleSheet> sheet(do_QueryInterface(mChildSheet, &rv));
  NS_ENSURE_SUCCESS(rv, rv);
  nsCOMPtr<nsIDOMMediaList> mediaList;
  rv = sheet->GetMedia(getter_AddRefs(mediaList));
  NS_ENSURE_SUCCESS(rv, rv);
  mMedia = do_QueryInterface(mediaList);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in CSSStyleRuleImpl, and nsCSSMediaRule.

Definition at line 72 of file nsCSSRule.cpp.

{
  // We don't reference count this up reference. The style sheet
  // will tell us when it's going away or when we're detached from
  // it.
  mSheet = aSheet;
  return NS_OK;
}

Here is the caller graph for this function:

NS_IMETHOD nsICSSRule::SetStyleSheet ( nsICSSStyleSheet aSheet) [pure virtual, inherited]

Implemented in CSSStyleRuleImpl, and nsCSSMediaRule.

Here is the caller graph for this function:

Implements nsICSSImportRule.

Definition at line 467 of file nsCSSRules.cpp.

{
  mURLSpec = aURLSpec;
  return NS_OK;
}

Here is the caller graph for this function:


Member Data Documentation

const unsigned short nsIDOMCSSRule::CHARSET_RULE = 2 [inherited]

Definition at line 58 of file nsIDOMCSSRule.idl.

attribute DOMString nsIDOMCSSRule::cssText [inherited]

Definition at line 65 of file nsIDOMCSSRule.idl.

const unsigned short nsIDOMCSSRule::FONT_FACE_RULE = 5 [inherited]

Definition at line 61 of file nsIDOMCSSRule.idl.

readonly attribute DOMString nsIDOMCSSImportRule::href [inherited]

Definition at line 45 of file nsIDOMCSSImportRule.idl.

const unsigned short nsIDOMCSSRule::IMPORT_RULE = 3 [inherited]

Definition at line 59 of file nsIDOMCSSRule.idl.

Definition at line 379 of file nsCSSRules.cpp.

Definition at line 46 of file nsIDOMCSSImportRule.idl.

const unsigned short nsIDOMCSSRule::MEDIA_RULE = 4 [inherited]

Definition at line 60 of file nsIDOMCSSRule.idl.

Definition at line 378 of file nsCSSRules.cpp.

nsICSSGroupRule* nsCSSRule::mParentRule [protected, inherited]

Definition at line 73 of file nsCSSRule.h.

nsAutoRefCnt nsCSSRule::mRefCnt [protected, inherited]

Definition at line 58 of file nsCSSRule.h.

nsICSSStyleSheet* nsCSSRule::mSheet [protected, inherited]

Definition at line 72 of file nsCSSRule.h.

Definition at line 377 of file nsCSSRules.cpp.

const unsigned short nsIDOMCSSRule::PAGE_RULE = 6 [inherited]

Definition at line 62 of file nsIDOMCSSRule.idl.

Definition at line 69 of file nsIDOMCSSRule.idl.

Definition at line 68 of file nsIDOMCSSRule.idl.

const unsigned short nsIDOMCSSRule::STYLE_RULE = 1 [inherited]

Definition at line 57 of file nsIDOMCSSRule.idl.

Definition at line 47 of file nsIDOMCSSImportRule.idl.

readonly attribute unsigned short nsIDOMCSSRule::type [inherited]

Definition at line 64 of file nsIDOMCSSRule.idl.

const unsigned short nsIDOMCSSRule::UNKNOWN_RULE = 0 [inherited]

Definition at line 56 of file nsIDOMCSSRule.idl.


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