internetradio2.0/datastructuressrc/iradvertisement.cpp
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "iradvertisement.h"
       
    20 #include "irdebug.h"
       
    21 
       
    22 // ======== LOCAL FUNCTIONS ========
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // Function : NewLC
       
    28 // Function returns an instance of CIRAdvertisement
       
    29 // Two phase constructor
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 EXPORT_C CIRAdvertisement* CIRAdvertisement::NewLC()
       
    33 	{
       
    34 	IRLOG_DEBUG( "CIRAdvertisement::NewLC - Entering" );
       
    35 	CIRAdvertisement* self = new (ELeave) CIRAdvertisement;
       
    36 	CleanupStack::PushL(self);
       
    37 	self->ConstructL();
       
    38 	IRLOG_DEBUG( "CIRAdvertisement::NewLC - Exiting." );
       
    39 	return self;
       
    40 	}
       
    41 
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 //CIRAdvertisement::NewL()
       
    45 //Static function
       
    46 //standard two phased constructor
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CIRAdvertisement* CIRAdvertisement::NewL()
       
    50 	{
       
    51 	IRLOG_DEBUG( "CIRAdvertisement::NewL - Entering" );
       
    52 	CIRAdvertisement* self = CIRAdvertisement::NewLC();
       
    53 	CleanupStack::Pop(self);
       
    54 	IRLOG_DEBUG( "CIRAdvertisement::NewL - Exiting." );
       
    55 	return self;
       
    56 	}
       
    57 
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 //CIRAdvertisement::ConstructL()
       
    61 //standard second phase constructor
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C void CIRAdvertisement::ConstructL() const
       
    65 	{
       
    66 	IRLOG_DEBUG( "CIRAdvertisement::ConstructL" );
       
    67 	return;
       
    68 	}
       
    69 
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 //CIRAdvertisement::~CIRAdvertisement()
       
    73 //standard C++ destructor
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 CIRAdvertisement::~CIRAdvertisement()
       
    77 	{
       
    78 	IRLOG_DEBUG( "CIRAdvertisement::~CIRAdvertisement - Entering" );
       
    79 	delete  iUrl;
       
    80 	iUrl=NULL;
       
    81 	delete iAdvInUse;
       
    82 	iAdvInUse = NULL;
       
    83 	IRLOG_DEBUG( "CIRAdvertisement::~CIRAdvertisement - Exiting." );
       
    84 	}
       
    85 
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 //CIRAdvertisement::SetAdvInUse()
       
    89 //Function to set the advertisement in use
       
    90 // ---------------------------------------------------------------------------
       
    91 //
       
    92 EXPORT_C void CIRAdvertisement::SetAdvInUse(const TDesC& aAdvInUse)
       
    93 	{
       
    94 	IRLOG_DEBUG( "CIRAdvertisement::SetAdvInUse - Entering" );
       
    95 	iAdvInUse=aAdvInUse.Alloc();
       
    96 	IRLOG_DEBUG( "CIRAdvertisement::SetAdvInUse - Exiting." );
       
    97 	}
       
    98 	
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 //CIRAdvertisement::SetUsage()
       
   102 //Function to set the number of times the global adv to be shown
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 EXPORT_C void CIRAdvertisement::SetUsage(const TDesC& aUsageVisibleTimes)
       
   106 	{
       
   107 	IRLOG_DEBUG( "CIRAdvertisement::SetUsage - Entering" );
       
   108 	TLex var(aUsageVisibleTimes);
       
   109 	var.Val(iUsageVisibleTimes);
       
   110 	IRLOG_DEBUG( "CIRAdvertisement::SetUsage - Exiting." );
       
   111 	}
       
   112 
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 //CIRAdvertisement::SetVisibleTime()
       
   116 //Function to set the duration of the advertisement to be displayed
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 EXPORT_C void CIRAdvertisement::SetVisibleTime(const TDesC& aVisibleTime)
       
   120 	{
       
   121 	IRLOG_DEBUG( "CIRAdvertisement::SetVisibleTime - Entering" );
       
   122 	 TLex var(aVisibleTime);
       
   123 	var.Val(iVisibleTime);
       
   124 	IRLOG_DEBUG( "CIRAdvertisement::SetVisibleTime - Exiting." );
       
   125 	}
       
   126 
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 //CIRAdvertisement::SetURL()
       
   130 //Function to set the url of the global advertisement
       
   131 // ---------------------------------------------------------------------------
       
   132 //
       
   133 EXPORT_C void CIRAdvertisement::SetURL(const TDesC& aUrl)
       
   134 	{
       
   135 	IRLOG_DEBUG( "CIRAdvertisement::SetURL - Entering" );
       
   136 	 iUrl = aUrl.Alloc();
       
   137 	IRLOG_DEBUG( "CIRAdvertisement::SetURL - Exiting." );
       
   138 	return;
       
   139 	}
       
   140