layout/forms/nsProgressFrame.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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 #ifndef nsProgressFrame_h___
     7 #define nsProgressFrame_h___
     9 #include "mozilla/Attributes.h"
    10 #include "nsContainerFrame.h"
    11 #include "nsIAnonymousContentCreator.h"
    12 #include "nsCOMPtr.h"
    14 class nsBaseContentList;
    16 class nsProgressFrame : public nsContainerFrame,
    17                         public nsIAnonymousContentCreator
    18 {
    19   typedef mozilla::dom::Element Element;
    21 public:
    22   NS_DECL_QUERYFRAME_TARGET(nsProgressFrame)
    23   NS_DECL_QUERYFRAME
    24   NS_DECL_FRAMEARENA_HELPERS
    26   nsProgressFrame(nsStyleContext* aContext);
    27   virtual ~nsProgressFrame();
    29   virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
    31   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    32                                 const nsRect&           aDirtyRect,
    33                                 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    35   virtual nsresult Reflow(nsPresContext*           aCX,
    36                           nsHTMLReflowMetrics&     aDesiredSize,
    37                           const nsHTMLReflowState& aReflowState,
    38                           nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    40 #ifdef DEBUG_FRAME_DUMP
    41   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
    42     return MakeFrameName(NS_LITERAL_STRING("Progress"), aResult);
    43   }
    44 #endif
    46   virtual bool IsLeaf() const MOZ_OVERRIDE { return true; }
    48   // nsIAnonymousContentCreator
    49   virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
    50   virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
    51                                         uint32_t aFilter) MOZ_OVERRIDE;
    53   virtual nsresult AttributeChanged(int32_t  aNameSpaceID,
    54                                     nsIAtom* aAttribute,
    55                                     int32_t  aModType) MOZ_OVERRIDE;
    57   virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
    58                                  nsSize aCBSize, nscoord aAvailableWidth,
    59                                  nsSize aMargin, nsSize aBorder,
    60                                  nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
    62   virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
    63   virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
    65   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
    66   {
    67     return nsContainerFrame::IsFrameOfType(aFlags &
    68       ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
    69   }
    71   /**
    72    * Returns whether the frame and its child should use the native style.
    73    */
    74   bool ShouldUseNativeStyle() const;
    76   virtual Element* GetPseudoElement(nsCSSPseudoElements::Type aType) MOZ_OVERRIDE;
    78 protected:
    79   // Helper function which reflow the anonymous div frame.
    80   void ReflowBarFrame(nsIFrame*                aBarFrame,
    81                       nsPresContext*           aPresContext,
    82                       const nsHTMLReflowState& aReflowState,
    83                       nsReflowStatus&          aStatus);
    85   /**
    86    * The div used to show the progress bar.
    87    * @see nsProgressFrame::CreateAnonymousContent
    88    */
    89   nsCOMPtr<Element> mBarDiv;
    90 };
    92 #endif

mercurial