Back to index

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

#include <nsStyleStruct.h>

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

List of all members.

Public Member Functions

 nsStyleQuotes ()
 nsStyleQuotes (const nsStyleQuotes &aQuotes)
 ~nsStyleQuotes ()
voidoperator new (size_t sz, nsPresContext *aContext) CPP_THROW_NEW
void Destroy (nsPresContext *aContext)
nsChangeHint CalcDifference (const nsStyleQuotes &aOther) const
PRUint32 QuotesCount (void) const
const nsStringOpenQuoteAt (PRUint32 aIndex) const
const nsStringCloseQuoteAt (PRUint32 aIndex) const
nsresult GetQuotesAt (PRUint32 aIndex, nsString &aOpen, nsString &aClose) const
nsresult AllocateQuotes (PRUint32 aCount)
nsresult SetQuotesAt (PRUint32 aIndex, const nsString &aOpen, const nsString &aClose)

Protected Attributes

PRUint32 mQuotesCount
nsStringmQuotes

Detailed Description

Definition at line 947 of file nsStyleStruct.h.


Constructor & Destructor Documentation

Definition at line 1476 of file nsStyleStruct.cpp.

Definition at line 1487 of file nsStyleStruct.cpp.

  : mQuotesCount(0),
    mQuotes(nsnull)
{
  if (NS_SUCCEEDED(AllocateQuotes(aSource.QuotesCount()))) {
    PRUint32 count = (mQuotesCount * 2);
    for (PRUint32 index = 0; index < count; index += 2) {
      aSource.GetQuotesAt(index, mQuotes[index], mQuotes[index + 1]);
    }
  }
}

Here is the call graph for this function:

Definition at line 1482 of file nsStyleStruct.cpp.

Here is the caller graph for this function:


Member Function Documentation

Definition at line 989 of file nsStyleStruct.h.

                                            {
    if (aCount != mQuotesCount) {
      DELETE_ARRAY_IF(mQuotes);
      if (aCount) {
        mQuotes = new nsString[aCount * 2];
        if (! mQuotes) {
          mQuotesCount = 0;
          return NS_ERROR_OUT_OF_MEMORY;
        }
      }
      mQuotesCount = aCount;
    }
    return NS_OK;
  }

Here is the caller graph for this function:

Definition at line 1499 of file nsStyleStruct.cpp.

{
  // If the quotes implementation is ever going to change we might not need
  // a framechange here and a reflow should be sufficient.  See bug 35768.
  if (mQuotesCount == aOther.mQuotesCount) {
    PRUint32 ix = (mQuotesCount * 2);
    while (0 < ix--) {
      if (mQuotes[ix] != aOther.mQuotes[ix]) {
        return NS_STYLE_HINT_FRAMECHANGE;
      }
    }

    return NS_STYLE_HINT_NONE;
  }
  return NS_STYLE_HINT_FRAMECHANGE;
}
const nsString* nsStyleQuotes::CloseQuoteAt ( PRUint32  aIndex) const [inline]

Definition at line 974 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aIndex < mQuotesCount, "out of range");
    return mQuotes + (aIndex * 2 + 1);
  }

Here is the caller graph for this function:

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

Definition at line 957 of file nsStyleStruct.h.

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

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsStyleQuotes::GetQuotesAt ( PRUint32  aIndex,
nsString aOpen,
nsString aClose 
) const [inline]

Definition at line 979 of file nsStyleStruct.h.

                                                                                  {
    if (aIndex < mQuotesCount) {
      aIndex *= 2;
      aOpen = mQuotes[aIndex];
      aClose = mQuotes[++aIndex];
      return NS_OK;
    }
    return NS_ERROR_ILLEGAL_VALUE;
  }

Here is the caller graph for this function:

const nsString* nsStyleQuotes::OpenQuoteAt ( PRUint32  aIndex) const [inline]

Definition at line 969 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aIndex < mQuotesCount, "out of range");
    return mQuotes + (aIndex * 2);
  }

Here is the caller graph for this function:

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

Definition at line 954 of file nsStyleStruct.h.

                                                                       {
    return aContext->AllocateFromShell(sz);
  }

Definition at line 967 of file nsStyleStruct.h.

{ return mQuotesCount; } // [inherited]

Here is the caller graph for this function:

nsresult nsStyleQuotes::SetQuotesAt ( PRUint32  aIndex,
const nsString aOpen,
const nsString aClose 
) [inline]

Definition at line 1004 of file nsStyleStruct.h.

                                                                                        {
    if (aIndex < mQuotesCount) {
      aIndex *= 2;
      mQuotes[aIndex] = aOpen;
      mQuotes[++aIndex] = aClose;
      return NS_OK;
    }
    return NS_ERROR_ILLEGAL_VALUE;
  }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1016 of file nsStyleStruct.h.

Definition at line 1015 of file nsStyleStruct.h.


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