michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsMathMLmactionFrame_h___ michael@0: #define nsMathMLmactionFrame_h___ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsMathMLSelectedFrame.h" michael@0: #include "nsIDOMEventListener.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: // michael@0: // -- bind actions to a subexpression michael@0: // michael@0: michael@0: class nsMathMLmactionFrame : public nsMathMLSelectedFrame { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: virtual void michael@0: Init(nsIContent* aContent, michael@0: nsIFrame* aParent, michael@0: nsIFrame* aPrevInFlow) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: SetInitialChildList(ChildListID aListID, michael@0: nsFrameList& aChildList) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: ChildListChanged(int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: void MouseClick(); michael@0: void MouseOver(); michael@0: void MouseOut(); michael@0: michael@0: class MouseListener MOZ_FINAL : public nsIDOMEventListener michael@0: { michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIDOMEVENTLISTENER michael@0: michael@0: MouseListener(nsMathMLmactionFrame* aOwner) : mOwner(aOwner) { } michael@0: michael@0: nsMathMLmactionFrame* mOwner; michael@0: }; michael@0: michael@0: protected: michael@0: nsMathMLmactionFrame(nsStyleContext* aContext) : michael@0: nsMathMLSelectedFrame(aContext) {} michael@0: virtual ~nsMathMLmactionFrame(); michael@0: michael@0: private: michael@0: int32_t mActionType; michael@0: int32_t mChildCount; michael@0: int32_t mSelection; michael@0: nsRefPtr mListener; michael@0: michael@0: // helper to return the frame for the attribute selection="number" michael@0: nsIFrame* michael@0: GetSelectedFrame() MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: #endif /* nsMathMLmactionFrame_h___ */