uiresources_plat/layout_data_api/inc/AknLayout2Def.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNLAYOUT2DEF_H
       
    20 #define AKNLAYOUT2DEF_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <avkon.hrh>
       
    24 #include <AknLayout2Id.h>
       
    25 
       
    26 class TAknLayoutRect;
       
    27 class TAknWindowComponentLayout;
       
    28 class TAknTextComponentLayout;
       
    29 
       
    30 /**
       
    31 * Defines the valid range of a table lookup index.
       
    32 * A table index is valid if it satisfies iFirstIndex <= index <= iLastIndex
       
    33 */
       
    34 class TAknLayoutTableLimits
       
    35 	{
       
    36 public:
       
    37 	TInt iFirstIndex;
       
    38 	TInt iLastIndex;
       
    39 	};
       
    40 
       
    41 
       
    42 #define ELayoutP ((TInt16)16384)
       
    43 #define ELayoutPRange ((TInt16)8192)
       
    44 
       
    45 /**
       
    46 * A window line structure from layout.
       
    47 */
       
    48 class TAknWindowLineLayout
       
    49 	{
       
    50 public:
       
    51 	inline TAknWindowLineLayout() {}
       
    52 	inline TAknWindowLineLayout(TInt /*aDummy*/) {}
       
    53 
       
    54     IMPORT_C TAknWindowLineLayout( const TAknWindowComponentLayout& aLine );
       
    55     IMPORT_C TAknWindowLineLayout operator=(const TAknWindowComponentLayout& aLine);
       
    56 
       
    57 	/**
       
    58 	* Can this structure be used directly as a rectangle?
       
    59 	* @return ETrue when all of l,t,W,H are specified
       
    60 	*/
       
    61 	inline TBool IsRect() const;
       
    62 
       
    63     
       
    64     /**
       
    65 	* Convert this structure to a rectangle
       
    66 	* This is only valid when IsRect() returns ETrue.
       
    67 	* It is intended that this is used when the caller knows that the LAF line encoded in
       
    68 	* this structure is written with l, t, W and H specified, as is the case with many
       
    69 	* LAF lines.
       
    70     *
       
    71 	* THIS METHOD IS DEPRECATED, PLEASE DO NOT USE IT! USE OF THIS METHOD MAY RETURN UNEXPECTED VALUES IN SCALABLE UI.
       
    72     *
       
    73 	* Here's CORRECT WAY to do the same thing:
       
    74 	*  TRect parent = iAvkonAppUi->ClientRect(); // pick parent rectangle from existing control hierarchy.
       
    75 	*  TAknLayoutRect rect;
       
    76 	*  rect.LayoutRect(parent, AknLayout::xxxx() ); // TAknWindowLineLayout should go directly to LayoutRect/LayoutControl etc. methods
       
    77 	*  ... use rect.Rect().... // This one is VALID rectangle, calculated based on parent rectangle.
       
    78 	*
       
    79 	*  NOTE, the parent comes from _existing control hierarchy_ CCoeControl::Rect() or
       
    80 	*  from TAknLayoutRect::Rect() method.
       
    81     *
       
    82     *  BUT PLEASE, DO NOT USE TAknWindowLineLayout::Rect(), because it assumes invalid things
       
    83 	*  about our layout data. (the parent rectangle _needs_ to be provided to get a valid rectangle!)
       
    84     *
       
    85 	* THIS METHOD IS DEPRECATED, PLEASE DO NOT USE IT! USE OF THIS METHOD MAY RETURN UNEXPECTED VALUES IN SCALABLE UI.
       
    86     * @return a rectangle made from l, t, W and H
       
    87 	*/
       
    88 	inline TRect Rect() const;
       
    89 
       
    90 public: 
       
    91 	IMPORT_C static TAknWindowLineLayout CombineLines(TAknWindowLineLayout aLine, TAknWindowLineLayout aLine2);
       
    92 
       
    93 public: // Please DO NOT USE the data members below. Use of them breaks scalable ui. (only place that can use these is aknlayout2 module)
       
    94 	TInt16 iC;
       
    95 	TInt16 il;
       
    96 	TInt16 it;
       
    97 	TInt16 ir;
       
    98 	TInt16 ib;
       
    99 	TInt16 iW;
       
   100 	TInt16 iH;
       
   101 	};
       
   102 
       
   103 
       
   104 /**
       
   105 * A text line structure from layout.
       
   106 */
       
   107 class TAknTextLineLayout
       
   108 	{
       
   109 public:
       
   110 	inline TAknTextLineLayout() {}
       
   111 	inline TAknTextLineLayout(TInt /*aDummy*/) {}
       
   112 
       
   113 	inline TInt FontId() const { return iFont; }
       
   114 	inline TInt BaselineSkip() const { return iBaselineSkip; }
       
   115 	inline TInt NumberOfLinesShown() const { return iNumberOfLinesShown; }
       
   116 
       
   117     IMPORT_C TAknTextLineLayout( const TAknTextComponentLayout& aLine );
       
   118     IMPORT_C TAknTextLineLayout operator=(const TAknTextComponentLayout& aLine);
       
   119 
       
   120 public:  
       
   121     // Please DO NOT USE the data members below. They may contain unexpected values with scalable UI.
       
   122 	TInt16 iC;
       
   123 	TInt16 il;
       
   124 	TInt16 ir;
       
   125 	TInt16 iB;
       
   126 	TInt16 iW;
       
   127 	TInt16 iJ;
       
   128 	TInt32 iFont;
       
   129 
       
   130 	TInt iBaselineSkip;
       
   131 	TInt iNumberOfLinesShown;
       
   132 	};
       
   133 
       
   134 
       
   135 /**
       
   136 * A multiline text line structure from layout.
       
   137 * TAknMultiLineTextLayout is a specialisation of TAknTextLineLayout, but
       
   138 * the current implementation does not need to add anything (previous versions did).
       
   139 */
       
   140 class TAknMultiLineTextLayout : public TAknTextLineLayout
       
   141 	{
       
   142 	};
       
   143 
       
   144 
       
   145 
       
   146 inline TBool TAknWindowLineLayout::IsRect() const 
       
   147 	{ 
       
   148 	return (il!=ELayoutEmpty && it!=ELayoutEmpty && iW!=ELayoutEmpty && iH!=ELayoutEmpty); 
       
   149 	}
       
   150 
       
   151 inline TRect TAknWindowLineLayout::Rect() const 
       
   152 	{ // THIS METHOD IS DEPRECATED
       
   153 	ASSERT(IsRect()); 
       
   154 	return TRect(TPoint(il, it), TSize(iW, iH)); 
       
   155 	}
       
   156 
       
   157 #endif
       
   158 // End of File