Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsStyleSides Class Reference

Class that represents a set of top/right/bottom/left nsStyleCoords. More...

#include <nsStyleCoord.h>

Collaboration diagram for nsStyleSides:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsStyleSides (void)
PRBool operator== (const nsStyleSides &aOther) const
PRBool operator!= (const nsStyleSides &aOther) const
nsStyleUnit GetUnit (PRUint8 aSide) const
nsStyleUnit GetLeftUnit (void) const
nsStyleUnit GetTopUnit (void) const
nsStyleUnit GetRightUnit (void) const
nsStyleUnit GetBottomUnit (void) const
nsStyleCoordGet (PRUint8 aSide, nsStyleCoord &aCoord) const
nsStyleCoordGetLeft (nsStyleCoord &aCoord) const
nsStyleCoordGetTop (nsStyleCoord &aCoord) const
nsStyleCoordGetRight (nsStyleCoord &aCoord) const
nsStyleCoordGetBottom (nsStyleCoord &aCoord) const
void Reset (void)
void Set (PRUint8 aSide, const nsStyleCoord &aCoord)
void SetLeft (const nsStyleCoord &aCoord)
void SetTop (const nsStyleCoord &aCoord)
void SetRight (const nsStyleCoord &aCoord)
void SetBottom (const nsStyleCoord &aCoord)
void AppendToString (nsString &aBuffer) const
void ToString (nsString &aBuffer) const

Protected Attributes

PRUint8 mUnits [4]
nsStyleUnion mValues [4]

Detailed Description

Class that represents a set of top/right/bottom/left nsStyleCoords.

This is commonly used to hold the widths of the borders, margins, or paddings of a box.

Definition at line 114 of file nsStyleCoord.h.


Constructor & Destructor Documentation

Definition at line 231 of file nsStyleCoord.cpp.

{
  memset(this, 0x00, sizeof(nsStyleSides));
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 267 of file nsStyleCoord.cpp.

{
  nsStyleCoord  temp;

  GetLeft(temp);
  aBuffer.AppendLiteral("left: ");
  temp.AppendToString(aBuffer);

  GetTop(temp);
  aBuffer.AppendLiteral("top: ");
  temp.AppendToString(aBuffer);

  GetRight(temp);
  aBuffer.AppendLiteral("right: ");
  temp.AppendToString(aBuffer);

  GetBottom(temp);
  aBuffer.AppendLiteral("bottom: ");
  temp.AppendToString(aBuffer);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleCoord & nsStyleSides::Get ( PRUint8  aSide,
nsStyleCoord aCoord 
) const [inline]

Definition at line 240 of file nsStyleCoord.h.

{
  aCoord.SetUnionValue(mValues[aSide], (nsStyleUnit)mUnits[aSide]);
  return aCoord;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleCoord & nsStyleSides::GetBottom ( nsStyleCoord aCoord) const [inline]

Definition at line 261 of file nsStyleCoord.h.

{
  return Get(NS_SIDE_BOTTOM, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 235 of file nsStyleCoord.h.

{
  return GetUnit(NS_SIDE_BOTTOM);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleCoord & nsStyleSides::GetLeft ( nsStyleCoord aCoord) const [inline]

Definition at line 246 of file nsStyleCoord.h.

{
  return Get(NS_SIDE_LEFT, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 220 of file nsStyleCoord.h.

{
  return GetUnit(NS_SIDE_LEFT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleCoord & nsStyleSides::GetRight ( nsStyleCoord aCoord) const [inline]

Definition at line 256 of file nsStyleCoord.h.

{
  return Get(NS_SIDE_RIGHT, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 230 of file nsStyleCoord.h.

{
  return GetUnit(NS_SIDE_RIGHT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleCoord & nsStyleSides::GetTop ( nsStyleCoord aCoord) const [inline]

Definition at line 251 of file nsStyleCoord.h.

{
  return Get(NS_SIDE_TOP, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 225 of file nsStyleCoord.h.

{
  return GetUnit(NS_SIDE_TOP);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsStyleUnit nsStyleSides::GetUnit ( PRUint8  aSide) const [inline]

Definition at line 215 of file nsStyleCoord.h.

{
  return (nsStyleUnit)mUnits[aSide];
}

Here is the caller graph for this function:

PRBool nsStyleSides::operator!= ( const nsStyleSides aOther) const [inline]

Definition at line 210 of file nsStyleCoord.h.

{
  return PRBool(! ((*this) == aOther));
}
PRBool nsStyleSides::operator== ( const nsStyleSides aOther) const

Definition at line 262 of file nsStyleCoord.cpp.

{
  memset(this, 0x00, sizeof(nsStyleSides));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleSides::Set ( PRUint8  aSide,
const nsStyleCoord aCoord 
) [inline]

Definition at line 266 of file nsStyleCoord.h.

{
  mUnits[aSide] = aCoord.GetUnit();
  aCoord.GetUnionValue(mValues[aSide]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 287 of file nsStyleCoord.h.

{
  Set(NS_SIDE_BOTTOM, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleSides::SetLeft ( const nsStyleCoord aCoord) [inline]

Definition at line 272 of file nsStyleCoord.h.

{
  Set(NS_SIDE_LEFT, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 282 of file nsStyleCoord.h.

{
  Set(NS_SIDE_RIGHT, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleSides::SetTop ( const nsStyleCoord aCoord) [inline]

Definition at line 277 of file nsStyleCoord.h.

{
  Set(NS_SIDE_TOP, aCoord);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleSides::ToString ( nsString aBuffer) const

Definition at line 288 of file nsStyleCoord.cpp.

{
  aBuffer.Truncate();
  AppendToString(aBuffer);
}

Here is the call graph for this function:


Member Data Documentation

PRUint8 nsStyleSides::mUnits[4] [protected]

Definition at line 148 of file nsStyleCoord.h.

Definition at line 149 of file nsStyleCoord.h.


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