Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | Friends
nsTreeColumn Class Reference

#include <nsTreeColumns.h>

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

List of all members.

Public Member Functions

 nsTreeColumn (nsTreeColumns *aColumns, nsIFrame *aFrame)
 ~nsTreeColumn ()
void getIdConst ([shared] out wstring idConst)
nsITreeColumn getNext ()
nsITreeColumn getPrevious ()
void invalidate ()

Public Attributes

NS_DECL_ISUPPORTS friend class nsTreeBodyFrame
readonly attribute nsIDOMElement element
readonly attribute nsITreeColumns columns
readonly attribute long x
readonly attribute long width
readonly attribute AString id
readonly attribute nsIAtom atom
readonly attribute long index
readonly attribute boolean primary
readonly attribute boolean cycler
readonly attribute boolean editable
const short TYPE_TEXT = 1
const short TYPE_CHECKBOX = 2
const short TYPE_PROGRESSMETER = 3
readonly attribute short type

Protected Member Functions

void CacheAttributes ()
nsIContentGetContent ()
void SetColumns (nsTreeColumns *aColumns)
PRInt32 GetX ()
nscoord GetWidth ()
const nsAString & GetId ()
nsIAtomGetAtom ()
PRInt32 GetIndex ()
PRBool IsPrimary ()
PRBool IsCycler ()
PRBool IsEditable ()
PRInt16 GetType ()
PRInt8 GetCropStyle ()
PRInt32 GetTextAlignment ()
nsTreeColumnGetNext ()
nsTreeColumnGetPrevious ()
void SetNext (nsTreeColumn *aNext)
void SetPrevious (nsTreeColumn *aPrevious)

Private Attributes

nsIFramemFrame
nsTreeColumnsmColumns
nsString mId
nsCOMPtr< nsIAtommAtom
PRInt32 mIndex
PRPackedBool mIsPrimary
PRPackedBool mIsCycler
PRPackedBool mIsEditable
PRInt16 mType
PRInt8 mCropStyle
PRInt8 mTextAlignment
nsTreeColumnmNext
nsTreeColumnmPrevious

Friends

class nsTreeColumns

Detailed Description

Definition at line 52 of file nsTreeColumns.h.


Constructor & Destructor Documentation

nsTreeColumn::nsTreeColumn ( nsTreeColumns aColumns,
nsIFrame aFrame 
)

Definition at line 53 of file nsTreeColumns.cpp.

  : mFrame(aFrame),
    mColumns(aColumns),
    mNext(nsnull),
    mPrevious(nsnull)
{
  CacheAttributes();
}

Here is the call graph for this function:

Definition at line 62 of file nsTreeColumns.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 187 of file nsTreeColumns.cpp.

{
  nsIContent* content = GetContent();

  // Fetch the Id.
  content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, mId);

  // If we have an Id, cache the Id as an atom.
  if (!mId.IsEmpty()) {
    mAtom = do_GetAtom(mId);
  }

  // Cache our index.
  nsTreeUtils::GetColumnIndex(content, &mIndex);

  const nsStyleVisibility* vis = mFrame->GetStyleVisibility();

  // Cache our text alignment policy.
  const nsStyleText* textStyle = mFrame->GetStyleText();

  mTextAlignment = textStyle->mTextAlign;
  if (mTextAlignment == 0 || mTextAlignment == 2) { // Left or Right
    if (vis->mDirection == NS_STYLE_DIRECTION_RTL)
      mTextAlignment = 2 - mTextAlignment; // Right becomes left, left becomes right.
  }

  // Figure out if we're the primary column (that has to have indentation
  // and twisties drawn.
  mIsPrimary = PR_FALSE;
  nsAutoString primary;
  content->GetAttr(kNameSpaceID_None, nsXULAtoms::primary, primary);
  if (primary.EqualsLiteral("true"))
    mIsPrimary = PR_TRUE;

  // Figure out if we're a cycling column (one that doesn't cause a selection
  // to happen).
  mIsCycler = PR_FALSE;
  nsAutoString cycler;
  content->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler);
  if (cycler.EqualsLiteral("true"))
    mIsCycler = PR_TRUE;

  mIsEditable = PR_FALSE;
  nsAutoString editable;
  content->GetAttr(kNameSpaceID_None, nsXULAtoms::editable, editable);
  if (editable.EqualsLiteral("true"))
    mIsEditable = PR_TRUE;

  // Figure out our column type. Default type is text.
  mType = nsITreeColumn::TYPE_TEXT;
  nsAutoString type;
  content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, type);
  if (type.EqualsLiteral("checkbox"))
    mType = nsITreeColumn::TYPE_CHECKBOX;
  else if (type.EqualsLiteral("progressmeter"))
    mType = nsITreeColumn::TYPE_PROGRESSMETER;

  // Fetch the crop style.
  mCropStyle = 0;
  nsAutoString crop;
  content->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, crop);
  if (crop.EqualsLiteral("center"))
    mCropStyle = 1;
  else if (crop.EqualsLiteral("left") ||
           crop.EqualsLiteral("start"))
    mCropStyle = 2;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetAtom ( ) [inline, protected]

Definition at line 74 of file nsTreeColumns.h.

{ return mAtom; };

Here is the caller graph for this function:

