Back to index

lightning-sunbird  0.9+nobinonly
nsMathMLmtableFrame.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla MathML Project.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * The University Of Queensland.
00018  * Portions created by the Initial Developer are Copyright (C) 1999
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Roger B. Sidje <rbs@maths.uq.edu.au>
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef nsMathMLmtableFrame_h___
00039 #define nsMathMLmtableFrame_h___
00040 
00041 #include "nsCOMPtr.h"
00042 #include "nsMathMLContainerFrame.h"
00043 
00044 //
00045 // <mtable> -- table or matrix
00046 //
00047 
00048 class nsMathMLmtableOuterFrame : public nsTableOuterFrame,
00049                                  public nsMathMLFrame
00050 {
00051 public:
00052   friend nsresult NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
00053 
00054   NS_DECL_ISUPPORTS_INHERITED
00055 
00056   // Overloaded nsIMathMLFrame methods
00057 
00058   NS_IMETHOD
00059   InheritAutomaticData(nsIFrame* aParent);
00060 
00061   NS_IMETHOD
00062   UpdatePresentationDataFromChildAt(PRInt32         aFirstIndex,
00063                                     PRInt32         aLastIndex,
00064                                     PRInt32         aScriptLevelIncrement,
00065                                     PRUint32        aFlagsValues,
00066                                     PRUint32        aFlagsToUpdate)
00067   {
00068     nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(this,
00069       aFirstIndex, aLastIndex, aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
00070     return NS_OK;
00071   }
00072 
00073   NS_IMETHOD
00074   ReResolveScriptStyle(PRInt32 aParentScriptLevel)
00075   {
00076     nsMathMLContainerFrame::PropagateScriptStyleFor(this, aParentScriptLevel);
00077     return NS_OK;
00078   }
00079 
00080   // overloaded nsTableOuterFrame methods
00081 
00082   NS_IMETHOD
00083   Init(nsPresContext*  aPresContext,
00084        nsIContent*      aContent,
00085        nsIFrame*        aParent,
00086        nsStyleContext*  aContext,
00087        nsIFrame*        aPrevInFlow);
00088 
00089   NS_IMETHOD
00090   Reflow(nsPresContext*          aPresContext,
00091          nsHTMLReflowMetrics&     aDesiredSize,
00092          const nsHTMLReflowState& aReflowState,
00093          nsReflowStatus&          aStatus);
00094 
00095   virtual PRBool IsFrameOfType(PRUint32 aFlags) const;
00096 
00097 protected:
00098   nsMathMLmtableOuterFrame();
00099   virtual ~nsMathMLmtableOuterFrame();
00100 
00101   // helper to find the row frame at a given index, positive or negative, e.g.,
00102   // 1..n means the first row down to the last row, -1..-n means the last row
00103   // up to the first row. Used for alignments that are relative to a given row
00104   nsIFrame*
00105   GetRowFrameAt(nsPresContext* aPresContext,
00106                 PRInt32         aRowIndex);
00107 }; // class nsMathMLmtableOuterFrame
00108 
00109 // --------------
00110 
00111 class nsMathMLmtdFrame : public nsTableCellFrame
00112 {
00113 public:
00114   friend nsresult NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
00115 
00116   NS_DECL_ISUPPORTS_INHERITED
00117 
00118   // overloaded nsTableCellFrame methods
00119   virtual PRInt32 GetRowSpan();
00120   virtual PRInt32 GetColSpan();
00121   virtual PRBool IsFrameOfType(PRUint32 aFlags) const;
00122 
00123 protected:
00124   nsMathMLmtdFrame();
00125   virtual ~nsMathMLmtdFrame();
00126 }; // class nsMathMLmtdFrame
00127 
00128 // --------------
00129 
00130 class nsMathMLmtdInnerFrame : public nsBlockFrame,
00131                               public nsMathMLFrame {
00132 public:
00133   friend nsresult NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
00134 
00135   NS_DECL_ISUPPORTS_INHERITED
00136 
00137   // Overloaded nsIMathMLFrame methods
00138 
00139   NS_IMETHOD
00140   UpdatePresentationDataFromChildAt(PRInt32         aFirstIndex,
00141                                     PRInt32         aLastIndex,
00142                                     PRInt32         aScriptLevelIncrement,
00143                                     PRUint32        aFlagsValues,
00144                                     PRUint32        aFlagsToUpdate)
00145   {
00146     nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(this,
00147       aFirstIndex, aLastIndex, aScriptLevelIncrement, aFlagsValues, aFlagsToUpdate);
00148     return NS_OK;
00149   }
00150 
00151   NS_IMETHOD
00152   ReResolveScriptStyle(PRInt32 aParentScriptLevel)
00153   {
00154     nsMathMLContainerFrame::PropagateScriptStyleFor(this, aParentScriptLevel);
00155     return NS_OK;
00156   }
00157 
00158   // overloaded nsBlockFrame methods
00159 
00160   NS_IMETHOD
00161   Init(nsPresContext*  aPresContext,
00162        nsIContent*      aContent,
00163        nsIFrame*        aParent,
00164        nsStyleContext*  aContext,
00165        nsIFrame*        aPrevInFlow);
00166 
00167   NS_IMETHOD
00168   Reflow(nsPresContext*          aPresContext,
00169          nsHTMLReflowMetrics&     aDesiredSize,
00170          const nsHTMLReflowState& aReflowState,
00171          nsReflowStatus&          aStatus);
00172   virtual PRBool IsFrameOfType(PRUint32 aFlags) const;
00173 
00174 protected:
00175   nsMathMLmtdInnerFrame();
00176   virtual ~nsMathMLmtdInnerFrame();
00177 
00178   virtual PRIntn GetSkipSides() const { return 0; }
00179 };  // class nsMathMLmtdInnerFrame
00180 
00181 #endif /* nsMathMLmtableFrame_h___ */