layout/forms/nsGfxButtonControlFrame.h

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:a1da2e124071
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/. */
5
6 #ifndef nsGfxButtonControlFrame_h___
7 #define nsGfxButtonControlFrame_h___
8
9 #include "mozilla/Attributes.h"
10 #include "nsHTMLButtonControlFrame.h"
11 #include "nsCOMPtr.h"
12 #include "nsIAnonymousContentCreator.h"
13
14 // Class which implements the input[type=button, reset, submit] and
15 // browse button for input[type=file].
16 // The label for button is specified through generated content
17 // in the ua.css file.
18
19 class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
20 public nsIAnonymousContentCreator
21 {
22 public:
23 NS_DECL_FRAMEARENA_HELPERS
24
25 nsGfxButtonControlFrame(nsStyleContext* aContext);
26
27 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
28
29 virtual nsresult HandleEvent(nsPresContext* aPresContext,
30 mozilla::WidgetGUIEvent* aEvent,
31 nsEventStatus* aEventStatus) MOZ_OVERRIDE;
32
33 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
34
35 #ifdef DEBUG_FRAME_DUMP
36 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
37 #endif
38
39 NS_DECL_QUERYFRAME
40
41 // nsIAnonymousContentCreator
42 virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
43 virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
44 uint32_t aFilter) MOZ_OVERRIDE;
45 virtual nsIFrame* CreateFrameFor(nsIContent* aContent) MOZ_OVERRIDE;
46
47 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
48 nsIAtom* aAttribute,
49 int32_t aModType) MOZ_OVERRIDE;
50
51 virtual bool IsLeaf() const MOZ_OVERRIDE;
52
53 virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
54
55 protected:
56 nsresult GetDefaultLabel(nsXPIDLString& aLabel) const;
57
58 nsresult GetLabel(nsXPIDLString& aLabel);
59
60 virtual bool IsInput() MOZ_OVERRIDE { return true; }
61 private:
62 nsCOMPtr<nsIContent> mTextContent;
63 };
64
65
66 #endif
67

mercurial