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