uiacceltk/hitchcock/Client/src/alflctgridlayout.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 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:   LCT Grid Layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "alf/alflctgridlayout.h"
       
    21 #include "alf/alfcontrol.h"
       
    22 #include "alf/alfenv.h"
       
    23 #include "alfclient.h"
       
    24 #include "alf/alfconstants.h"
       
    25 #include "alf/alfgencomponent.h"
       
    26 #include "alflogger.h"
       
    27 #include "alfuids.h"
       
    28 
       
    29 #include <uiacceltk/HuiUtil.h>
       
    30 
       
    31 #ifdef RD_ALF_IN_PLATFORM
       
    32 #include <aknlayout2hierarchy.h>
       
    33 #endif
       
    34 
       
    35 
       
    36 // ======== LOCAL FUNCTIONS ========
       
    37 
       
    38 
       
    39 // ======== MEMBER FUNCTIONS ========
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // 1st phase constructor
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 EXPORT_C CAlfLCTGridLayout::CAlfLCTGridLayout()
       
    46     : CAlfGridLayout()
       
    47     {
       
    48     }
       
    49 
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // 2nd phase constructor
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 EXPORT_C void CAlfLCTGridLayout::ConstructL(CAlfControl& aOwner)
       
    56     {
       
    57     CAlfGridLayout::ConstructL(aOwner);
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // Destructor
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C CAlfLCTGridLayout::~CAlfLCTGridLayout()
       
    65     {
       
    66     }
       
    67 
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // Creates new grid layout for the control.
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C CAlfLCTGridLayout* CAlfLCTGridLayout::AddNewL(
       
    74     CAlfControl& aOwnerControl,
       
    75     CAlfLayout* aParentLayout )
       
    76     {
       
    77     CAlfLCTGridLayout* layout = STATIC_CAST(CAlfLCTGridLayout*,
       
    78         aOwnerControl.AppendLayoutL(EAlfLayoutTypeLCTGrid, aParentLayout));
       
    79     return layout;
       
    80     }
       
    81 
       
    82 // ---------------------------------------------------------------------------
       
    83 // Sets cols and rows
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 #ifdef RD_ALF_IN_PLATFORM            
       
    87 EXPORT_C void CAlfLCTGridLayout::SetColsAndRows(
       
    88     TAknLayoutHierarchyComponentHandle& aComponentHandle,
       
    89     const TAlfTimedPoint& aOffset)
       
    90     {
       
    91     TAlfLCTGridSetColsAndRowsParams params;
       
    92     
       
    93     params.iApiId = aComponentHandle.ApiId();
       
    94     params.iComponentId = aComponentHandle.ComponentId();
       
    95     params.iOptionIndex = 0; // not used yet
       
    96     params.iDrawingOrderIndex = 0;  // not used yet
       
    97     params.iVarietyIndex = aComponentHandle.VarietyIndex();
       
    98     params.iColumn = aComponentHandle.Column();
       
    99     params.iRow = aComponentHandle.Row();
       
   100     
       
   101     params.iOffset = aOffset;
       
   102     
       
   103     TPckg<TAlfLCTGridSetColsAndRowsParams> paramsPckg(params);
       
   104 
       
   105     TInt err = Comms()->DoCmdNoReply(EAlfLCTGridLayoutSetColsAndRows, paramsPckg );
       
   106     if ( err == KErrNone )
       
   107         {
       
   108         __ALFLOGSTRING( "LCTGridLayoutSetColsAndRows ok" )
       
   109         }
       
   110     else
       
   111         {
       
   112         __ALFLOGSTRING1( "LCTGridLayoutSetColsAndRows return error %d", err )
       
   113         USER_INVARIANT(); 
       
   114         }
       
   115     }
       
   116 #else // RD_ALF_IN_PLATFORM
       
   117 EXPORT_C void CAlfLCTGridLayout::SetColsAndRows(TAknLayoutHierarchyComponentHandle& /*aComponentHandle*/, const TAlfTimedPoint& /*aOffset*/)
       
   118     {
       
   119     }
       
   120 #endif // RD_ALF_IN_PLATFORM
       
   121 
       
   122 // ---------------------------------------------------------------------------
       
   123 // Place holder from CAlfVisual
       
   124 // ---------------------------------------------------------------------------
       
   125 //     
       
   126 EXPORT_C void CAlfLCTGridLayout::RemoveAndDestroyAllD()
       
   127     {
       
   128     CAlfGridLayout::RemoveAndDestroyAllD();
       
   129     }
       
   130   
       
   131 // ---------------------------------------------------------------------------
       
   132 // Place holder from CAlfVisual
       
   133 // ---------------------------------------------------------------------------
       
   134 //  
       
   135 EXPORT_C void CAlfLCTGridLayout::UpdateChildrenLayout(TInt aTransitionTime )
       
   136     {
       
   137     CAlfGridLayout::UpdateChildrenLayout( aTransitionTime );
       
   138     }
       
   139   
       
   140 // ---------------------------------------------------------------------------
       
   141 // Place holder from CAlfVisual
       
   142 // ---------------------------------------------------------------------------
       
   143 //  
       
   144 EXPORT_C CAlfVisual* CAlfLCTGridLayout::FindTag(const TDesC8& aTag)
       
   145     {
       
   146     return CAlfGridLayout::FindTag( aTag );
       
   147     }
       
   148 
       
   149 // ---------------------------------------------------------------------------
       
   150 // Place holder from CAlfLayout
       
   151 // ---------------------------------------------------------------------------
       
   152 //  
       
   153 EXPORT_C TAlfXYMetric CAlfLCTGridLayout::BaseUnit() const
       
   154     {
       
   155     return CAlfGridLayout::BaseUnit();
       
   156     }
       
   157  
       
   158 // ---------------------------------------------------------------------------
       
   159 // Place holder from CAlfVisual
       
   160 // ---------------------------------------------------------------------------
       
   161 //  
       
   162 EXPORT_C void CAlfLCTGridLayout::DoRemoveAndDestroyAllD()
       
   163     {
       
   164     CAlfGridLayout::DoRemoveAndDestroyAllD();
       
   165     }
       
   166     
       
   167 // ---------------------------------------------------------------------------
       
   168 //  future proofing  
       
   169 // ---------------------------------------------------------------------------
       
   170 //  
       
   171 EXPORT_C void CAlfLCTGridLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
       
   172     {
       
   173     CAlfGridLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
       
   174     }
       
   175