layout/mathml/nsMathMLmactionFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/mathml/nsMathMLmactionFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsMathMLmactionFrame_h___
    1.10 +#define nsMathMLmactionFrame_h___
    1.11 +
    1.12 +#include "nsCOMPtr.h"
    1.13 +#include "nsMathMLSelectedFrame.h"
    1.14 +#include "nsIDOMEventListener.h"
    1.15 +#include "mozilla/Attributes.h"
    1.16 +
    1.17 +//
    1.18 +// <maction> -- bind actions to a subexpression
    1.19 +//
    1.20 +
    1.21 +class nsMathMLmactionFrame : public nsMathMLSelectedFrame {
    1.22 +public:
    1.23 +  NS_DECL_FRAMEARENA_HELPERS
    1.24 +
    1.25 +  friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    1.26 +
    1.27 +  virtual void
    1.28 +  Init(nsIContent*      aContent,
    1.29 +       nsIFrame*        aParent,
    1.30 +       nsIFrame*        aPrevInFlow) MOZ_OVERRIDE;
    1.31 +
    1.32 +  virtual nsresult
    1.33 +  SetInitialChildList(ChildListID     aListID,
    1.34 +                      nsFrameList&    aChildList) MOZ_OVERRIDE;
    1.35 +
    1.36 +  virtual nsresult
    1.37 +  ChildListChanged(int32_t aModType) MOZ_OVERRIDE;
    1.38 +
    1.39 +  virtual nsresult
    1.40 +  AttributeChanged(int32_t  aNameSpaceID,
    1.41 +                   nsIAtom* aAttribute,
    1.42 +                   int32_t  aModType) MOZ_OVERRIDE;
    1.43 +
    1.44 +private:
    1.45 +  void MouseClick();
    1.46 +  void MouseOver();
    1.47 +  void MouseOut();
    1.48 +
    1.49 +  class MouseListener MOZ_FINAL : public nsIDOMEventListener
    1.50 +  {
    1.51 +    NS_DECL_ISUPPORTS
    1.52 +    NS_DECL_NSIDOMEVENTLISTENER
    1.53 +
    1.54 +    MouseListener(nsMathMLmactionFrame* aOwner) : mOwner(aOwner) { }
    1.55 +
    1.56 +    nsMathMLmactionFrame* mOwner;
    1.57 +  };
    1.58 +
    1.59 +protected:
    1.60 +  nsMathMLmactionFrame(nsStyleContext* aContext) :
    1.61 +    nsMathMLSelectedFrame(aContext) {}
    1.62 +  virtual ~nsMathMLmactionFrame();
    1.63 +  
    1.64 +private:
    1.65 +  int32_t         mActionType;
    1.66 +  int32_t         mChildCount;
    1.67 +  int32_t         mSelection;
    1.68 +  nsRefPtr<MouseListener> mListener;
    1.69 +
    1.70 +  // helper to return the frame for the attribute selection="number"
    1.71 +  nsIFrame* 
    1.72 +  GetSelectedFrame() MOZ_OVERRIDE;
    1.73 +};
    1.74 +
    1.75 +#endif /* nsMathMLmactionFrame_h___ */

mercurial