2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-02-02 22:34:52 +00:00
|
|
|
|
2008-10-28 04:47:19 +00:00
|
|
|
#ifndef nsTreeBodyFrame_h
|
|
|
|
#define nsTreeBodyFrame_h
|
|
|
|
|
2011-11-21 06:21:16 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2001-02-02 22:34:52 +00:00
|
|
|
#include "nsLeafBoxFrame.h"
|
2002-03-29 02:46:01 +00:00
|
|
|
#include "nsITreeView.h"
|
2001-02-06 02:22:31 +00:00
|
|
|
#include "nsICSSPseudoComparator.h"
|
2001-02-09 12:12:53 +00:00
|
|
|
#include "nsIScrollbarMediator.h"
|
2001-12-11 06:55:21 +00:00
|
|
|
#include "nsITimer.h"
|
2002-07-19 22:36:46 +00:00
|
|
|
#include "nsIReflowCallback.h"
|
2008-01-01 01:31:16 +00:00
|
|
|
#include "nsTArray.h"
|
2004-04-17 05:53:38 +00:00
|
|
|
#include "nsTreeStyleCache.h"
|
|
|
|
#include "nsTreeColumns.h"
|
|
|
|
#include "nsAutoPtr.h"
|
2006-01-30 18:57:38 +00:00
|
|
|
#include "nsDataHashtable.h"
|
2006-01-30 20:49:02 +00:00
|
|
|
#include "imgIRequest.h"
|
2012-10-12 16:11:22 +00:00
|
|
|
#include "imgINotificationObserver.h"
|
2011-07-11 14:05:09 +00:00
|
|
|
#include "nsScrollbarFrame.h"
|
2007-06-14 08:37:21 +00:00
|
|
|
#include "nsThreadUtils.h"
|
2011-09-09 02:27:13 +00:00
|
|
|
#include "mozilla/LookAndFeel.h"
|
2013-05-02 14:58:00 +00:00
|
|
|
#include "nsIScrollbarOwner.h"
|
2006-01-30 18:57:38 +00:00
|
|
|
|
2008-12-03 11:11:34 +00:00
|
|
|
class nsOverflowChecker;
|
2011-11-09 21:39:16 +00:00
|
|
|
class nsTreeImageListener;
|
2008-12-03 11:11:34 +00:00
|
|
|
|
2013-05-02 14:58:00 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layout {
|
|
|
|
class ScrollbarActivity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-30 18:57:38 +00:00
|
|
|
// An entry in the tree's image cache
|
|
|
|
struct nsTreeImageCacheEntry
|
|
|
|
{
|
2006-01-30 19:35:57 +00:00
|
|
|
nsTreeImageCacheEntry() {}
|
2012-10-12 16:11:22 +00:00
|
|
|
nsTreeImageCacheEntry(imgIRequest *aRequest, imgINotificationObserver *aListener)
|
2006-01-30 19:34:51 +00:00
|
|
|
: request(aRequest), listener(aListener) {}
|
|
|
|
|
2006-01-30 18:57:38 +00:00
|
|
|
nsCOMPtr<imgIRequest> request;
|
2012-10-12 16:11:22 +00:00
|
|
|
nsCOMPtr<imgINotificationObserver> listener;
|
2006-01-30 18:57:38 +00:00
|
|
|
};
|
2001-03-24 01:50:33 +00:00
|
|
|
|
2001-02-05 02:01:24 +00:00
|
|
|
// The actual frame that paints the cells and rows.
|
2011-11-21 06:21:16 +00:00
|
|
|
class nsTreeBodyFrame MOZ_FINAL
|
2008-10-28 04:47:19 +00:00
|
|
|
: public nsLeafBoxFrame
|
|
|
|
, public nsICSSPseudoComparator
|
|
|
|
, public nsIScrollbarMediator
|
|
|
|
, public nsIReflowCallback
|
2013-05-02 14:58:00 +00:00
|
|
|
, public nsIScrollbarOwner
|
2001-02-02 22:34:52 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-05-02 14:58:00 +00:00
|
|
|
typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
|
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsTreeBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2008-10-28 04:47:19 +00:00
|
|
|
~nsTreeBodyFrame();
|
|
|
|
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsTreeBodyFrame)
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2008-10-28 04:47:19 +00:00
|
|
|
|
2011-11-09 21:39:16 +00:00
|
|
|
// Callback handler methods for refresh driver based animations.
|
|
|
|
// Calls to these functions are forwarded from nsTreeImageListener. These
|
|
|
|
// mirror how nsImageFrame works.
|
|
|
|
nsresult OnImageIsAnimated(imgIRequest* aRequest);
|
|
|
|
|
2008-10-28 04:47:19 +00:00
|
|
|
// non-virtual signatures like nsITreeBodyFrame
|
2012-11-18 12:40:17 +00:00
|
|
|
already_AddRefed<nsTreeColumns> Columns() const
|
|
|
|
{
|
|
|
|
nsRefPtr<nsTreeColumns> cols = mColumns;
|
|
|
|
return cols.forget();
|
|
|
|
}
|
|
|
|
already_AddRefed<nsITreeView> GetExistingView() const
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsITreeView> view = mView;
|
|
|
|
return view.forget();
|
|
|
|
}
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult GetView(nsITreeView **aView);
|
|
|
|
nsresult SetView(nsITreeView *aView);
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult GetFocused(bool *aFocused);
|
|
|
|
nsresult SetFocused(bool aFocused);
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult GetTreeBody(nsIDOMElement **aElement);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetRowHeight(int32_t *aValue);
|
|
|
|
nsresult GetRowWidth(int32_t *aValue);
|
|
|
|
nsresult GetHorizontalPosition(int32_t *aValue);
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult GetSelectionRegion(nsIScriptableRegion **aRegion);
|
2012-11-18 12:40:17 +00:00
|
|
|
int32_t FirstVisibleRow() const { return mTopRowIndex; }
|
|
|
|
int32_t LastVisibleRow() const { return mTopRowIndex + mPageLength; }
|
|
|
|
int32_t PageLength() const { return mPageLength; }
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult EnsureRowIsVisible(int32_t aRow);
|
|
|
|
nsresult EnsureCellIsVisible(int32_t aRow, nsITreeColumn *aCol);
|
|
|
|
nsresult ScrollToRow(int32_t aRow);
|
|
|
|
nsresult ScrollByLines(int32_t aNumLines);
|
|
|
|
nsresult ScrollByPages(int32_t aNumPages);
|
|
|
|
nsresult ScrollToCell(int32_t aRow, nsITreeColumn *aCol);
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult ScrollToColumn(nsITreeColumn *aCol);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult ScrollToHorizontalPosition(int32_t aValue);
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult Invalidate();
|
|
|
|
nsresult InvalidateColumn(nsITreeColumn *aCol);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult InvalidateRow(int32_t aRow);
|
|
|
|
nsresult InvalidateCell(int32_t aRow, nsITreeColumn *aCol);
|
|
|
|
nsresult InvalidateRange(int32_t aStart, int32_t aEnd);
|
|
|
|
nsresult InvalidateColumnRange(int32_t aStart, int32_t aEnd,
|
2008-10-28 04:47:19 +00:00
|
|
|
nsITreeColumn *aCol);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetRowAt(int32_t aX, int32_t aY, int32_t *aValue);
|
|
|
|
nsresult GetCellAt(int32_t aX, int32_t aY, int32_t *aRow,
|
2008-10-28 04:47:19 +00:00
|
|
|
nsITreeColumn **aCol, nsACString &aChildElt);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetCoordsForCellItem(int32_t aRow, nsITreeColumn *aCol,
|
2008-10-28 04:47:19 +00:00
|
|
|
const nsACString &aElt,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t *aX, int32_t *aY,
|
|
|
|
int32_t *aWidth, int32_t *aHeight);
|
|
|
|
nsresult IsCellCropped(int32_t aRow, nsITreeColumn *aCol, bool *aResult);
|
|
|
|
nsresult RowCountChanged(int32_t aIndex, int32_t aCount);
|
2008-10-28 04:47:19 +00:00
|
|
|
nsresult BeginUpdateBatch();
|
|
|
|
nsresult EndUpdateBatch();
|
|
|
|
nsresult ClearStyleAndImageCaches();
|
2001-02-02 22:34:52 +00:00
|
|
|
|
2013-07-13 03:19:37 +00:00
|
|
|
void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth);
|
|
|
|
|
2013-05-14 16:33:23 +00:00
|
|
|
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
|
2007-02-22 18:05:14 +00:00
|
|
|
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
|
2013-05-14 16:33:23 +00:00
|
|
|
bool aRemoveOverflowArea = false) MOZ_OVERRIDE;
|
2002-01-05 07:17:10 +00:00
|
|
|
|
2002-07-19 22:36:46 +00:00
|
|
|
// nsIReflowCallback
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual bool ReflowFinished() MOZ_OVERRIDE;
|
|
|
|
virtual void ReflowCallbackCanceled() MOZ_OVERRIDE;
|
2002-07-19 22:36:46 +00:00
|
|
|
|
2001-02-06 02:22:31 +00:00
|
|
|
// nsICSSPseudoComparator
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual bool PseudoMatches(nsCSSSelector* aSelector) MOZ_OVERRIDE;
|
2001-02-06 02:22:31 +00:00
|
|
|
|
2001-02-09 12:12:53 +00:00
|
|
|
// nsIScrollbarMediator
|
2013-05-14 16:33:23 +00:00
|
|
|
NS_IMETHOD PositionChanged(nsScrollbarFrame* aScrollbar, int32_t aOldIndex, int32_t& aNewIndex) MOZ_OVERRIDE;
|
2012-09-14 16:10:08 +00:00
|
|
|
NS_IMETHOD ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, int32_t aOldIndex, int32_t aNewIndex) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD VisibilityChanged(bool aVisible) MOZ_OVERRIDE { Invalidate(); return NS_OK; }
|
2001-02-09 12:12:53 +00:00
|
|
|
|
2013-05-02 14:58:00 +00:00
|
|
|
// nsIScrollbarOwner
|
|
|
|
virtual nsIFrame* GetScrollbarBox(bool aVertical) MOZ_OVERRIDE {
|
|
|
|
ScrollParts parts = GetScrollParts();
|
|
|
|
return aVertical ? parts.mVScrollbar : parts.mHScrollbar;
|
|
|
|
}
|
|
|
|
|
2001-02-09 09:48:33 +00:00
|
|
|
// Overridden from nsIFrame to cache our pres context.
|
2014-05-24 22:20:40 +00:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2013-05-14 16:33:23 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
2006-04-10 00:16:29 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult GetCursor(const nsPoint& aPoint,
|
2014-02-18 08:36:33 +00:00
|
|
|
nsIFrame::Cursor& aCursor) MOZ_OVERRIDE;
|
2004-04-17 05:53:38 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
2014-02-18 08:36:33 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2001-02-09 09:48:33 +00:00
|
|
|
|
2013-02-14 11:12:27 +00:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2007-01-09 19:59:38 +00:00
|
|
|
|
2013-05-14 16:33:23 +00:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;
|
2007-07-25 17:14:13 +00:00
|
|
|
|
2007-01-09 19:59:38 +00:00
|
|
|
friend nsIFrame* NS_NewTreeBodyFrame(nsIPresShell* aPresShell);
|
2007-08-23 12:27:50 +00:00
|
|
|
friend class nsTreeColumn;
|
2007-01-09 19:59:38 +00:00
|
|
|
|
|
|
|
struct ScrollParts {
|
2011-07-11 14:05:09 +00:00
|
|
|
nsScrollbarFrame* mVScrollbar;
|
2009-08-19 11:34:06 +00:00
|
|
|
nsCOMPtr<nsIContent> mVScrollbarContent;
|
2011-07-11 14:05:09 +00:00
|
|
|
nsScrollbarFrame* mHScrollbar;
|
2009-08-19 11:34:06 +00:00
|
|
|
nsCOMPtr<nsIContent> mHScrollbarContent;
|
|
|
|
nsIFrame* mColumnsFrame;
|
2009-09-03 03:57:46 +00:00
|
|
|
nsIScrollableFrame* mColumnsScrollFrame;
|
2007-01-09 19:59:38 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
void PaintTreeBody(nsRenderingContext& aRenderingContext,
|
2006-01-26 02:29:17 +00:00
|
|
|
const nsRect& aDirtyRect, nsPoint aPt);
|
2001-02-02 22:44:39 +00:00
|
|
|
|
2007-05-25 10:14:55 +00:00
|
|
|
nsITreeBoxObject* GetTreeBoxObject() const { return mTreeBoxObject; }
|
|
|
|
|
2012-11-18 12:37:19 +00:00
|
|
|
// Get the base element, <tree> or <select>
|
|
|
|
nsIContent* GetBaseElement();
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetVerticalOverflow() const { return mVerticalOverflow; }
|
|
|
|
bool GetHorizontalOverflow() const {return mHorizontalOverflow; }
|
2009-08-13 20:54:09 +00:00
|
|
|
|
2007-01-09 19:59:38 +00:00
|
|
|
protected:
|
2008-12-03 11:11:34 +00:00
|
|
|
friend class nsOverflowChecker;
|
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// This method paints a specific column background of the tree.
|
2004-04-17 05:53:38 +00:00
|
|
|
void PaintColumn(nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aColumnRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect);
|
2001-02-16 01:37:19 +00:00
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// This method paints a single row in the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintRow(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aRowRect,
|
2006-01-26 02:29:17 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2006-01-26 02:29:17 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsPoint aPt);
|
2004-04-17 05:53:38 +00:00
|
|
|
|
|
|
|
// This method paints a single separator in the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintSeparator(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aSeparatorRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect);
|
2001-02-02 22:44:39 +00:00
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// This method paints a specific cell in a given row of the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintCell(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aCellRect,
|
2006-01-26 02:29:17 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2006-01-26 02:29:17 +00:00
|
|
|
nscoord& aCurrX,
|
|
|
|
nsPoint aPt);
|
2002-11-06 06:38:14 +00:00
|
|
|
|
|
|
|
// This method paints the twisty inside a cell in the primary column of an tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintTwisty(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aTwistyRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nscoord& aRemainingWidth,
|
|
|
|
nscoord& aCurrX);
|
2001-03-24 01:50:33 +00:00
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// This method paints the image inside the cell of an tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintImage(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aImageRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nscoord& aRemainingWidth,
|
|
|
|
nscoord& aCurrX);
|
2001-03-22 02:51:39 +00:00
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// This method paints the text string inside a particular cell of the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintText(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aTextRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2013-11-18 15:24:16 +00:00
|
|
|
nscoord& aCurrX);
|
2004-04-17 05:53:38 +00:00
|
|
|
|
|
|
|
// This method paints the checkbox inside a particular cell of the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintCheckbox(int32_t aRowIndex,
|
2002-11-06 06:38:14 +00:00
|
|
|
nsTreeColumn* aColumn,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aCheckboxRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect);
|
2002-03-29 02:46:01 +00:00
|
|
|
|
|
|
|
// This method paints the progress meter inside a particular cell of the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PaintProgressMeter(int32_t aRowIndex,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
const nsRect& aProgressMeterRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aDirtyRect);
|
2002-03-29 02:46:01 +00:00
|
|
|
|
|
|
|
// This method paints a drop feedback of the tree.
|
2004-04-17 05:53:38 +00:00
|
|
|
void PaintDropFeedback(const nsRect& aDropFeedbackRect,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2007-05-30 23:09:56 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsPoint aPt);
|
2002-02-08 22:35:18 +00:00
|
|
|
|
2001-02-09 07:21:01 +00:00
|
|
|
// This method is called with a specific style context and rect to
|
|
|
|
// paint the background rect as if it were a full-blown frame.
|
2004-04-17 05:53:38 +00:00
|
|
|
void PaintBackgroundLayer(nsStyleContext* aStyleContext,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2004-04-17 05:53:38 +00:00
|
|
|
const nsRect& aRect,
|
|
|
|
const nsRect& aDirtyRect);
|
2002-07-19 22:36:46 +00:00
|
|
|
|
2001-02-02 22:34:52 +00:00
|
|
|
|
2005-04-18 05:22:35 +00:00
|
|
|
// An internal hit test. aX and aY are expected to be in twips in the
|
|
|
|
// coordinate system of this frame.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t GetRowAt(nscoord aX, nscoord aY);
|
2001-03-08 00:46:58 +00:00
|
|
|
|
2007-02-21 02:04:51 +00:00
|
|
|
// Check for bidi characters in the text, and if there are any, ensure
|
|
|
|
// that the prescontext is in bidi mode.
|
|
|
|
void CheckTextForBidi(nsAutoString& aText);
|
|
|
|
|
2006-06-06 20:05:13 +00:00
|
|
|
void AdjustForCellText(nsAutoString& aText,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aRowIndex, nsTreeColumn* aColumn,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2006-06-06 20:05:13 +00:00
|
|
|
nsRect& aTextRect);
|
|
|
|
|
2001-03-28 22:45:43 +00:00
|
|
|
// A helper used when hit testing.
|
2005-04-18 05:22:35 +00:00
|
|
|
nsIAtom* GetItemWithinCellAt(nscoord aX, const nsRect& aCellRect,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aRowIndex, nsTreeColumn* aColumn);
|
2004-04-17 05:53:38 +00:00
|
|
|
|
2005-04-18 05:22:35 +00:00
|
|
|
// An internal hit test. aX and aY are expected to be in twips in the
|
|
|
|
// coordinate system of this frame.
|
2012-08-22 15:56:38 +00:00
|
|
|
void GetCellAt(nscoord aX, nscoord aY, int32_t* aRow, nsTreeColumn** aCol,
|
2004-04-17 05:53:38 +00:00
|
|
|
nsIAtom** aChildElt);
|
2001-03-28 22:45:43 +00:00
|
|
|
|
2006-06-06 14:36:45 +00:00
|
|
|
// Retrieve the area for the twisty for a cell.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsITheme* GetTwistyRect(int32_t aRowIndex,
|
2006-06-06 14:36:45 +00:00
|
|
|
nsTreeColumn* aColumn,
|
|
|
|
nsRect& aImageRect,
|
|
|
|
nsRect& aTwistyRect,
|
|
|
|
nsPresContext* aPresContext,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext& aRenderingContext,
|
2006-06-06 14:36:45 +00:00
|
|
|
nsStyleContext* aTwistyContext);
|
|
|
|
|
2001-03-22 02:51:39 +00:00
|
|
|
// Fetch an image from the image cache.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContext,
|
2011-09-29 06:19:26 +00:00
|
|
|
nsStyleContext* aStyleContext, bool& aAllowImageRegions, imgIContainer** aResult);
|
2001-03-22 02:51:39 +00:00
|
|
|
|
|
|
|
// Returns the size of a given image. This size *includes* border and
|
|
|
|
// padding. It does not include margins.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsRect GetImageSize(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContext, nsStyleContext* aStyleContext);
|
2001-03-22 02:51:39 +00:00
|
|
|
|
2006-05-04 18:45:45 +00:00
|
|
|
// Returns the destination size of the image, not including borders and padding.
|
2011-09-29 06:19:26 +00:00
|
|
|
nsSize GetImageDestSize(nsStyleContext* aStyleContext, bool useImageRegion, imgIContainer* image);
|
2006-05-04 18:45:45 +00:00
|
|
|
|
|
|
|
// Returns the source rectangle of the image to be displayed.
|
2011-09-29 06:19:26 +00:00
|
|
|
nsRect GetImageSourceRect(nsStyleContext* aStyleContext, bool useImageRegion, imgIContainer* image);
|
2006-05-04 18:45:45 +00:00
|
|
|
|
2001-02-04 09:50:59 +00:00
|
|
|
// Returns the height of rows in the tree.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t GetRowHeight();
|
2001-02-04 09:50:59 +00:00
|
|
|
|
2001-03-06 02:27:50 +00:00
|
|
|
// Returns our indentation width.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t GetIndentation();
|
2001-03-06 02:27:50 +00:00
|
|
|
|
2003-02-26 08:18:28 +00:00
|
|
|
// Calculates our width/height once border and padding have been removed.
|
|
|
|
void CalcInnerBox();
|
2001-02-04 09:50:59 +00:00
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
// Calculate the total width of our scrollable portion
|
2006-04-26 01:47:58 +00:00
|
|
|
nscoord CalcHorzWidth(const ScrollParts& aParts);
|
2005-08-30 18:36:15 +00:00
|
|
|
|
2001-02-04 09:50:59 +00:00
|
|
|
// Looks up a style context in the style cache. On a cache miss we resolve
|
|
|
|
// the pseudo-styles passed in and place them into the cache.
|
2003-02-22 00:32:13 +00:00
|
|
|
nsStyleContext* GetPseudoStyleContext(nsIAtom* aPseudoElement);
|
2001-02-04 09:50:59 +00:00
|
|
|
|
2006-04-26 01:47:58 +00:00
|
|
|
// Retrieves the scrollbars and scrollview relevant to this treebody. We
|
|
|
|
// traverse the frame tree under our base element, in frame order, looking
|
|
|
|
// for the first relevant vertical scrollbar, horizontal scrollbar, and
|
|
|
|
// scrollable frame (with associated content and scrollable view). These
|
|
|
|
// are all volatile and should not be retained.
|
|
|
|
ScrollParts GetScrollParts();
|
2002-03-07 23:48:26 +00:00
|
|
|
|
2001-03-06 02:27:50 +00:00
|
|
|
// Update the curpos of the scrollbar.
|
2006-04-26 01:47:58 +00:00
|
|
|
void UpdateScrollbars(const ScrollParts& aParts);
|
2001-03-06 02:27:50 +00:00
|
|
|
|
2003-09-15 11:30:20 +00:00
|
|
|
// Update the maxpos of the scrollbar.
|
2009-08-19 11:34:06 +00:00
|
|
|
void InvalidateScrollbars(const ScrollParts& aParts, nsWeakFrame& aWeakColumnsFrame);
|
2003-09-15 11:30:20 +00:00
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
// Check overflow and generate events.
|
2006-04-26 01:47:58 +00:00
|
|
|
void CheckOverflow(const ScrollParts& aParts);
|
2001-05-13 05:30:46 +00:00
|
|
|
|
2011-10-17 14:59:28 +00:00
|
|
|
// Calls UpdateScrollbars, Invalidate aNeedsFullInvalidation if true,
|
2007-06-14 08:37:21 +00:00
|
|
|
// InvalidateScrollbars and finally CheckOverflow.
|
2011-10-17 14:59:28 +00:00
|
|
|
// returns true if the frame is still alive after the method call.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool FullScrollbarsUpdate(bool aNeedsFullInvalidation);
|
2007-06-14 08:37:21 +00:00
|
|
|
|
2001-02-14 19:39:20 +00:00
|
|
|
// Use to auto-fill some of the common properties without the view having to do it.
|
2001-03-24 01:50:33 +00:00
|
|
|
// Examples include container, open, selected, and focus.
|
2012-08-22 15:56:38 +00:00
|
|
|
void PrefillPropertyArray(int32_t aRowIndex, nsTreeColumn* aCol);
|
2001-02-14 19:39:20 +00:00
|
|
|
|
2001-03-06 02:27:50 +00:00
|
|
|
// Our internal scroll method, used by all the public scroll methods.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult ScrollInternal(const ScrollParts& aParts, int32_t aRow);
|
|
|
|
nsresult ScrollToRowInternal(const ScrollParts& aParts, int32_t aRow);
|
2006-04-26 01:47:58 +00:00
|
|
|
nsresult ScrollToColumnInternal(const ScrollParts& aParts, nsITreeColumn* aCol);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult ScrollHorzInternal(const ScrollParts& aParts, int32_t aPosition);
|
|
|
|
nsresult EnsureRowIsVisibleInternal(const ScrollParts& aParts, int32_t aRow);
|
2011-04-08 01:04:40 +00:00
|
|
|
|
2010-08-09 16:15:39 +00:00
|
|
|
// Convert client pixels into appunits in our coordinate space.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsPoint AdjustClientCoordsToBoxCoordSpace(int32_t aX, int32_t aY);
|
2001-03-06 02:27:50 +00:00
|
|
|
|
2002-01-05 01:32:12 +00:00
|
|
|
// Cache the box object
|
|
|
|
void EnsureBoxObject();
|
|
|
|
|
2002-06-20 20:06:25 +00:00
|
|
|
void EnsureView();
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetCellWidth(int32_t aRow, nsTreeColumn* aCol,
|
2011-04-08 01:04:40 +00:00
|
|
|
nsRenderingContext* aRenderingContext,
|
2007-01-09 19:59:38 +00:00
|
|
|
nscoord& aDesiredSize, nscoord& aCurrentSize);
|
2004-04-17 05:53:38 +00:00
|
|
|
nscoord CalcMaxRowWidth();
|
2002-01-05 07:17:10 +00:00
|
|
|
|
2005-08-31 04:37:24 +00:00
|
|
|
// Translate the given rect horizontally from tree coordinates into the
|
|
|
|
// coordinate system of our nsTreeBodyFrame. If clip is true, then clip the
|
|
|
|
// rect to its intersection with mInnerBox in the horizontal direction.
|
|
|
|
// Return whether the result has a nonempty intersection with mInnerBox
|
|
|
|
// after projecting both onto the horizontal coordinate axis.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool OffsetForHorzScroll(nsRect& rect, bool clip);
|
2005-08-30 18:36:15 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
bool CanAutoScroll(int32_t aRowIndex);
|
2002-01-16 03:01:28 +00:00
|
|
|
|
2002-08-15 05:06:19 +00:00
|
|
|
// Calc the row and above/below/on status given where the mouse currently is hovering.
|
|
|
|
// Also calc if we're in the region in which we want to auto-scroll the tree.
|
|
|
|
// A positive value of |aScrollLines| means scroll down, a negative value
|
|
|
|
// means scroll up, a zero value means that we aren't in drag scroll region.
|
2013-10-02 03:46:03 +00:00
|
|
|
void ComputeDropPosition(mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
int32_t* aRow,
|
|
|
|
int16_t* aOrient,
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t* aScrollLines);
|
2002-01-16 03:01:28 +00:00
|
|
|
|
2002-04-16 05:09:35 +00:00
|
|
|
// Mark ourselves dirty if we're a select widget
|
|
|
|
void MarkDirtyIfSelect();
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
void InvalidateDropFeedback(int32_t aRow, int16_t aOrientation) {
|
2004-04-17 05:53:38 +00:00
|
|
|
InvalidateRow(aRow);
|
|
|
|
if (aOrientation != nsITreeView::DROP_ON)
|
|
|
|
InvalidateRow(aRow + aOrientation);
|
2007-04-23 14:21:53 +00:00
|
|
|
}
|
2004-04-17 05:53:38 +00:00
|
|
|
|
2010-07-31 18:18:22 +00:00
|
|
|
public:
|
|
|
|
static
|
2007-01-08 02:41:05 +00:00
|
|
|
already_AddRefed<nsTreeColumn> GetColumnImpl(nsITreeColumn* aUnknownCol) {
|
2007-01-04 16:23:48 +00:00
|
|
|
if (!aUnknownCol)
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2007-01-04 16:23:48 +00:00
|
|
|
|
2013-04-22 11:15:59 +00:00
|
|
|
nsCOMPtr<nsTreeColumn> col = do_QueryInterface(aUnknownCol);
|
|
|
|
return col.forget();
|
2007-01-04 16:23:48 +00:00
|
|
|
}
|
|
|
|
|
2011-11-09 21:39:16 +00:00
|
|
|
/**
|
|
|
|
* Remove an nsITreeImageListener from being tracked by this frame. Only tree
|
|
|
|
* image listeners that are created by this frame are tracked.
|
|
|
|
*
|
|
|
|
* @param aListener A pointer to an nsTreeImageListener to no longer
|
|
|
|
* track.
|
|
|
|
*/
|
|
|
|
void RemoveTreeImageListener(nsTreeImageListener* aListener);
|
|
|
|
|
2010-07-31 18:18:22 +00:00
|
|
|
protected:
|
|
|
|
|
2003-03-16 23:26:31 +00:00
|
|
|
// Create a new timer. This method is used to delay various actions like
|
|
|
|
// opening/closing folders or tree scrolling.
|
|
|
|
// aID is type of the action, aFunc is the function to be called when
|
|
|
|
// the timer fires and aType is type of timer - one shot or repeating.
|
2011-09-09 02:27:13 +00:00
|
|
|
nsresult CreateTimer(const mozilla::LookAndFeel::IntID aID,
|
2012-08-22 15:56:38 +00:00
|
|
|
nsTimerCallbackFunc aFunc, int32_t aType,
|
2003-03-16 23:26:31 +00:00
|
|
|
nsITimer** aTimer);
|
|
|
|
|
2002-08-15 05:06:19 +00:00
|
|
|
static void OpenCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
|
2003-03-16 23:26:31 +00:00
|
|
|
static void CloseCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
|
|
|
|
static void LazyScrollCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
|
2002-08-15 05:06:19 +00:00
|
|
|
static void ScrollCallback(nsITimer *aTimer, void *aClosure);
|
|
|
|
|
2007-06-14 08:37:21 +00:00
|
|
|
class ScrollEvent : public nsRunnable {
|
|
|
|
public:
|
|
|
|
NS_DECL_NSIRUNNABLE
|
|
|
|
ScrollEvent(nsTreeBodyFrame *aInner) : mInner(aInner) {}
|
2012-07-30 14:20:58 +00:00
|
|
|
void Revoke() { mInner = nullptr; }
|
2007-06-14 08:37:21 +00:00
|
|
|
private:
|
|
|
|
nsTreeBodyFrame* mInner;
|
|
|
|
};
|
|
|
|
|
|
|
|
void PostScrollEvent();
|
|
|
|
void FireScrollEvent();
|
|
|
|
|
2013-08-16 21:17:40 +00:00
|
|
|
virtual void ScrollbarActivityStarted() const MOZ_OVERRIDE;
|
|
|
|
virtual void ScrollbarActivityStopped() const MOZ_OVERRIDE;
|
|
|
|
|
2011-11-09 21:39:16 +00:00
|
|
|
/**
|
|
|
|
* Clear the pointer to this frame for all nsTreeImageListeners that were
|
|
|
|
* created by this frame.
|
|
|
|
*/
|
|
|
|
void DetachImageListeners();
|
|
|
|
|
2008-02-08 12:55:57 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2007-12-11 08:18:04 +00:00
|
|
|
/**
|
|
|
|
* Fires 'treeRowCountChanged' event asynchronously. The event supports
|
2014-03-21 03:59:59 +00:00
|
|
|
* nsIDOMCustomEvent interface that is used to expose the following
|
2007-12-11 08:18:04 +00:00
|
|
|
* information structures.
|
|
|
|
*
|
|
|
|
* @param aIndex the row index rows are added/removed from
|
|
|
|
* @param aCount the number of added/removed rows (the sign points to
|
|
|
|
* an operation, plus - addition, minus - removing)
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
void FireRowCountChangedEvent(int32_t aIndex, int32_t aCount);
|
2007-12-11 08:18:04 +00:00
|
|
|
|
2008-02-08 12:55:57 +00:00
|
|
|
/**
|
|
|
|
* Fires 'treeInvalidated' event asynchronously. The event supports
|
2014-03-21 03:59:59 +00:00
|
|
|
* nsIDOMCustomEvent interface that is used to expose the information
|
2008-02-08 12:55:57 +00:00
|
|
|
* structures described by method arguments.
|
|
|
|
*
|
|
|
|
* @param aStartRow the start index of invalidated rows, -1 means that
|
|
|
|
* columns have been invalidated only
|
|
|
|
* @param aEndRow the end index of invalidated rows, -1 means that columns
|
|
|
|
* have been invalidated only
|
2012-07-30 14:20:58 +00:00
|
|
|
* @param aStartCol the start invalidated column, nullptr means that only rows
|
2008-02-08 12:55:57 +00:00
|
|
|
* have been invalidated
|
2012-07-30 14:20:58 +00:00
|
|
|
* @param aEndCol the end invalidated column, nullptr means that rows have
|
2008-02-08 12:55:57 +00:00
|
|
|
* been invalidated only
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
void FireInvalidateEvent(int32_t aStartRow, int32_t aEndRow,
|
2008-02-08 12:55:57 +00:00
|
|
|
nsITreeColumn *aStartCol, nsITreeColumn *aEndCol);
|
|
|
|
#endif
|
|
|
|
|
2001-02-02 22:34:52 +00:00
|
|
|
protected: // Data Members
|
2009-05-12 10:13:09 +00:00
|
|
|
|
|
|
|
class Slots {
|
|
|
|
public:
|
|
|
|
Slots() {
|
|
|
|
}
|
|
|
|
|
|
|
|
~Slots() {
|
|
|
|
if (mTimer)
|
|
|
|
mTimer->Cancel();
|
|
|
|
}
|
|
|
|
|
|
|
|
friend class nsTreeBodyFrame;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// If the drop is actually allowed here or not.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDropAllowed;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
2012-02-07 18:02:33 +00:00
|
|
|
// True while dragging over the tree.
|
|
|
|
bool mIsDragging;
|
|
|
|
|
2009-05-12 10:13:09 +00:00
|
|
|
// The row the mouse is hovering over during a drop.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mDropRow;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
|
|
|
// Where we want to draw feedback (above/on this row/below) if allowed.
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mDropOrient;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
|
|
|
// Number of lines to be scrolled.
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mScrollLines;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
|
|
|
// The drag action that was received for this slot
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mDragAction;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
|
|
|
// Timer for opening/closing spring loaded folders or scrolling the tree.
|
|
|
|
nsCOMPtr<nsITimer> mTimer;
|
|
|
|
|
|
|
|
// An array used to keep track of all spring loaded folders.
|
2012-08-22 15:56:38 +00:00
|
|
|
nsTArray<int32_t> mArray;
|
2009-05-12 10:13:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Slots* mSlots;
|
|
|
|
|
|
|
|
nsRevocableEventPtr<ScrollEvent> mScrollEvent;
|
|
|
|
|
2013-08-01 01:43:56 +00:00
|
|
|
nsRefPtr<ScrollbarActivity> mScrollbarActivity;
|
2013-05-02 14:58:00 +00:00
|
|
|
|
2001-03-08 00:46:58 +00:00
|
|
|
// The cached box object parent.
|
2006-07-13 09:02:05 +00:00
|
|
|
nsCOMPtr<nsITreeBoxObject> mTreeBoxObject;
|
2001-03-08 00:46:58 +00:00
|
|
|
|
2004-04-17 05:53:38 +00:00
|
|
|
// Cached column information.
|
|
|
|
nsRefPtr<nsTreeColumns> mColumns;
|
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
// The current view for this tree widget. We get all of our row and cell data
|
2001-02-03 23:13:53 +00:00
|
|
|
// from the view.
|
2009-05-12 10:13:09 +00:00
|
|
|
nsCOMPtr<nsITreeView> mView;
|
2004-04-17 05:53:38 +00:00
|
|
|
|
2001-02-04 09:50:59 +00:00
|
|
|
// A cache of all the style contexts we have seen for rows and cells of the tree. This is a mapping from
|
2001-02-02 22:34:52 +00:00
|
|
|
// a list of atoms to a corresponding style context. This cache stores every combination that
|
2001-02-04 09:50:59 +00:00
|
|
|
// occurs in the tree, so for n distinct properties, this cache could have 2 to the n entries
|
2001-02-02 22:34:52 +00:00
|
|
|
// (the power set of all row properties).
|
2002-03-29 02:46:01 +00:00
|
|
|
nsTreeStyleCache mStyleCache;
|
2001-02-02 22:34:52 +00:00
|
|
|
|
2006-01-30 18:57:38 +00:00
|
|
|
// A hashtable that maps from URLs to image request/listener pairs. The URL
|
|
|
|
// is provided by the view or by the style context. The style context
|
|
|
|
// represents a resolved :-moz-tree-cell-image (or twisty) pseudo-element.
|
2002-03-29 02:46:01 +00:00
|
|
|
// It maps directly to an imgIRequest.
|
2006-01-30 18:57:38 +00:00
|
|
|
nsDataHashtable<nsStringHashKey, nsTreeImageCacheEntry> mImageCache;
|
2001-03-22 02:51:39 +00:00
|
|
|
|
2009-05-12 10:13:09 +00:00
|
|
|
// A scratch array used when looking up cached style contexts.
|
2013-03-19 15:46:20 +00:00
|
|
|
AtomArray mScratchArray;
|
2009-05-12 10:13:09 +00:00
|
|
|
|
2001-02-02 22:34:52 +00:00
|
|
|
// The index of the first visible row and the # of rows visible onscreen.
|
2002-03-29 02:46:01 +00:00
|
|
|
// The tree only examines onscreen rows, starting from
|
2004-04-17 05:53:38 +00:00
|
|
|
// this index and going up to index+pageLength.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mTopRowIndex;
|
|
|
|
int32_t mPageLength;
|
2001-02-04 09:50:59 +00:00
|
|
|
|
2005-08-30 18:36:15 +00:00
|
|
|
// The horizontal scroll position
|
|
|
|
nscoord mHorzPosition;
|
2013-07-13 03:19:37 +00:00
|
|
|
|
|
|
|
// The original desired horizontal width before changing it and posting a
|
|
|
|
// reflow callback. In some cases, the desired horizontal width can first be
|
|
|
|
// different from the current desired horizontal width, only to return to
|
|
|
|
// the same value later during the same reflow. In this case, we can cancel
|
|
|
|
// the posted reflow callback and prevent an unnecessary reflow.
|
|
|
|
nscoord mOriginalHorzWidth;
|
2005-08-31 04:37:24 +00:00
|
|
|
// Our desired horizontal width (the width for which we actually have tree
|
|
|
|
// columns).
|
2005-08-30 18:36:15 +00:00
|
|
|
nscoord mHorzWidth;
|
2007-08-23 12:27:50 +00:00
|
|
|
// The amount by which to adjust the width of the last cell.
|
|
|
|
// This depends on whether or not the columnpicker and scrollbars are present.
|
|
|
|
nscoord mAdjustWidth;
|
2005-08-30 18:36:15 +00:00
|
|
|
|
2001-05-11 01:51:04 +00:00
|
|
|
// Cached heights and indent info.
|
2009-05-12 10:13:09 +00:00
|
|
|
nsRect mInnerBox; // 4-byte aligned
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mRowHeight;
|
|
|
|
int32_t mIndentation;
|
2002-01-05 07:17:10 +00:00
|
|
|
nscoord mStringWidth;
|
2001-09-25 22:17:47 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mUpdateBatchNest;
|
2002-08-15 05:06:19 +00:00
|
|
|
|
2004-04-17 05:53:38 +00:00
|
|
|
// Cached row count.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mRowCount;
|
2002-08-15 05:06:19 +00:00
|
|
|
|
2007-08-23 15:57:54 +00:00
|
|
|
// The row the mouse is hovering over.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mMouseOverRow;
|
2007-08-23 15:57:54 +00:00
|
|
|
|
2009-05-12 10:13:09 +00:00
|
|
|
// Whether or not we're currently focused.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mFocused;
|
2004-04-17 05:53:38 +00:00
|
|
|
|
2009-05-12 10:13:09 +00:00
|
|
|
// Do we have a fixed number of onscreen rows?
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mHasFixedRowCount;
|
2003-05-23 12:03:40 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mVerticalOverflow;
|
|
|
|
bool mHorizontalOverflow;
|
2007-06-14 08:37:21 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mReflowCallbackPosted;
|
2011-11-09 21:39:16 +00:00
|
|
|
|
2013-09-19 04:30:30 +00:00
|
|
|
// Set while we flush layout to take account of effects of
|
|
|
|
// overflow/underflow event handlers
|
2013-09-13 11:02:30 +00:00
|
|
|
bool mCheckingOverflow;
|
|
|
|
|
2011-11-09 21:39:16 +00:00
|
|
|
// Hash table to keep track of which listeners we created and thus
|
|
|
|
// have pointers to us.
|
|
|
|
nsTHashtable<nsPtrHashKey<nsTreeImageListener> > mCreatedListeners;
|
|
|
|
|
2002-03-29 02:46:01 +00:00
|
|
|
}; // class nsTreeBodyFrame
|
2008-10-28 04:47:19 +00:00
|
|
|
|
|
|
|
#endif
|