Bug 1800263 - Part 1: Tidup, make MarkingState a private enum inside GCMarker r=sfink
[gecko.git] / layout / mathml / nsMathMLmactionFrame.h
blobc2fd7089d10127713a345a0eacc61056f0027da3
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/. */
7 #ifndef nsMathMLmactionFrame_h___
8 #define nsMathMLmactionFrame_h___
10 #include "nsCOMPtr.h"
11 #include "nsMathMLSelectedFrame.h"
12 #include "nsIDOMEventListener.h"
13 #include "mozilla/Attributes.h"
15 namespace mozilla {
16 class PresShell;
17 } // namespace mozilla
20 // <maction> -- bind actions to a subexpression
23 class nsMathMLmactionFrame final : public nsMathMLSelectedFrame {
24 public:
25 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmactionFrame)
27 friend nsIFrame* NS_NewMathMLmactionFrame(mozilla::PresShell* aPresShell,
28 ComputedStyle* aStyle);
30 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
31 nsIFrame* aPrevInFlow) override;
33 void SetInitialChildList(ChildListID aListID,
34 nsFrameList&& aChildList) override;
36 virtual nsresult ChildListChanged(int32_t aModType) override;
38 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
39 int32_t aModType) override;
41 private:
42 void MouseClick();
43 void MouseOver();
44 void MouseOut();
46 class MouseListener final : public nsIDOMEventListener {
47 private:
48 ~MouseListener() = default;
50 public:
51 NS_DECL_ISUPPORTS
52 NS_DECL_NSIDOMEVENTLISTENER
54 explicit MouseListener(nsMathMLmactionFrame* aOwner) : mOwner(aOwner) {}
56 nsMathMLmactionFrame* mOwner;
59 protected:
60 explicit nsMathMLmactionFrame(ComputedStyle* aStyle,
61 nsPresContext* aPresContext)
62 : nsMathMLSelectedFrame(aStyle, aPresContext, kClassID) {}
63 virtual ~nsMathMLmactionFrame();
65 private:
66 int32_t mActionType;
67 int32_t mChildCount;
68 int32_t mSelection;
69 RefPtr<MouseListener> mListener;
71 // helper to return the frame for the attribute selection="number"
72 nsIFrame* GetSelectedFrame() override;
75 #endif /* nsMathMLmactionFrame_h___ */