~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/layout/mathml/base/src/nsMathMLmoFrame.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Mozilla Public
 
3
 * License Version 1.1 (the "License"); you may not use this file
 
4
 * except in compliance with the License. You may obtain a copy of
 
5
 * the License at http://www.mozilla.org/MPL/
 
6
 * 
 
7
 * Software distributed under the License is distributed on an "AS
 
8
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
 * implied. See the License for the specific language governing
 
10
 * rights and limitations under the License.
 
11
 * 
 
12
 * The Original Code is Mozilla MathML Project.
 
13
 * 
 
14
 * The Initial Developer of the Original Code is The University Of 
 
15
 * Queensland.  Portions created by The University Of Queensland are
 
16
 * Copyright (C) 1999 The University Of Queensland.  All Rights Reserved.
 
17
 * 
 
18
 * Contributor(s): 
 
19
 *   Roger B. Sidje <rbs@maths.uq.edu.au>
 
20
 *   David J. Fiddes <D.J.Fiddes@hw.ac.uk>
 
21
 *   Shyjan Mahamud <mahamud@cs.cmu.edu>
 
22
 */
 
23
 
 
24
#ifndef nsMathMLmoFrame_h___
 
25
#define nsMathMLmoFrame_h___
 
26
 
 
27
#include "nsCOMPtr.h"
 
28
#include "nsMathMLTokenFrame.h"
 
29
 
 
30
//
 
31
// <mo> -- operator, fence, or separator
 
32
//
 
33
 
 
34
class nsMathMLmoFrame : public nsMathMLTokenFrame {
 
35
public:
 
36
  friend nsresult NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
 
37
 
 
38
  virtual nsIAtom* GetType() const;
 
39
 
 
40
  virtual void
 
41
  SetAdditionalStyleContext(PRInt32          aIndex, 
 
42
                            nsStyleContext*  aStyleContext);
 
43
  virtual nsStyleContext*
 
44
  GetAdditionalStyleContext(PRInt32 aIndex) const;
 
45
 
 
46
  NS_IMETHOD
 
47
  Paint(nsIPresContext*      aPresContext,
 
48
        nsIRenderingContext& aRenderingContext,
 
49
        const nsRect&        aDirtyRect,
 
50
        nsFramePaintLayer    aWhichLayer,
 
51
        PRUint32             aFlags = 0);
 
52
 
 
53
  NS_IMETHOD
 
54
  InheritAutomaticData(nsIPresContext* aPresContext,
 
55
                       nsIFrame*       aParent);
 
56
 
 
57
  NS_IMETHOD
 
58
  TransmitAutomaticData(nsIPresContext* aPresContext);
 
59
 
 
60
  NS_IMETHOD
 
61
  Reflow(nsIPresContext*          aPresContext,
 
62
         nsHTMLReflowMetrics&     aDesiredSize,
 
63
         const nsHTMLReflowState& aReflowState,
 
64
         nsReflowStatus&          aStatus);
 
65
 
 
66
  NS_IMETHOD
 
67
  ReflowDirtyChild(nsIPresShell* aPresShell,
 
68
                   nsIFrame*     aChild);
 
69
 
 
70
  NS_IMETHOD
 
71
  AttributeChanged(nsIPresContext* aPresContext,
 
72
                   nsIContent*     aContent,
 
73
                   PRInt32         aNameSpaceID,
 
74
                   nsIAtom*        aAttribute,
 
75
                   PRInt32         aModType);
 
76
 
 
77
  // This method is called by the parent frame to ask <mo> 
 
78
  // to stretch itself.
 
79
  NS_IMETHOD
 
80
  Stretch(nsIPresContext*      aPresContext,
 
81
          nsIRenderingContext& aRenderingContext,
 
82
          nsStretchDirection   aStretchDirection,
 
83
          nsBoundingMetrics&   aContainerSize,
 
84
          nsHTMLReflowMetrics& aDesiredStretchSize);
 
85
 
 
86
protected:
 
87
  nsMathMLmoFrame();
 
88
  virtual ~nsMathMLmoFrame();
 
89
  
 
90
  virtual PRIntn GetSkipSides() const { return 0; }
 
91
 
 
92
  nsMathMLChar     mMathMLChar; // Here is the MathMLChar that will deal with the operator.
 
93
  nsOperatorFlags  mFlags;
 
94
  float            mMinSize;
 
95
  float            mMaxSize;
 
96
 
 
97
  // overload the base method so that we can setup our nsMathMLChar
 
98
  virtual void
 
99
  ProcessTextData(nsIPresContext* aPresContext);
 
100
 
 
101
  // helper to get our 'form' and lookup in the Operator Dictionary to fetch 
 
102
  // our default data that may come from there, and to complete the setup
 
103
  // using attributes that we may have
 
104
  void
 
105
  ProcessOperatorData(nsIPresContext* aPresContext);
 
106
 
 
107
  // helper to double check thar our char should be rendered as a selected char
 
108
  PRBool
 
109
  IsFrameInSelection(nsIPresContext* aPresContext,
 
110
                     nsIFrame*       aFrame);
 
111
};
 
112
 
 
113
#endif /* nsMathMLmoFrame_h___ */