classicui_plat/fonts_api/tsrc/inc/testsdkfonts.h
branchRCL_3
changeset 19 aecbbf00d063
equal deleted inserted replaced
18:fcdfafb36fe7 19:aecbbf00d063
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  test fonts api
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_TESTSDKFONTS_H
       
    21 #define C_TESTSDKFONTS_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <stiflogger.h>
       
    25 #include <testscripterinternal.h>
       
    26 #include <stiftestmodule.h>
       
    27 #include <testclassassert.h>
       
    28 
       
    29 #include <aknfontaccess.h> 
       
    30 #include <stringloader.h> 
       
    31 #include <gdi.h>
       
    32 #include <coemain.h>
       
    33 
       
    34 #include <aknlayoutfont.h> 
       
    35 #include <aknfontspecification.h>
       
    36 #include <akntextdecorationmetrics.h>
       
    37 #include <fbs.h>
       
    38 #include <akntextdecorationmetrics.h>
       
    39 #include <fntstore.h>
       
    40 #include <aknutils.h> 
       
    41 
       
    42 
       
    43 
       
    44 // MACROS
       
    45 #define TEST_CLASS_VERSION_MAJOR 0
       
    46 #define TEST_CLASS_VERSION_MINOR 0
       
    47 #define TEST_CLASS_VERSION_BUILD 0
       
    48 
       
    49 // Logging path
       
    50 _LIT( KtestsdkfontsLogPath, "\\logs\\testframework\\testsdkfonts\\" ); 
       
    51 // Log file
       
    52 _LIT( KtestsdkfontsLogFile, "testsdkfonts.txt" ); 
       
    53 _LIT( KtestsdkfontsLogFileWithTitle, "testsdkfonts_[%S].txt" );
       
    54 
       
    55 /**
       
    56 *  Ctestsdkfonts test class for STIF Test Framework TestScripter.
       
    57 *  @since S60 5.0
       
    58 */
       
    59 NONSHARABLE_CLASS( CTestSdkFonts ) : public CScriptBase
       
    60     {
       
    61 public:  // Constructors and destructor
       
    62 
       
    63     /**
       
    64     * Two-phased constructor.
       
    65     */
       
    66     static CTestSdkFonts* NewL( CTestModuleIf& aTestModuleIf );
       
    67 
       
    68     /**
       
    69     * Destructor.
       
    70     */
       
    71     virtual ~CTestSdkFonts();
       
    72 
       
    73 public: // Functions from base classes
       
    74 
       
    75     /**
       
    76     * From CScriptBase Runs a script line.
       
    77     * @since S60 5.0
       
    78     * @param aItem Script line containing method name and parameters
       
    79     * @return Symbian OS error code
       
    80     */
       
    81     virtual TInt RunMethodL( CStifItemParser& aItem );
       
    82 
       
    83 private:
       
    84 
       
    85     /**
       
    86     * C++ default constructor.
       
    87     */
       
    88     CTestSdkFonts( CTestModuleIf& aTestModuleIf );
       
    89 
       
    90     /**
       
    91     * By default Symbian 2nd phase constructor is private.
       
    92     */
       
    93     void ConstructL();
       
    94     
       
    95     /**
       
    96      * Method used to log version of test class
       
    97      */
       
    98     void SendTestClassVersion();
       
    99 
       
   100 private: // AknFontAccess.h
       
   101     /**
       
   102     * TestFAGetFont test function in class AknFontAccess for testing the GetFontL function
       
   103     * @since S60 5.0
       
   104     * @param aItem never used
       
   105     * @return Symbian OS error code.
       
   106     */
       
   107     virtual TInt TestFAGetFont( CStifItemParser& aItem );
       
   108     
       
   109     /**
       
   110     * TestFAGetFontDesc test function in class AknFontAccess for testing the GetFont function
       
   111     * @since S60 5.0
       
   112     * @param aItem never used
       
   113     * @return Symbian OS error code.
       
   114     */
       
   115     virtual TInt TestFAGetFontDesc( CStifItemParser& aItem );
       
   116     
       
   117     /**
       
   118     * TestFAGetClosestFont test function in class AknFontAccess for testing the GetClosestFontL function
       
   119     * @since S60 5.0
       
   120     * @param aItem never used
       
   121     * @return Symbian OS error code.
       
   122     */
       
   123     virtual TInt TestFAGetClosestFont( CStifItemParser& aItem );
       
   124     
       
   125     /**
       
   126     * TestFAGetClosestFontDesc test function in class AknFontAccess for testing the GetClosestFontL function
       
   127     * @since S60 5.0
       
   128     * @param aItem never used
       
   129     * @return Symbian OS error code.
       
   130     */
       
   131     virtual TInt TestFAGetClosestFontDesc( CStifItemParser& aItem );
       
   132     
       
   133     /**
       
   134     * TestFACreateLayoutFontFromSpecificationL test function in class CreateLayoutFontFromSpecificationL for testing the GetClosestFontL function
       
   135     * @since S60 5.0
       
   136     * @param aItem never used
       
   137     * @return Symbian OS error code.
       
   138     */
       
   139     virtual TInt TestFACreateLayoutFontFromSpecificationL( CStifItemParser& aItem );
       
   140     
       
   141     /**
       
   142     * TestFACreateLayoutFontFromSpecificationTTypefaceL test function in class CreateLayoutFontFromSpecificationL for testing the GetClosestFontL function
       
   143     * @since S60 5.0
       
   144     * @param aItem never used
       
   145     * @return Symbian OS error code.
       
   146     */
       
   147     virtual TInt TestFACreateLayoutFontFromSpecificationTTypefaceL( CStifItemParser& aItem );
       
   148     
       
   149     
       
   150 private: // CAknLayoutFont.h
       
   151     /**
       
   152     * TestLFUpdateL test function in class CAknLayoutFont for testing the UpdateL function
       
   153     * @since S60 5.0
       
   154     * @param aItem never used
       
   155     * @return Symbian OS error code.
       
   156     */
       
   157     virtual TInt TestLFUpdateL( CStifItemParser& aItem );
       
   158     
       
   159     /**
       
   160     * TestLFMaxAscentL test function in class CAknLayoutFont for testing the MaxAscentL function
       
   161     * @since S60 5.0
       
   162     * @param aItem never used
       
   163     * @return Symbian OS error code.
       
   164     */
       
   165     virtual TInt TestLFMaxAscentL( CStifItemParser& aItem );
       
   166     
       
   167     /**
       
   168     * TestLFMaxDescentL test function in class CAknLayoutFont for testing the MaxDescentL function
       
   169     * @since S60 5.0
       
   170     * @param aItem never used
       
   171     * @return Symbian OS error code.
       
   172     */
       
   173     virtual TInt TestLFMaxDescentL( CStifItemParser& aItem );
       
   174     
       
   175     /**
       
   176     * TestLFTextPaneTopToBaselineL test function in class CAknLayoutFont for testing the TextPaneTopToBaselineL function
       
   177     * @since S60 5.0
       
   178     * @param aItem never used
       
   179     * @return Symbian OS error code.
       
   180     */
       
   181     virtual TInt TestLFTextPaneTopToBaselineL( CStifItemParser& aItem );
       
   182     
       
   183     
       
   184     /**
       
   185     * TestLFBaselineToTextPaneBottomL test function in class CAknLayoutFont for testing the BaselineToTextPaneBottomL function
       
   186     * Position of the text pane bottom measured down from the baseline
       
   187     * @return distance from text pane top to baseline
       
   188     */
       
   189     virtual TInt TestLFBaselineToTextPaneBottomL( CStifItemParser& aItem );
       
   190 
       
   191     /**
       
   192     * TestLFTextPaneHeightL test function in class CAknLayoutFont for testing the TextPaneHeightL function
       
   193     * Series 60 text pane height. 
       
   194     * Always equal to TextPaneTopToBaseline() + BaselineToTextPaneBottom()
       
   195     * @return text pane height
       
   196     */
       
   197     virtual TInt TestLFTextPaneHeightL( CStifItemParser& aItem );
       
   198 
       
   199     /**
       
   200     * TestLFAscentForCharacterL test function in class CAknLayoutFont for testing the AscentForCharacterL function
       
   201     * This provides the baseline relative to the top of the combined font for a specific 
       
   202     * character code. This value does not include any TopShortfall.
       
   203     **/
       
   204     virtual TInt TestLFAscentForCharacterL( CStifItemParser& aItem );
       
   205 
       
   206     /**
       
   207     * TestLFAsCAknLayoutFontOrNullL test function in class CAknLayoutFont for testing the AsCAknLayoutFontOrNullL function
       
   208     * Returns if a font pointer cast to this type if the actual type conforms to this type. 
       
   209     * @returns NULL if the font does not conform to CAknLayoutFont.
       
   210     */
       
   211     virtual TInt TestLFAsCAknLayoutFontOrNullL( CStifItemParser& aItem );
       
   212 
       
   213     /**
       
   214     * TestLFTextDecorationMetricsL test function in class CAknLayoutFont for testing the TextDecorationMetricsL function
       
   215     * Returns an object describing how the text with this font is to be decorated
       
   216     * @return   text decoration metrics for the font
       
   217     */
       
   218     virtual TInt TestLFTextDecorationMetricsL( CStifItemParser& aItem );
       
   219 
       
   220     /**
       
   221     * TestLFFontCategoryL test function in class CAknLayoutFont for testing the FontCategoryL function
       
   222     * Returns the Avkon font category (EAknFontCategoryPrimary, EAknFontCategorySecondary...)
       
   223     * that was used to generate this font.
       
   224     * @return   font category
       
   225     */
       
   226     virtual TInt TestLFFontCategoryL( CStifItemParser& aItem );
       
   227 
       
   228     /**
       
   229     * TestLFFontSpecificationL test function in class CAknLayoutFont for testing the FontSpecificationL function
       
   230     * This API allows the font to provide the metrics under which the font was requested.
       
   231     * @return   the font specification for which the font has been supplied
       
   232     */
       
   233     virtual TInt TestLFFontSpecificationL( CStifItemParser& aItem );
       
   234 
       
   235 private: // TAknTextDecorationMetrics.h
       
   236     /**
       
   237     * TestTDMTAknTextDecorationMetrics test function in class TAknTextDecorationMetricsL for testing the TAknTextDecorationMetricsSpec function
       
   238     * @since S60 5.0
       
   239     * @param aItem never used
       
   240     * @return Symbian OS error code.
       
   241     */
       
   242     virtual TInt TestTDMTAknTextDecorationMetricsL( CStifItemParser& aItem );
       
   243     
       
   244     /**
       
   245     * TestTDMTAknTextDecorationMetricsFont test function in class TAknTextDecorationMetricsFontL for testing the TAknTextDecorationMetricsSpecL function
       
   246     * @since S60 5.0
       
   247     * @param aItem never used
       
   248     * @return Symbian OS error code.
       
   249     */
       
   250     virtual TInt TestTDMTAknTextDecorationMetricsFontL( CStifItemParser& aItem );
       
   251     
       
   252     /**
       
   253     * TestTDMTAknTextDecorationMetricsSpec test function in class TAknTextDecorationMetricsSpecL for testing the TAknTextDecorationMetricsSpecL function
       
   254     * @since S60 5.0
       
   255     * @param aItem never used
       
   256     * @return Symbian OS error code.
       
   257     */
       
   258     virtual TInt TestTDMTAknTextDecorationMetricsSpecL( CStifItemParser& aItem );
       
   259     
       
   260     /**
       
   261     * TestTDMGetLeftAndRightMargins test function in class TAknTextDecorationMetricsL for testing the GetLeftAndRightMarginsL function
       
   262     * @since S60 5.0
       
   263     * @param aItem never used
       
   264     * @return Symbian OS error code.
       
   265     */
       
   266     virtual TInt TestTDMGetLeftAndRightMarginsL( CStifItemParser& aItem );
       
   267     
       
   268     /**
       
   269     * TestTDMGetTopAndBottomMargins test function in class TAknTextDecorationMetricsL for testing the GetTopAndBottomMarginsL function
       
   270     * @since S60 5.0
       
   271     * @param aItem never used
       
   272     * @return Symbian OS error code.
       
   273     */
       
   274     virtual TInt TestTDMGetTopAndBottomMarginsL( CStifItemParser& aItem );
       
   275     
       
   276     /**
       
   277     * TestTDMCursorWidth test function in class TAknTextDecorationMetricsL for testing the CursorWidthL function
       
   278     * @since S60 5.0
       
   279     * @param aItem never used
       
   280     * @return Symbian OS error code.
       
   281     */
       
   282     virtual TInt TestTDMCursorWidthL( CStifItemParser& aItem );
       
   283     
       
   284     /**
       
   285     * TestTDMBaselineToUnderlineOffset test function in class TAknTextDecorationMetricsL for testing the BaselineToUnderlineOffsetL function
       
   286     * @since S60 5.0
       
   287     * @param aItem never used
       
   288     * @return Symbian OS error code.
       
   289     */
       
   290     virtual TInt TestTDMBaselineToUnderlineOffsetL( CStifItemParser& aItem );
       
   291     
       
   292     /**
       
   293     * TestTDMUnderlineHeight test function in class TAknTextDecorationMetricsL for testing the UnderlineHeightL function
       
   294     * @since S60 5.0
       
   295     * @param aItem never used
       
   296     * @return Symbian OS error code.
       
   297     */
       
   298     virtual TInt TestTDMUnderlineHeightL( CStifItemParser& aItem );
       
   299     
       
   300     
       
   301 private:    // Data
       
   302 
       
   303     /**
       
   304      * ScreenSaver Property
       
   305      */
       
   306     TInt iOldScreenSaverProperty;
       
   307     /**
       
   308      * Pointer to a control, maybe you need one in your test
       
   309      * own
       
   310      */
       
   311     AknFontAccess* iFontAccess;
       
   312     
       
   313     };
       
   314 
       
   315 
       
   316 
       
   317 #endif      // C_TESTSDKFONTS_H
       
   318 
       
   319 // End of File