Bug 1591736 - Fix AddonManagerWebAPI::IsAPIEnabled in out-of-process iframes r=mixedpuppy
[gecko.git] / layout / xul / nsButtonBoxFrame.h
blobef9eca125c2fe4d760484fcb4c4b48df4927aa52
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 #ifndef nsButtonBoxFrame_h___
7 #define nsButtonBoxFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsIDOMEventListener.h"
11 #include "nsBoxFrame.h"
13 namespace mozilla {
14 class PresShell;
15 } // namespace mozilla
17 class nsButtonBoxFrame : public nsBoxFrame {
18 public:
19 NS_DECL_FRAMEARENA_HELPERS(nsButtonBoxFrame)
21 friend nsIFrame* NS_NewButtonBoxFrame(mozilla::PresShell* aPresShell);
23 nsButtonBoxFrame(ComputedStyle*, nsPresContext*, ClassID = kClassID);
25 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
26 nsIFrame* aPrevInFlow) override;
28 virtual void BuildDisplayListForChildren(
29 nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) override;
31 virtual void DestroyFrom(nsIFrame* aDestructRoot,
32 PostDestroyData& aPostDestroyData) override;
34 virtual nsresult HandleEvent(nsPresContext* aPresContext,
35 mozilla::WidgetGUIEvent* aEvent,
36 nsEventStatus* aEventStatus) override;
38 MOZ_CAN_RUN_SCRIPT_BOUNDARY
39 virtual void MouseClicked(mozilla::WidgetGUIEvent* aEvent);
41 void Blurred();
43 #ifdef DEBUG_FRAME_DUMP
44 virtual nsresult GetFrameName(nsAString& aResult) const override {
45 return MakeFrameName(NS_LITERAL_STRING("ButtonBoxFrame"), aResult);
47 #endif
49 void UpdateMouseThrough() override {
50 AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER);
53 private:
54 class nsButtonBoxListener final : public nsIDOMEventListener {
55 public:
56 explicit nsButtonBoxListener(nsButtonBoxFrame* aButtonBoxFrame)
57 : mButtonBoxFrame(aButtonBoxFrame) {}
59 NS_DECL_NSIDOMEVENTLISTENER
61 NS_DECL_ISUPPORTS
63 private:
64 friend class nsButtonBoxFrame;
65 virtual ~nsButtonBoxListener() {}
66 nsButtonBoxFrame* mButtonBoxFrame;
69 RefPtr<nsButtonBoxListener> mButtonBoxListener;
70 bool mIsHandlingKeyEvent;
71 }; // class nsButtonBoxFrame
73 #endif /* nsButtonBoxFrame_h___ */