2011-05-10 16:59:07 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2011-05-10 16:59:07 +04:00
|
|
|
|
|
|
|
#ifndef nsProgressFrame_h___
|
|
|
|
#define nsProgressFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-12-28 00:18:48 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2011-05-10 16:59:07 +04:00
|
|
|
#include "nsIAnonymousContentCreator.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2011-08-11 17:29:50 +04:00
|
|
|
class nsBaseContentList;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2011-12-28 00:18:48 +04:00
|
|
|
class nsProgressFrame : public nsContainerFrame,
|
2011-05-10 16:59:07 +04:00
|
|
|
public nsIAnonymousContentCreator
|
|
|
|
{
|
2013-12-03 08:49:03 +04:00
|
|
|
typedef mozilla::dom::Element Element;
|
|
|
|
|
2011-05-10 16:59:07 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsProgressFrame)
|
|
|
|
NS_DECL_QUERYFRAME
|
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
|
|
|
nsProgressFrame(nsStyleContext* aContext);
|
|
|
|
virtual ~nsProgressFrame();
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2011-12-28 00:18:48 +04:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aCX,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
2011-05-10 16:59:07 +04:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("Progress"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual bool IsLeaf() const MOZ_OVERRIDE { return true; }
|
2011-05-10 16:59:07 +04:00
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
|
2012-09-14 20:10:08 +04:00
|
|
|
uint32_t aFilter) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
|
|
|
virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
2011-08-23 02:30:33 +04:00
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2011-05-10 16:59:07 +04:00
|
|
|
{
|
2011-12-28 00:18:48 +04:00
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags &
|
2011-05-10 16:59:07 +04:00
|
|
|
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
|
|
}
|
|
|
|
|
2011-05-06 14:00:30 +04:00
|
|
|
/**
|
|
|
|
* Returns whether the frame and its child should use the native style.
|
|
|
|
*/
|
|
|
|
bool ShouldUseNativeStyle() const;
|
|
|
|
|
2013-12-03 08:49:03 +04:00
|
|
|
virtual Element* GetPseudoElement(nsCSSPseudoElements::Type aType) MOZ_OVERRIDE;
|
2013-12-03 03:57:50 +04:00
|
|
|
|
2011-05-10 16:59:07 +04:00
|
|
|
protected:
|
|
|
|
// Helper function which reflow the anonymous div frame.
|
|
|
|
void ReflowBarFrame(nsIFrame* aBarFrame,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The div used to show the progress bar.
|
|
|
|
* @see nsProgressFrame::CreateAnonymousContent
|
|
|
|
*/
|
2013-12-03 08:49:03 +04:00
|
|
|
nsCOMPtr<Element> mBarDiv;
|
2011-05-10 16:59:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|