emailuis/emailui/src/FreestyleEmailUiAttachmentsListControl.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  Implements control for the attachment list view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "emailtrace.h"
       
    21 #include "FreestyleEmailUiAttachmentsListControl.h"
       
    22 #include "FreestyleEmailUiAttachmentsListVisualiser.h"
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // Two-phased constructor.
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CFreestyleEmailUiAttachmentsListControl* CFreestyleEmailUiAttachmentsListControl::NewL(CAlfEnv& aEnv, CFSEmailUiAttachmentsListVisualiser* aVisualiser)
       
    30     {
       
    31     FUNC_LOG;
       
    32     CFreestyleEmailUiAttachmentsListControl* self = CFreestyleEmailUiAttachmentsListControl::NewLC(aEnv, aVisualiser);
       
    33     CleanupStack::Pop(self);
       
    34     return self;
       
    35     }
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // Two-phased constructor.
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 CFreestyleEmailUiAttachmentsListControl* CFreestyleEmailUiAttachmentsListControl::NewLC(CAlfEnv& aEnv, CFSEmailUiAttachmentsListVisualiser* aVisualiser)
       
    42     {
       
    43     FUNC_LOG;
       
    44     CFreestyleEmailUiAttachmentsListControl* self = new (ELeave) CFreestyleEmailUiAttachmentsListControl(aVisualiser);
       
    45     CleanupStack::PushL(self);
       
    46     self->ConstructL(aEnv);
       
    47     return self;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 //C++ constructor.
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CFreestyleEmailUiAttachmentsListControl::CFreestyleEmailUiAttachmentsListControl(CFSEmailUiAttachmentsListVisualiser* aVisualiser)
       
    55     : CAlfControl(), 
       
    56 	iVisualiser(aVisualiser)
       
    57     {
       
    58     FUNC_LOG;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // Two-phased constructor.
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 void CFreestyleEmailUiAttachmentsListControl::ConstructL(CAlfEnv& aEnv)
       
    66     {
       
    67     FUNC_LOG;
       
    68     CAlfControl::ConstructL(aEnv);
       
    69     }
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // Virtual destructor.
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 CFreestyleEmailUiAttachmentsListControl::~CFreestyleEmailUiAttachmentsListControl()
       
    76     {
       
    77     FUNC_LOG;
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // Two-phased constructor.
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 void CFreestyleEmailUiAttachmentsListControl::TextureLoadingCompleted( CAlfTexture& /* aTexture*/,
       
    85                                                          TInt /*aTextureId*/,
       
    86                                                          TInt /*aErrorCode*/ )
       
    87     {
       
    88     FUNC_LOG;
       
    89     
       
    90     }
       
    91 
       
    92 
       
    93 TBool CFreestyleEmailUiAttachmentsListControl::OfferEventL( const TAlfEvent& aEvent )
       
    94 	{
       
    95     FUNC_LOG;
       
    96 	if ( iVisualiser ) // Offer events to view
       
    97 		{
       
    98 		return iVisualiser->OfferEventL( aEvent );
       
    99 		}
       
   100 	return KErrGeneral;
       
   101 	}
       
   102 
       
   103 void CFreestyleEmailUiAttachmentsListControl::HandleCommandL(TInt aCommand)
       
   104 	{
       
   105     FUNC_LOG;
       
   106 	if ( iVisualiser ) // Offer aCommand to view
       
   107 		{
       
   108 		return iVisualiser->HandleCommandL( aCommand );
       
   109 		}
       
   110 	}
       
   111 		
       
   112