Line data Source code
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 0 : class nsGfxButtonControlFrame final
20 : : public nsHTMLButtonControlFrame
21 : , public nsIAnonymousContentCreator
22 : {
23 : public:
24 0 : NS_DECL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
25 :
26 : explicit nsGfxButtonControlFrame(nsStyleContext* aContext);
27 :
28 : virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
29 :
30 : virtual nsresult HandleEvent(nsPresContext* aPresContext,
31 : mozilla::WidgetGUIEvent* aEvent,
32 : nsEventStatus* aEventStatus) override;
33 :
34 : #ifdef DEBUG_FRAME_DUMP
35 : virtual nsresult GetFrameName(nsAString& aResult) const override;
36 : #endif
37 :
38 : NS_DECL_QUERYFRAME
39 :
40 : // nsIAnonymousContentCreator
41 : virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
42 : virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
43 : uint32_t aFilter) override;
44 :
45 : virtual nsresult AttributeChanged(int32_t aNameSpaceID,
46 : nsIAtom* aAttribute,
47 : int32_t aModType) override;
48 :
49 : virtual nsContainerFrame* GetContentInsertionFrame() override;
50 :
51 : protected:
52 : nsresult GetDefaultLabel(nsXPIDLString& aLabel) const;
53 :
54 : nsresult GetLabel(nsXPIDLString& aLabel);
55 :
56 0 : virtual bool IsInput() override { return true; }
57 : private:
58 : nsCOMPtr<nsIContent> mTextContent;
59 : };
60 :
61 :
62 : #endif
63 :
|