uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDeckLayout.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006-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:   Definition for CHuiDeckLayout. Deck layout is a very simple 
       
    15 *                layout that overlays all its children to match the layout's 
       
    16 *                own rectangle. Think of it as a deck of cards.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __HUIDECKLAYOUT_H__
       
    23 #define __HUIDECKLAYOUT_H__
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <uiacceltk/HuiLayout.h>
       
    28 #include <uiacceltk/HuiTimedValue.h>
       
    29 
       
    30 
       
    31 /* Forward declarations */
       
    32 class CHuiEnv;
       
    33 
       
    34 
       
    35 /**
       
    36  * CHuiDeckLayout is a very simple layout that overlays all its children to 
       
    37  * match the layout's own rectangle. A suitable analogy would be a deck of 
       
    38  * cards.
       
    39  */
       
    40 NONSHARABLE_CLASS(CHuiDeckLayout) : public CHuiLayout
       
    41     {
       
    42 public:
       
    43 
       
    44     /* Constructors and destructor. */
       
    45 
       
    46     /**
       
    47      * Construct a new deck layout and give its ownership to a control.
       
    48      *
       
    49      * @param aOwnerControl  Owner control.
       
    50      * @param aParentLayout  Parent layout for the new deck layout.
       
    51      */
       
    52     IMPORT_C static CHuiDeckLayout* AddNewL(CHuiControl& aOwnerControl, 
       
    53                                             CHuiLayout* aParentLayout = 0);
       
    54 
       
    55     /**
       
    56      * Constructor.
       
    57      *
       
    58      * @param aOwner  Owner control.
       
    59      */
       
    60     CHuiDeckLayout(MHuiVisualOwner& aOwner);
       
    61 
       
    62     /**
       
    63      * Second-phase constructor.
       
    64      */
       
    65     void ConstructL();
       
    66 
       
    67     /**
       
    68      * Destructor.
       
    69      */
       
    70     IMPORT_C ~CHuiDeckLayout();
       
    71 
       
    72 
       
    73     /* Methods. */
       
    74 
       
    75     /**
       
    76      * Overridden version of size changing updates the layout of child visuals.
       
    77      *
       
    78      * @param aSize  New size for the layout.
       
    79      * @param aTransitionTime  Time for the transition to new size to take 
       
    80      *               place.
       
    81      */
       
    82     void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
       
    83     
       
    84     TBool ChildSize(TInt aOrdinal, TSize& aSize);
       
    85     
       
    86     TBool ChildPos(TInt aOrdinal, TPoint& aPos);
       
    87 
       
    88     TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);        
       
    89 
       
    90     void GetClassName(TDes& aName) const
       
    91         {
       
    92         aName = _L("CHuiDeckLayout");
       
    93         }    
       
    94     };
       
    95 
       
    96 
       
    97 #endif  // __HUIDECKLAYOUT_H__