nsIContent* nsTreeColumn::GetContent ( ) [inline, protected]

Definition at line 66 of file nsTreeColumns.h.

{ return mFrame->GetContent(); };

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt8 nsTreeColumn::GetCropStyle ( ) [inline, protected]

Definition at line 84 of file nsTreeColumns.h.

{ return mCropStyle; };

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetId ( ) [inline, protected]

Definition at line 73 of file nsTreeColumns.h.

{ return mId; };
void nsITreeColumn::getIdConst ( [shared] out wstring  idConst) [inherited]
NS_IMETHODIMP nsTreeColumn::GetIndex ( ) [inline, protected]

Definition at line 76 of file nsTreeColumns.h.

{ return mIndex; };
NS_IMETHODIMP nsTreeColumn::GetNext ( ) [inline, protected]

Definition at line 87 of file nsTreeColumns.h.

{ return mNext; };

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetPrevious ( ) [inline, protected]

Definition at line 88 of file nsTreeColumns.h.

{ return mPrevious; };

Here is the caller graph for this function:

PRInt32 nsTreeColumn::GetTextAlignment ( ) [inline, protected]

Definition at line 85 of file nsTreeColumns.h.

{ return mTextAlignment; };

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetType ( void  ) [inline, protected]

Definition at line 82 of file nsTreeColumns.h.

{ return mType; };

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetWidth ( ) [inline, protected]

Definition at line 71 of file nsTreeColumns.h.

{ return mFrame->GetRect().width; };

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsTreeColumn::GetX ( ) [inline, protected]

Definition at line 70 of file nsTreeColumns.h.

{ return mFrame->GetRect().x; };

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsTreeColumn::IsCycler ( ) [inline, protected]

Definition at line 79 of file nsTreeColumns.h.

{ return mIsCycler; };

Here is the caller graph for this function:

PRBool nsTreeColumn::IsEditable ( ) [inline, protected]

Definition at line 80 of file nsTreeColumns.h.

{ return mIsEditable; };
PRBool nsTreeColumn::IsPrimary ( ) [inline, protected]

Definition at line 78 of file nsTreeColumns.h.

{ return mIsPrimary; };

Here is the caller graph for this function:

void nsTreeColumn::SetColumns ( nsTreeColumns aColumns) [inline, protected]

Definition at line 68 of file nsTreeColumns.h.

{ mColumns = aColumns; };
void nsTreeColumn::SetNext ( nsTreeColumn aNext) [inline, protected]

Definition at line 89 of file nsTreeColumns.h.

{ NS_IF_ADDREF(mNext = aNext); };

Here is the caller graph for this function:

void nsTreeColumn::SetPrevious ( nsTreeColumn aPrevious) [inline, protected]

Definition at line 90 of file nsTreeColumns.h.

{ mPrevious = aPrevious; };

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class nsTreeColumns [friend]

Definition at line 61 of file nsTreeColumns.h.


Member Data Documentation

readonly attribute nsIAtom nsITreeColumn::atom [inherited]

Definition at line 54 of file nsITreeColumns.idl.

Definition at line 47 of file nsITreeColumns.idl.

readonly attribute boolean nsITreeColumn::cycler [inherited]

Definition at line 59 of file nsITreeColumns.idl.

Definition at line 60 of file nsITreeColumns.idl.

Definition at line 45 of file nsITreeColumns.idl.

readonly attribute AString nsITreeColumn::id [inherited]

Definition at line 52 of file nsITreeColumns.idl.

readonly attribute long nsITreeColumn::index [inherited]

Definition at line 56 of file nsITreeColumns.idl.

Definition at line 98 of file nsTreeColumns.h.

Definition at line 95 of file nsTreeColumns.h.

PRInt8 nsTreeColumn::mCropStyle [private]

Definition at line 108 of file nsTreeColumns.h.

Definition at line 90 of file nsTreeColumns.h.

Definition at line 97 of file nsTreeColumns.h.

Definition at line 100 of file nsTreeColumns.h.

Definition at line 103 of file nsTreeColumns.h.

Definition at line 104 of file nsTreeColumns.h.

Definition at line 102 of file nsTreeColumns.h.

Definition at line 111 of file nsTreeColumns.h.

Definition at line 112 of file nsTreeColumns.h.

PRInt8 nsTreeColumn::mTextAlignment [private]

Definition at line 109 of file nsTreeColumns.h.

Definition at line 106 of file nsTreeColumns.h.

Definition at line 60 of file nsTreeColumns.h.

Definition at line 58 of file nsITreeColumns.idl.

readonly attribute short nsITreeColumn::type [inherited]

Definition at line 65 of file nsITreeColumns.idl.

const short nsITreeColumn::TYPE_CHECKBOX = 2 [inherited]

Definition at line 63 of file nsITreeColumns.idl.

Definition at line 64 of file nsITreeColumns.idl.

const short nsITreeColumn::TYPE_TEXT = 1 [inherited]

Definition at line 62 of file nsITreeColumns.idl.

readonly attribute long nsITreeColumn::width [inherited]

Definition at line 50 of file nsITreeColumns.idl.

readonly attribute long nsITreeColumn::x [inherited]

Definition at line 49 of file nsITreeColumns.idl.


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