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