/src/mozilla-central/layout/mathml/nsMathMLmactionFrame.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 nsMathMLmactionFrame_h___ |
8 | | #define nsMathMLmactionFrame_h___ |
9 | | |
10 | | #include "nsCOMPtr.h" |
11 | | #include "nsMathMLSelectedFrame.h" |
12 | | #include "nsIDOMEventListener.h" |
13 | | #include "mozilla/Attributes.h" |
14 | | |
15 | | // |
16 | | // <maction> -- bind actions to a subexpression |
17 | | // |
18 | | |
19 | | class nsMathMLmactionFrame final : public nsMathMLSelectedFrame |
20 | | { |
21 | | public: |
22 | | NS_DECL_FRAMEARENA_HELPERS(nsMathMLmactionFrame) |
23 | | |
24 | | friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle); |
25 | | |
26 | | virtual void |
27 | | Init(nsIContent* aContent, |
28 | | nsContainerFrame* aParent, |
29 | | nsIFrame* aPrevInFlow) override; |
30 | | |
31 | | virtual void |
32 | | SetInitialChildList(ChildListID aListID, |
33 | | nsFrameList& aChildList) override; |
34 | | |
35 | | virtual nsresult |
36 | | ChildListChanged(int32_t aModType) override; |
37 | | |
38 | | virtual nsresult |
39 | | AttributeChanged(int32_t aNameSpaceID, |
40 | | nsAtom* aAttribute, |
41 | | int32_t aModType) override; |
42 | | |
43 | | private: |
44 | | void MouseClick(); |
45 | | void MouseOver(); |
46 | | void MouseOut(); |
47 | | |
48 | | class MouseListener final : public nsIDOMEventListener |
49 | | { |
50 | | private: |
51 | 0 | ~MouseListener() {} |
52 | | |
53 | | public: |
54 | | NS_DECL_ISUPPORTS |
55 | | NS_DECL_NSIDOMEVENTLISTENER |
56 | | |
57 | 0 | explicit MouseListener(nsMathMLmactionFrame* aOwner) : mOwner(aOwner) { } |
58 | | |
59 | | nsMathMLmactionFrame* mOwner; |
60 | | }; |
61 | | |
62 | | protected: |
63 | | explicit nsMathMLmactionFrame(ComputedStyle* aStyle) : |
64 | 0 | nsMathMLSelectedFrame(aStyle, kClassID) {} |
65 | | virtual ~nsMathMLmactionFrame(); |
66 | | |
67 | | private: |
68 | | int32_t mActionType; |
69 | | int32_t mChildCount; |
70 | | int32_t mSelection; |
71 | | RefPtr<MouseListener> mListener; |
72 | | |
73 | | // helper to return the frame for the attribute selection="number" |
74 | | nsIFrame* |
75 | | GetSelectedFrame() override; |
76 | | }; |
77 | | |
78 | | #endif /* nsMathMLmactionFrame_h___ */ |