mpx/viewframework/viewutility/src/mpxviewhistory.cpp
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Implementation of view history
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <mpxviewplugin.h>
       
    22 
       
    23 #include "mpxviewhistory.h"
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ========
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // Two-phased constructor.
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CMPXViewHistory* CMPXViewHistory::NewL()
       
    32     {
       
    33     CMPXViewHistory* self = new ( ELeave ) CMPXViewHistory();
       
    34     // empty history, construction not needed
       
    35     return self;
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 // Two-phased constructor.
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CMPXViewHistory* CMPXViewHistory::NewL( CMPXViewHistory* aHistory )
       
    43     {
       
    44     CMPXViewHistory* self = new ( ELeave ) CMPXViewHistory();
       
    45     CleanupStack::PushL( self );
       
    46     if ( aHistory )
       
    47         {
       
    48         self->ConstructL(
       
    49             aHistory->iUids, aHistory->iPluginType,
       
    50             aHistory->iPluginImplementationUid, aHistory->iPlugin );
       
    51         }
       
    52     CleanupStack::Pop( self );
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Two-phased constructor.
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CMPXViewHistory* CMPXViewHistory::NewL(
       
    61     const RArray<TUid>& aUids,
       
    62     const TUid aPluginType,
       
    63     const TUid aPluginImplementationUid,
       
    64     CMPXViewPlugin* aPlugin )
       
    65     {
       
    66     CMPXViewHistory* self = new ( ELeave ) CMPXViewHistory();
       
    67     CleanupStack::PushL( self );
       
    68     self->ConstructL( aUids, aPluginType, aPluginImplementationUid, aPlugin );
       
    69     CleanupStack::Pop( self );
       
    70     return self;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // default constructor
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 CMPXViewHistory::CMPXViewHistory()
       
    78     {
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // Destructor
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 CMPXViewHistory::~CMPXViewHistory()
       
    86     {
       
    87     iUids.Reset();
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // Symbian 2nd phase constructor can leave.
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 void CMPXViewHistory::ConstructL(
       
    95     const RArray<TUid>& aUids,
       
    96     const TUid aPluginType,
       
    97     const TUid aPluginImpUid,
       
    98     CMPXViewPlugin* aPlugin )
       
    99     {
       
   100     iPluginType = aPluginType;
       
   101     iPluginImplementationUid = aPluginImpUid;
       
   102     iPlugin = aPlugin;
       
   103 
       
   104     for ( TInt i = 0; i < aUids.Count(); i++ )
       
   105         {
       
   106         iUids.Append( aUids[ i ] );
       
   107         }
       
   108     }
       
   109 
       
   110 //  End of File