layout/xul/grid/nsGridRowLayout.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 nsGridRowLayout_h___
    14 #define nsGridRowLayout_h___
    16 #include "mozilla/Attributes.h"
    17 #include "nsSprocketLayout.h"
    18 #include "nsIGridPart.h"
    19 class nsGridRowGroupLayout;
    20 class nsGridLayout2;
    21 class nsBoxLayoutState;
    22 class nsGrid;
    24 /**
    25  * A common base class for nsGridRowLeafLayout (the nsBoxLayout object
    26  * for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout
    27  * object for a grid row group or column group).
    28  */
    29 // XXXldb This needs a name that indicates that it's a base class for
    30 // both row and rows (row-group).
    31 class nsGridRowLayout : public nsSprocketLayout,
    32                         public nsIGridPart
    33 {
    34 public:
    35   NS_DECL_ISUPPORTS_INHERITED
    37   virtual nsGridRowGroupLayout* CastToRowGroupLayout() MOZ_OVERRIDE { return nullptr; }
    38   virtual nsGridLayout2* CastToGridLayout() MOZ_OVERRIDE { return nullptr; }
    39   virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) MOZ_OVERRIDE;
    40   virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) MOZ_OVERRIDE;
    41   virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
    42                                 nsIFrame* aPrevBox,
    43                                 const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE;
    44   virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
    45                                 const nsFrameList::Slice& aNewChildren) MOZ_OVERRIDE;
    46   virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE;
    47   virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) MOZ_OVERRIDE;
    48   virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) MOZ_OVERRIDE;
    50   virtual nsIGridPart* AsGridPart() MOZ_OVERRIDE { return this; }
    52 protected:
    53   virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
    55   nsGridRowLayout();
    56 };
    58 #endif

mercurial