LCOV - code coverage report
Current view: directory - layout/generic - nsQueryFrame.h (source / functions) Found Hit Coverage
Test: app.info Lines: 6 0 0.0 %
Date: 2012-06-02 Functions: 44 0 0.0 %

       1                 : /* ***** BEGIN LICENSE BLOCK *****
       2                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       3                 :  *
       4                 :  * The contents of this file are subject to the Mozilla Public License Version
       5                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       6                 :  * the License. You may obtain a copy of the License at
       7                 :  * http://www.mozilla.org/MPL/
       8                 :  *
       9                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      10                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      11                 :  * for the specific language governing rights and limitations under the
      12                 :  * License.
      13                 :  *
      14                 :  * The Original Code is the Mozilla layout engine.
      15                 :  *
      16                 :  * The Initial Developer of the Original Code is
      17                 :  * the Mozilla Foundation <http://www.mozilla.org/>.
      18                 :  *
      19                 :  * Portions created by the Initial Developer are Copyright (C) 2008
      20                 :  * the Initial Developer. All Rights Reserved.
      21                 :  *
      22                 :  * Contributor(s):
      23                 :  *
      24                 :  * Alternatively, the contents of this file may be used under the terms of
      25                 :  * either the GNU General Public License Version 2 or later (the "GPL"), or
      26                 :  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      27                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      28                 :  * of those above. If you wish to allow use of your version of this file only
      29                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      30                 :  * use your version of this file under the terms of the MPL, indicate your
      31                 :  * decision by deleting the provisions above and replace them with the notice
      32                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      33                 :  * the provisions above, a recipient may use your version of this file under
      34                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      35                 :  *
      36                 :  * ***** END LICENSE BLOCK ***** */
      37                 : 
      38                 : #ifndef nsQueryFrame_h
      39                 : #define nsQueryFrame_h
      40                 : 
      41                 : #include "nscore.h"
      42                 : 
      43                 : #define NS_DECL_QUERYFRAME_TARGET(classname)                    \
      44                 :   static const nsQueryFrame::FrameIID kFrameIID = nsQueryFrame::classname##_id;
      45                 : 
      46                 : #define NS_DECL_QUERYFRAME                                      \
      47                 :   virtual void* QueryFrame(FrameIID id);
      48                 : 
      49                 : #define NS_QUERYFRAME_HEAD(class)                               \
      50                 :   void* class::QueryFrame(FrameIID id) { switch (id) {
      51                 : 
      52                 : #define NS_QUERYFRAME_ENTRY(class)                              \
      53                 :   case class::kFrameIID: return static_cast<class*>(this);
      54                 : 
      55                 : #define NS_QUERYFRAME_ENTRY_CONDITIONAL(class, condition)       \
      56                 :   case class::kFrameIID:                                        \
      57                 :   if (condition) return static_cast<class*>(this);              \
      58                 :   break;
      59                 : 
      60                 : #define NS_QUERYFRAME_TAIL_INHERITING(class)                    \
      61                 :   default: break;                                               \
      62                 :   }                                                             \
      63                 :   return class::QueryFrame(id);                                 \
      64                 : }
      65                 : 
      66                 : #define NS_QUERYFRAME_TAIL_INHERITANCE_ROOT                     \
      67                 :   default: break;                                               \
      68                 :   }                                                             \
      69                 :   return nsnull;                                                \
      70                 : }
      71                 : 
      72                 : class nsQueryFrame
      73               0 : {
      74                 : public:
      75                 :   enum FrameIID {
      76                 :     BRFrame_id,
      77                 :     nsAutoRepeatBoxFrame_id,
      78                 :     nsBCTableCellFrame_id,
      79                 :     nsBlockFrame_id,
      80                 :     nsBox_id,
      81                 :     nsBoxFrame_id,
      82                 :     nsBulletFrame_id,
      83                 :     nsButtonBoxFrame_id,
      84                 :     nsCanvasFrame_id,
      85                 :     nsColumnSetFrame_id,
      86                 :     nsComboboxControlFrame_id,
      87                 :     nsComboboxDisplayFrame_id,
      88                 :     nsContainerFrame_id,
      89                 :     nsContinuingTextFrame_id,
      90                 :     nsDeckFrame_id,
      91                 :     nsDocElementBoxFrame_id,
      92                 :     nsFieldSetFrame_id,
      93                 :     nsFileControlFrame_id,
      94                 :     nsFirstLetterFrame_id,
      95                 :     nsFirstLineFrame_id,
      96                 :     nsFormControlFrame_id,
      97                 :     nsFrame_id,
      98                 :     nsGfxButtonControlFrame_id,
      99                 :     nsGfxCheckboxControlFrame_id,
     100                 :     nsGfxRadioControlFrame_id,
     101                 :     nsGridRowGroupFrame_id,
     102                 :     nsGridRowLeafFrame_id,
     103                 :     nsGroupBoxFrame_id,
     104                 :     nsHTMLButtonControlFrame_id,
     105                 :     nsHTMLCanvasFrame_id,
     106                 :     nsHTMLFramesetBlankFrame_id,
     107                 :     nsHTMLFramesetBorderFrame_id,
     108                 :     nsHTMLFramesetFrame_id,
     109                 :     nsHTMLScrollFrame_id,
     110                 :     nsIAnonymousContentCreator_id,
     111                 :     nsIComboboxControlFrame_id,
     112                 :     nsIFormControlFrame_id,
     113                 :     nsIFrame_id,
     114                 :     nsIFrameFrame_id,
     115                 :     nsIListControlFrame_id,
     116                 :     nsIMathMLFrame_id,
     117                 :     nsIMenuFrame_id,
     118                 :     nsIObjectFrame_id,
     119                 :     nsIPageSequenceFrame_id,
     120                 :     nsIPercentHeightObserver_id,
     121                 :     nsIRootBox_id,
     122                 :     nsISVGChildFrame_id,
     123                 :     nsISVGGlyphFragmentLeaf_id,
     124                 :     nsISVGGlyphFragmentNode_id,
     125                 :     nsISVGSVGFrame_id,
     126                 :     nsIScrollableFrame_id,
     127                 :     nsIScrollbarMediator_id,
     128                 :     nsISelectControlFrame_id,
     129                 :     nsIStatefulFrame_id,
     130                 :     nsITableCellLayout_id,
     131                 :     nsITableLayout_id,
     132                 :     nsITextControlFrame_id,
     133                 :     nsITreeBoxObject_id,
     134                 :     nsImageBoxFrame_id,
     135                 :     nsImageControlFrame_id,
     136                 :     nsImageFrame_id,
     137                 :     nsInlineFrame_id,
     138                 :     nsLeafBoxFrame_id,
     139                 :     nsLeafFrame_id,
     140                 :     nsLegendFrame_id,
     141                 :     nsListBoxBodyFrame_id,
     142                 :     nsListControlFrame_id,
     143                 :     nsListItemFrame_id,
     144                 :     nsMathMLContainerFrame_id,
     145                 :     nsMathMLForeignFrameWrapper_id,
     146                 :     nsMathMLFrame_id,
     147                 :     nsMathMLmactionFrame_id,
     148                 :     nsMathMLmathBlockFrame_id,
     149                 :     nsMathMLmathInlineFrame_id,
     150                 :     nsMathMLmencloseFrame_id,
     151                 :     nsMathMLmfencedFrame_id,
     152                 :     nsMathMLmfracFrame_id,
     153                 :     nsMathMLmmultiscriptsFrame_id,
     154                 :     nsMathMLmoFrame_id,
     155                 :     nsMathMLmoverFrame_id,
     156                 :     nsMathMLmpaddedFrame_id,
     157                 :     nsMathMLmphantomFrame_id,
     158                 :     nsMathMLmrootFrame_id,
     159                 :     nsMathMLmrowFrame_id,
     160                 :     nsMathMLmspaceFrame_id,
     161                 :     nsMathMLmsqrtFrame_id,
     162                 :     nsMathMLmstyleFrame_id,
     163                 :     nsMathMLmsubFrame_id,
     164                 :     nsMathMLmsubsupFrame_id,
     165                 :     nsMathMLmsupFrame_id,
     166                 :     nsMathMLmtableFrame_id,
     167                 :     nsMathMLmtableOuterFrame_id,
     168                 :     nsMathMLmtdFrame_id,
     169                 :     nsMathMLmtdInnerFrame_id,
     170                 :     nsMathMLmtrFrame_id,
     171                 :     nsMathMLmunderFrame_id,
     172                 :     nsMathMLmunderoverFrame_id,
     173                 :     nsMathMLsemanticsFrame_id,
     174                 :     nsMathMLTokenFrame_id,
     175                 :     nsMenuBarFrame_id,
     176                 :     nsMenuFrame_id,
     177                 :     nsMenuPopupFrame_id,
     178                 :     nsObjectFrame_id,
     179                 :     nsPageBreakFrame_id,
     180                 :     nsPageContentFrame_id,
     181                 :     nsPageFrame_id,
     182                 :     nsPlaceholderFrame_id,
     183                 :     nsPopupSetFrame_id,
     184                 :     nsProgressFrame_id,
     185                 :     nsProgressMeterFrame_id,
     186                 :     nsResizerFrame_id,
     187                 :     nsRootBoxFrame_id,
     188                 :     nsScrollbarButtonFrame_id,
     189                 :     nsScrollbarFrame_id,
     190                 :     nsSelectsAreaFrame_id,
     191                 :     nsSimplePageSequenceFrame_id,
     192                 :     nsSliderFrame_id,
     193                 :     nsSplittableFrame_id,
     194                 :     nsSplitterFrame_id,
     195                 :     nsStackFrame_id,
     196                 :     nsSubDocumentFrame_id,
     197                 :     nsSVGAFrame_id,
     198                 :     nsSVGClipPathFrame_id,
     199                 :     nsSVGContainerFrame_id,
     200                 :     nsSVGDisplayContainerFrame_id,
     201                 :     SVGFEContainerFrame_id,
     202                 :     SVGFEImageFrame_id,
     203                 :     SVGFELeafFrame_id,
     204                 :     SVGFEUnstyledLeafFrame_id,
     205                 :     nsSVGFilterFrame_id,
     206                 :     nsSVGForeignObjectFrame_id,
     207                 :     nsSVGGenericContainerFrame_id,
     208                 :     nsSVGGeometryFrame_id,
     209                 :     nsSVGGFrame_id,
     210                 :     nsSVGGlyphFrame_id,
     211                 :     nsSVGGradientFrame_id,
     212                 :     nsSVGImageFrame_id,
     213                 :     nsSVGInnerSVGFrame_id,
     214                 :     nsSVGLinearGradientFrame_id,
     215                 :     nsSVGMarkerFrame_id,
     216                 :     nsSVGMaskFrame_id,
     217                 :     nsSVGOuterSVGFrame_id,
     218                 :     nsSVGPaintServerFrame_id,
     219                 :     nsSVGPathGeometryFrame_id,
     220                 :     nsSVGPatternFrame_id,
     221                 :     nsSVGRadialGradientFrame_id,
     222                 :     nsSVGStopFrame_id,
     223                 :     nsSVGSwitchFrame_id,
     224                 :     nsSVGTextContainerFrame_id,
     225                 :     nsSVGTextFrame_id,
     226                 :     nsSVGTextPathFrame_id,
     227                 :     nsSVGTSpanFrame_id,
     228                 :     nsSVGUseFrame_id,
     229                 :     nsTableCaptionFrame_id,
     230                 :     nsTableCellFrame_id,
     231                 :     nsTableColFrame_id,
     232                 :     nsTableColGroupFrame_id,
     233                 :     nsTableFrame_id,
     234                 :     nsTableOuterFrame_id,
     235                 :     nsTableRowFrame_id,
     236                 :     nsTableRowGroupFrame_id,
     237                 :     nsTextBoxFrame_id,
     238                 :     nsTextControlFrame_id,
     239                 :     nsTextFrame_id,
     240                 :     nsTitleBarFrame_id,
     241                 :     nsTreeBodyFrame_id,
     242                 :     nsTreeColFrame_id,
     243                 :     nsVideoFrame_id,
     244                 :     nsXULLabelFrame_id,
     245                 :     nsXULScrollFrame_id,
     246                 :     ViewportFrame_id,
     247                 : 
     248                 :     // The PresArena implementation uses this bit to distinguish
     249                 :     // objects allocated by size (that is, non-frames) from objects
     250                 :     // allocated by code (that is, frames).  It should not collide
     251                 :     // with any frame ID.  It is not 0x80000000 to avoid the question
     252                 :     // of whether enumeration constants are signed.
     253                 :     NON_FRAME_MARKER = 0x40000000
     254                 :   };
     255                 : 
     256                 :   virtual void* QueryFrame(FrameIID id) = 0;
     257                 : };
     258                 : 
     259                 : class do_QueryFrame
     260                 : {
     261                 : public:
     262               0 :   do_QueryFrame(nsQueryFrame *s) : mRawPtr(s) { }
     263                 : 
     264                 :   template<class Dest>
     265               0 :   operator Dest*() {
     266               0 :     if (!mRawPtr)
     267               0 :       return nsnull;
     268                 : 
     269               0 :     return reinterpret_cast<Dest*>(mRawPtr->QueryFrame(Dest::kFrameIID));
     270                 :   }
     271                 : 
     272                 : private:
     273                 :   nsQueryFrame *mRawPtr;
     274                 : };
     275                 : 
     276                 : #endif // nsQueryFrame_h

Generated by: LCOV version 1.7