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