commonuisupport/grid/tef/TESTIMG.H
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code  
       
    19 */
       
    20 
       
    21 #if !defined(__TESTIMG_H__)
       
    22 #define __TESTIMG_H__
       
    23 
       
    24 #if !defined(__E32STD_H__)
       
    25 #include <e32std.h>
       
    26 #endif
       
    27 #if !defined(__GRDSTD_H__)
       
    28 #include <grdstd.h>
       
    29 #endif
       
    30 
       
    31 //! A derived class from CBase and MGridTable interface.\n
       
    32 /**
       
    33  Grid Table class for TCoGridStep application.\n
       
    34 */
       
    35 
       
    36 class CTestGridTable : public CBase,public MGridTable
       
    37 	{
       
    38 public:
       
    39 	CTestGridTable();
       
    40 	virtual TBool RequestRow(TInt aRow,TInt& aReturnRow) const;
       
    41 public:
       
    42 	TBool iZeroRows;	// !! OK for test code
       
    43 	};
       
    44 //! A CGridCellImg derived class.\n
       
    45 /**
       
    46  Grid Label class for TCoGridStep application.\n
       
    47 */
       
    48 class CTestLabelImg : public CGridLabelImg
       
    49 	{
       
    50 public:
       
    51 	enum {
       
    52 		ESideLabelMarginWidthInTwips=120,
       
    53 		ERowCursorDiameterInPixels=10
       
    54 		};
       
    55 public:
       
    56 	CTestLabelImg(const TFontSpec& aFontSpec,MGraphicsDeviceMap* aGraphicsDeviceMap);
       
    57 	virtual void DrawRowLabelL(CGraphicsContext *aGc,TInt aRow,const TRect &aRect) const;
       
    58 	virtual void DrawColLabelL(CGraphicsContext *aGc,TInt aCol,const TRect &aRect) const;
       
    59 	virtual TInt SideLabelWidthInPixels(TInt aStartRow,TInt aEndRow) const;
       
    60 	virtual void DrawRowCursorL(CGraphicsContext* aGc,const TRect& aRect) const;
       
    61 	virtual void DrawTopLeftLabelL(CGraphicsContext* aGc,const TRect& aRect) const;
       
    62 	};
       
    63 
       
    64 class CFont;
       
    65 //! A CGridCellImg derived class.\n
       
    66 /**
       
    67  Grid cell class for TCoGridStep application.\n
       
    68 */
       
    69 class CTestCellImg : public CGridCellImg
       
    70 	{
       
    71 public:
       
    72 	CTestCellImg(const CFont *aFont);
       
    73 	virtual void DrawL(CGraphicsContext *aGc,const TCellRef &aCell,const TRect &aRect,
       
    74 		const TRect& aClipRect) const;
       
    75 	virtual TInt DataWidthInPixelsL(const TCellRef& aCell) const;
       
    76 	virtual TBool DoesCellContainDataL(const TCellRef& aCell) const;
       
    77 private:
       
    78 	const TDesC* GetL(TInt aRow,TInt aCol) const;
       
    79 	CTestCellImg& operator=(const CTestCellImg&);//not implemented
       
    80 private:
       
    81 	enum { ENumberOfItems=5 };
       
    82 private:
       
    83 	const CFont* iFont;
       
    84 	struct STestData
       
    85 		{
       
    86 		TCellRef iPos;
       
    87 		TBuf<32> iBuf;
       
    88 		};
       
    89 	STestData iData[ENumberOfItems];	//!!! Very crude but only for testing purposes
       
    90 	};
       
    91 
       
    92 
       
    93 #endif