harvester/common/src/placeholderdata.cpp
changeset 0 c53acadfccc6
child 40 910a23996aa0
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:  Data transfer object for placeholder data
       
    15 *
       
    16 */
       
    17 
       
    18 #include <placeholderdata.h>
       
    19 
       
    20 // CPlaceholderData implementation
       
    21 
       
    22 //==========================================================================
       
    23 // NewL
       
    24 //==========================================================================
       
    25 //
       
    26 EXPORT_C CPlaceholderData* CPlaceholderData::NewL()
       
    27 	{
       
    28 	CPlaceholderData* self = new (ELeave) CPlaceholderData;
       
    29 	CleanupStack::PushL( self );
       
    30 	self->ConstructL();
       
    31 	CleanupStack::Pop( self );
       
    32 
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 //==========================================================================
       
    37 // ConstructL
       
    38 //==========================================================================
       
    39 //
       
    40 void CPlaceholderData::ConstructL()
       
    41 	{
       
    42 	iUri = HBufC::New( 1 );
       
    43 	iMediaId = 0;
       
    44 	}
       
    45 
       
    46 //==========================================================================
       
    47 // Destructor
       
    48 //==========================================================================
       
    49 //
       
    50 CPlaceholderData::~CPlaceholderData()
       
    51 	{
       
    52 		delete iUri;
       
    53 	}
       
    54 
       
    55 //==========================================================================
       
    56 // Modified
       
    57 //==========================================================================
       
    58 //
       
    59 EXPORT_C TTime CPlaceholderData::Modified()
       
    60 	{
       
    61 	return iModified;
       
    62 	}
       
    63 
       
    64 //==========================================================================
       
    65 // SetModified
       
    66 //==========================================================================
       
    67 //
       
    68 EXPORT_C void CPlaceholderData::SetModified( TTime aModified )
       
    69 	{
       
    70 	iModified = aModified;
       
    71 	}
       
    72 
       
    73 //==========================================================================
       
    74 // Uri
       
    75 //==========================================================================
       
    76 //
       
    77 EXPORT_C TPtr16 CPlaceholderData::Uri()
       
    78 	{
       
    79 	return iUri->Des();
       
    80 	}
       
    81 
       
    82 //==========================================================================
       
    83 // SetUri
       
    84 //==========================================================================
       
    85 //
       
    86 EXPORT_C void CPlaceholderData::SetUri( const TDesC& aUri )
       
    87 	{
       
    88 	delete iUri;
       
    89 	iUri = aUri.Alloc();
       
    90 	}
       
    91 
       
    92 //==========================================================================
       
    93 // FileSize
       
    94 //==========================================================================
       
    95 //
       
    96 EXPORT_C TUint32 CPlaceholderData::FileSize()
       
    97 	{
       
    98 	return iFileSize;
       
    99 	}
       
   100 
       
   101 //==========================================================================
       
   102 // SetFileSize
       
   103 //==========================================================================
       
   104 //
       
   105 EXPORT_C void CPlaceholderData::SetFileSize( TUint32 aFileSize )
       
   106 	{
       
   107 	iFileSize = aFileSize;
       
   108 	}
       
   109 
       
   110 //==========================================================================
       
   111 // MediaId
       
   112 //==========================================================================
       
   113 //
       
   114 EXPORT_C TUint CPlaceholderData::MediaId()
       
   115 	{
       
   116 	return (TUint)iMediaId;
       
   117 	}
       
   118 
       
   119 //==========================================================================
       
   120 // SetMediaId
       
   121 //==========================================================================
       
   122 //
       
   123 EXPORT_C void CPlaceholderData::SetMediaId( TUint aMediaId )
       
   124 	{
       
   125 	iMediaId = aMediaId;
       
   126 	}
       
   127 
       
   128 //==========================================================================
       
   129 // PresentState
       
   130 //==========================================================================
       
   131 //
       
   132 EXPORT_C TInt CPlaceholderData::PresentState()
       
   133 	{
       
   134 	return iPresentState;
       
   135 	}
       
   136 
       
   137 //==========================================================================
       
   138 // SetPresentState
       
   139 //==========================================================================
       
   140 //
       
   141 EXPORT_C void CPlaceholderData::SetPresentState( TInt aState )
       
   142 	{
       
   143 	iPresentState = aState;
       
   144 	}
       
   145 
       
   146 //==========================================================================
       
   147 // Preinstalled
       
   148 //==========================================================================
       
   149 //
       
   150 EXPORT_C TInt CPlaceholderData::Preinstalled()
       
   151 	{
       
   152 	return iPreinstalled;
       
   153 	}
       
   154 
       
   155 //==========================================================================
       
   156 // SetPreinstalled
       
   157 //==========================================================================
       
   158 //
       
   159 EXPORT_C void CPlaceholderData::SetPreinstalled( TInt aValue )
       
   160 	{
       
   161 	iPreinstalled = aValue;
       
   162 	}