layout/xul/grid/nsGridRowLeafLayout.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /**
     8   Author:
     9   Eric D Vaughan
    11 **/
    13 #ifndef nsGridRowLeafLayout_h___
    14 #define nsGridRowLeafLayout_h___
    16 #include "mozilla/Attributes.h"
    17 #include "nsGridRowLayout.h"
    18 #include "nsCOMPtr.h"
    20 /**
    21  * The nsBoxLayout implementation for nsGridRowLeafFrame.
    22  */
    23 // XXXldb This needs a better name that indicates that it's for any grid
    24 // row.
    25 class nsGridRowLeafLayout : public nsGridRowLayout
    26 {
    27 public:
    29   friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
    31   virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
    32   virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
    33   virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
    34   virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE;
    35   NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
    36   virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) MOZ_OVERRIDE;
    37   virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE;
    38   virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) MOZ_OVERRIDE;
    39   virtual Type GetType() MOZ_OVERRIDE { return eRowLeaf; }
    41 protected:
    43   virtual void PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState,
    44                                 nsBoxSize*& aBoxSizes, nscoord& aMinSize,
    45                                 nscoord& aMaxSize, int32_t& aFlexes) MOZ_OVERRIDE;
    46   virtual void ComputeChildSizes(nsIFrame* aBox,
    47                                  nsBoxLayoutState& aState,
    48                                  nscoord& aGivenSize,
    49                                  nsBoxSize* aBoxSizes,
    50                                  nsComputedBoxSize*& aComputedBoxSizes) MOZ_OVERRIDE;
    53   nsGridRowLeafLayout();
    54   virtual ~nsGridRowLeafLayout();
    55   //virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
    57 private:
    59 }; // class nsGridRowLeafLayout
    61 #endif

mercurial