michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsGfxButtonControlFrame_h___ michael@0: #define nsGfxButtonControlFrame_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsHTMLButtonControlFrame.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIAnonymousContentCreator.h" michael@0: michael@0: // Class which implements the input[type=button, reset, submit] and michael@0: // browse button for input[type=file]. michael@0: // The label for button is specified through generated content michael@0: // in the ua.css file. michael@0: michael@0: class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame, michael@0: public nsIAnonymousContentCreator michael@0: { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: nsGfxButtonControlFrame(nsStyleContext* aContext); michael@0: michael@0: virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult HandleEvent(nsPresContext* aPresContext, michael@0: mozilla::WidgetGUIEvent* aEvent, michael@0: nsEventStatus* aEventStatus) MOZ_OVERRIDE; michael@0: michael@0: virtual nsIAtom* GetType() const MOZ_OVERRIDE; michael@0: michael@0: #ifdef DEBUG_FRAME_DUMP michael@0: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: NS_DECL_QUERYFRAME michael@0: michael@0: // nsIAnonymousContentCreator michael@0: virtual nsresult CreateAnonymousContent(nsTArray& aElements) MOZ_OVERRIDE; michael@0: virtual void AppendAnonymousContentTo(nsBaseContentList& aElements, michael@0: uint32_t aFilter) MOZ_OVERRIDE; michael@0: virtual nsIFrame* CreateFrameFor(nsIContent* aContent) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: virtual bool IsLeaf() const MOZ_OVERRIDE; michael@0: michael@0: virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: nsresult GetDefaultLabel(nsXPIDLString& aLabel) const; michael@0: michael@0: nsresult GetLabel(nsXPIDLString& aLabel); michael@0: michael@0: virtual bool IsInput() MOZ_OVERRIDE { return true; } michael@0: private: michael@0: nsCOMPtr mTextContent; michael@0: }; michael@0: michael@0: michael@0: #endif michael@0: