layout/forms/nsGfxButtonControlFrame.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsGfxButtonControlFrame_h___
michael@0 7 #define nsGfxButtonControlFrame_h___
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "nsHTMLButtonControlFrame.h"
michael@0 11 #include "nsCOMPtr.h"
michael@0 12 #include "nsIAnonymousContentCreator.h"
michael@0 13
michael@0 14 // Class which implements the input[type=button, reset, submit] and
michael@0 15 // browse button for input[type=file].
michael@0 16 // The label for button is specified through generated content
michael@0 17 // in the ua.css file.
michael@0 18
michael@0 19 class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
michael@0 20 public nsIAnonymousContentCreator
michael@0 21 {
michael@0 22 public:
michael@0 23 NS_DECL_FRAMEARENA_HELPERS
michael@0 24
michael@0 25 nsGfxButtonControlFrame(nsStyleContext* aContext);
michael@0 26
michael@0 27 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
michael@0 28
michael@0 29 virtual nsresult HandleEvent(nsPresContext* aPresContext,
michael@0 30 mozilla::WidgetGUIEvent* aEvent,
michael@0 31 nsEventStatus* aEventStatus) MOZ_OVERRIDE;
michael@0 32
michael@0 33 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
michael@0 34
michael@0 35 #ifdef DEBUG_FRAME_DUMP
michael@0 36 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
michael@0 37 #endif
michael@0 38
michael@0 39 NS_DECL_QUERYFRAME
michael@0 40
michael@0 41 // nsIAnonymousContentCreator
michael@0 42 virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
michael@0 43 virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
michael@0 44 uint32_t aFilter) MOZ_OVERRIDE;
michael@0 45 virtual nsIFrame* CreateFrameFor(nsIContent* aContent) MOZ_OVERRIDE;
michael@0 46
michael@0 47 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
michael@0 48 nsIAtom* aAttribute,
michael@0 49 int32_t aModType) MOZ_OVERRIDE;
michael@0 50
michael@0 51 virtual bool IsLeaf() const MOZ_OVERRIDE;
michael@0 52
michael@0 53 virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
michael@0 54
michael@0 55 protected:
michael@0 56 nsresult GetDefaultLabel(nsXPIDLString& aLabel) const;
michael@0 57
michael@0 58 nsresult GetLabel(nsXPIDLString& aLabel);
michael@0 59
michael@0 60 virtual bool IsInput() MOZ_OVERRIDE { return true; }
michael@0 61 private:
michael@0 62 nsCOMPtr<nsIContent> mTextContent;
michael@0 63 };
michael@0 64
michael@0 65
michael@0 66 #endif
michael@0 67

mercurial