Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsStyleContent Struct Reference

#include <nsStyleStruct.h>

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

List of all members.

Public Member Functions

 nsStyleContent (void)
 nsStyleContent (const nsStyleContent &aContent)
 ~nsStyleContent (void)
voidoperator new (size_t sz, nsPresContext *aContext) CPP_THROW_NEW
void Destroy (nsPresContext *aContext)
nsChangeHint CalcDifference (const nsStyleContent &aOther) const
PRUint32 ContentCount (void) const
const nsStyleContentDataContentAt (PRUint32 aIndex) const
nsStyleContentDataContentAt (PRUint32 aIndex)
nsresult AllocateContents (PRUint32 aCount)
PRUint32 CounterIncrementCount (void) const
const nsStyleCounterDataGetCounterIncrementAt (PRUint32 aIndex) const
nsresult AllocateCounterIncrements (PRUint32 aCount)
nsresult SetCounterIncrementAt (PRUint32 aIndex, const nsString &aCounter, PRInt32 aIncrement)
PRUint32 CounterResetCount (void) const
const nsStyleCounterDataGetCounterResetAt (PRUint32 aIndex) const
nsresult AllocateCounterResets (PRUint32 aCount)
nsresult SetCounterResetAt (PRUint32 aIndex, const nsString &aCounter, PRInt32 aValue)

Public Attributes

nsStyleCoord mMarkerOffset

Protected Attributes

PRUint32 mContentCount
nsStyleContentDatamContents
PRUint32 mIncrementCount
nsStyleCounterDatamIncrements
PRUint32 mResetCount
nsStyleCounterDatamResets

Detailed Description

Definition at line 1019 of file nsStyleStruct.h.


Constructor & Destructor Documentation

Definition at line 1375 of file nsStyleStruct.cpp.

   :mMarkerOffset(),
    mContentCount(0),
    mContents(nsnull),
    mIncrementCount(0),
    mIncrements(nsnull),
    mResetCount(0),
    mResets(nsnull)

{
  mMarkerOffset = aSource.mMarkerOffset;

  PRUint32 index;
  if (NS_SUCCEEDED(AllocateContents(aSource.ContentCount()))) {
    for (index = 0; index < mContentCount; index++) {
      ContentAt(index) = aSource.ContentAt(index);
    }
  }

  if (NS_SUCCEEDED(AllocateCounterIncrements(aSource.CounterIncrementCount()))) {
    for (index = 0; index < mIncrementCount; index++) {
      const nsStyleCounterData *data = aSource.GetCounterIncrementAt(index);
      mIncrements[index].mCounter = data->mCounter;
      mIncrements[index].mValue = data->mValue;
    }
  }

  if (NS_SUCCEEDED(AllocateCounterResets(aSource.CounterResetCount()))) {
    for (index = 0; index < mResetCount; index++) {
      const nsStyleCounterData *data = aSource.GetCounterResetAt(index);
      mResets[index].mCounter = data->mCounter;
      mResets[index].mValue = data->mValue;
    }
  }
}

Here is the call graph for this function:

Definition at line 1368 of file nsStyleStruct.cpp.

Here is the caller graph for this function:


Member Function Documentation

Definition at line 1456 of file nsStyleStruct.cpp.

Here is the caller graph for this function:

Definition at line 1059 of file nsStyleStruct.h.

Here is the caller graph for this function:

Definition at line 1089 of file nsStyleStruct.h.

Here is the caller graph for this function:

Definition at line 1411 of file nsStyleStruct.cpp.

{
  if (mContentCount != aOther.mContentCount ||
      mIncrementCount != aOther.mIncrementCount || 
      mResetCount != aOther.mResetCount) {
    return NS_STYLE_HINT_FRAMECHANGE;
  }

  PRUint32 ix = mContentCount;
  while (0 < ix--) {
    if (mContents[ix] != aOther.mContents[ix]) {
      // Unfortunately we need to reframe here; a simple reflow
      // will not pick up different text or different image URLs,
      // since we set all that up in the CSSFrameConstructor
      return NS_STYLE_HINT_FRAMECHANGE;
    }
  }
  ix = mIncrementCount;
  while (0 < ix--) {
    if ((mIncrements[ix].mValue != aOther.mIncrements[ix].mValue) || 
        (mIncrements[ix].mCounter != aOther.mIncrements[ix].mCounter)) {
      return NS_STYLE_HINT_FRAMECHANGE;
    }
  }
  ix = mResetCount;
  while (0 < ix--) {
    if ((mResets[ix].mValue != aOther.mResets[ix].mValue) || 
        (mResets[ix].mCounter != aOther.mResets[ix].mCounter)) {
      return NS_STYLE_HINT_FRAMECHANGE;
    }
  }
  if (mMarkerOffset != aOther.mMarkerOffset) {
    return NS_STYLE_HINT_REFLOW;
  }
  return NS_STYLE_HINT_NONE;
}

Definition at line 1041 of file nsStyleStruct.h.

                                                             {
    NS_ASSERTION(aIndex < mContentCount, "out of range");
    return mContents[aIndex];
  }

Here is the caller graph for this function:

Definition at line 1046 of file nsStyleStruct.h.

                                                 {
    NS_ASSERTION(aIndex < mContentCount, "out of range");
    return mContents[aIndex];
  }

Definition at line 1039 of file nsStyleStruct.h.

{ return mContentCount; } // [reset]

Here is the caller graph for this function:

Definition at line 1053 of file nsStyleStruct.h.

{ return mIncrementCount; }  // [reset]

Here is the caller graph for this function:

Definition at line 1083 of file nsStyleStruct.h.

{ return mResetCount; }  // [reset]

Here is the caller graph for this function:

void nsStyleContent::Destroy ( nsPresContext aContext) [inline]

Definition at line 1029 of file nsStyleStruct.h.

                                        {
    this->~nsStyleContent();
    aContext->FreeToShell(sizeof(nsStyleContent), this);
  };

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1054 of file nsStyleStruct.h.

                                                                         {
    NS_ASSERTION(aIndex < mIncrementCount, "out of range");
    return &mIncrements[aIndex];
  }

Here is the caller graph for this function:

Definition at line 1084 of file nsStyleStruct.h.

                                                                     {
    NS_ASSERTION(aIndex < mResetCount, "out of range");
    return &mResets[aIndex];
  }

Here is the caller graph for this function:

void* nsStyleContent::operator new ( size_t  sz,
nsPresContext aContext 
) [inline]

Definition at line 1026 of file nsStyleStruct.h.

                                                                       {
    return aContext->AllocateFromShell(sz);
  }
nsresult nsStyleContent::SetCounterIncrementAt ( PRUint32  aIndex,
const nsString aCounter,
PRInt32  aIncrement 
) [inline]

Definition at line 1074 of file nsStyleStruct.h.

                                                                                                 {
    if (aIndex < mIncrementCount) {
      mIncrements[aIndex].mCounter = aCounter;
      mIncrements[aIndex].mValue = aIncrement;
      return NS_OK;
    }
    return NS_ERROR_ILLEGAL_VALUE;
  }

Here is the caller graph for this function:

nsresult nsStyleContent::SetCounterResetAt ( PRUint32  aIndex,
const nsString aCounter,
PRInt32  aValue 
) [inline]

Definition at line 1104 of file nsStyleStruct.h.

                                                                                         {
    if (aIndex < mResetCount) {
      mResets[aIndex].mCounter = aCounter;
      mResets[aIndex].mValue = aValue;
      return NS_OK;
    }
    return NS_ERROR_ILLEGAL_VALUE;
  }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1116 of file nsStyleStruct.h.

Definition at line 1117 of file nsStyleStruct.h.

Definition at line 1119 of file nsStyleStruct.h.

Definition at line 1120 of file nsStyleStruct.h.

Definition at line 1113 of file nsStyleStruct.h.

Definition at line 1122 of file nsStyleStruct.h.

Definition at line 1123 of file nsStyleStruct.h.


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