idlehomescreen/sapiwrapper/cpswrapper/src/publisherinfo.cpp
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2  * Copyright (c) 2008 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:  Presents publisher info
       
    15  *
       
    16  */
       
    17 
       
    18 // User includes
       
    19 #include "publisherinfo.h"
       
    20 
       
    21 namespace cpswrapper
       
    22     {
       
    23     // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25     // -----------------------------------------------------------------------
       
    26     // CPublisherInfo::CPublisherInfo()
       
    27     // -----------------------------------------------------------------------
       
    28     //
       
    29     CPublisherInfo::CPublisherInfo()
       
    30         {        
       
    31         }
       
    32 
       
    33     // -----------------------------------------------------------------------
       
    34     // CPublisherInfo::ConstructL()
       
    35     // -----------------------------------------------------------------------
       
    36     //
       
    37     void CPublisherInfo::ConstructL()
       
    38         {
       
    39         }
       
    40 
       
    41     // -----------------------------------------------------------------------
       
    42     // CPublisherInfo::NewL()
       
    43     // -----------------------------------------------------------------------
       
    44     //
       
    45     EXPORT_C CPublisherInfo* CPublisherInfo::NewL()
       
    46         {
       
    47         CPublisherInfo* self = CPublisherInfo::NewLC();
       
    48         CleanupStack::Pop(self);
       
    49         return self;
       
    50         }
       
    51 
       
    52     // -----------------------------------------------------------------------
       
    53     // CPublisherInfo::NewLC()
       
    54     // -----------------------------------------------------------------------
       
    55     //
       
    56     EXPORT_C CPublisherInfo* CPublisherInfo::NewLC()
       
    57         {
       
    58         CPublisherInfo* self = new ( ELeave ) CPublisherInfo;
       
    59         CleanupStack::PushL( self );
       
    60         self->ConstructL();
       
    61         return self;
       
    62         }
       
    63 
       
    64     // -----------------------------------------------------------------------
       
    65     // CPublisherInfo::~CPublisherInfo()
       
    66     // -----------------------------------------------------------------------
       
    67     //
       
    68     EXPORT_C CPublisherInfo::~CPublisherInfo()
       
    69         {
       
    70         delete iContentId;
       
    71         delete iPublisherId;
       
    72         delete iWidgetName;
       
    73         delete iContentType;
       
    74         delete iTemplateType;
       
    75         delete iLogoIcon;
       
    76         delete iDescription;
       
    77         }
       
    78 
       
    79     // -----------------------------------------------------------------------
       
    80     // CPublisherInfo::SetContentIdL()
       
    81     // -----------------------------------------------------------------------
       
    82     //
       
    83     EXPORT_C void CPublisherInfo::SetContentIdL( const TDesC& aContentId )
       
    84         {
       
    85         delete iContentId;
       
    86         iContentId = NULL;
       
    87 
       
    88         iContentId = aContentId.AllocL();
       
    89         }
       
    90 
       
    91     // -----------------------------------------------------------------------
       
    92     // CPublisherInfo::ContentId()
       
    93     // -----------------------------------------------------------------------
       
    94     //
       
    95     EXPORT_C const TDesC& CPublisherInfo::ContentId() const
       
    96         {
       
    97         return iContentId ? *iContentId : KNullDesC();
       
    98         }
       
    99 
       
   100     // -----------------------------------------------------------------------
       
   101     // CPublisherInfo::SetPublisherIdL()
       
   102     // -----------------------------------------------------------------------
       
   103     //
       
   104     EXPORT_C void CPublisherInfo::SetPublisherIdL( const TDesC& aPublisherId )
       
   105         {
       
   106         delete iPublisherId;
       
   107         iPublisherId = NULL;
       
   108 
       
   109         iPublisherId = aPublisherId.AllocL();
       
   110         }
       
   111 
       
   112     // -----------------------------------------------------------------------
       
   113     // CPublisherInfo::PublisherId()
       
   114     // -----------------------------------------------------------------------
       
   115     //
       
   116     EXPORT_C const TDesC& CPublisherInfo::PublisherId() const
       
   117         {
       
   118         return iPublisherId ? *iPublisherId : KNullDesC();
       
   119         }
       
   120 
       
   121     // -----------------------------------------------------------------------
       
   122     // CPublisherInfo::SetPublisherNameL()
       
   123     // -----------------------------------------------------------------------
       
   124     //
       
   125     EXPORT_C void CPublisherInfo::SetWidgetNameL( const TDesC& aPublisherName )
       
   126         {
       
   127         delete iWidgetName;
       
   128         iWidgetName = NULL;
       
   129 
       
   130         iWidgetName = aPublisherName.AllocL();
       
   131         }
       
   132 
       
   133     // -----------------------------------------------------------------------
       
   134     // CPublisherInfo::PublisherName()
       
   135     // -----------------------------------------------------------------------
       
   136     //
       
   137     EXPORT_C const TDesC& CPublisherInfo::WidgetName() const
       
   138         {
       
   139         return iWidgetName ? *iWidgetName : KNullDesC();
       
   140         }
       
   141 
       
   142     // -----------------------------------------------------------------------
       
   143     // CPublisherInfo::SetContentTypeL()
       
   144     // -----------------------------------------------------------------------
       
   145     //
       
   146     EXPORT_C void CPublisherInfo::SetContentTypeL( const TDesC& aContentType )
       
   147         {
       
   148         delete iContentType;
       
   149         iContentType = NULL;
       
   150 
       
   151         iContentType = aContentType.AllocL();
       
   152         }
       
   153 
       
   154     // -----------------------------------------------------------------------
       
   155     // CPublisherInfo::ContentType()
       
   156     // -----------------------------------------------------------------------
       
   157     //
       
   158     EXPORT_C const TDesC& CPublisherInfo::ContentType() const
       
   159         {
       
   160         return iContentType ? *iContentType : KNullDesC();
       
   161         }
       
   162 
       
   163     // -----------------------------------------------------------------------
       
   164     // CPublisherInfo::SetTemplateTypeL()
       
   165     // -----------------------------------------------------------------------
       
   166     //
       
   167     EXPORT_C void CPublisherInfo::SetTemplateTypeL( const TDesC& aTemplateType )
       
   168         {
       
   169         delete iTemplateType;
       
   170         iTemplateType = NULL;
       
   171 
       
   172         iTemplateType = aTemplateType.AllocL();
       
   173         }
       
   174 
       
   175     // -----------------------------------------------------------------------
       
   176     // CPublisherInfo::TemplateType()
       
   177     // -----------------------------------------------------------------------
       
   178     //
       
   179     EXPORT_C const TDesC& CPublisherInfo::TemplateType() const
       
   180         {
       
   181         return iTemplateType ? *iTemplateType : KNullDesC();
       
   182         }
       
   183 
       
   184     // -----------------------------------------------------------------------
       
   185     // CPublisherInfo::SetLogoIconL()
       
   186     // -----------------------------------------------------------------------
       
   187     //
       
   188     EXPORT_C void CPublisherInfo::SetLogoIconL( const TDesC& aLogoIcon )
       
   189         {
       
   190         delete iLogoIcon;
       
   191         iLogoIcon = NULL;
       
   192 
       
   193         iLogoIcon = aLogoIcon.AllocL();
       
   194         }
       
   195 
       
   196     // -----------------------------------------------------------------------
       
   197     // CPublisherInfo::LogoIcon()
       
   198     // -----------------------------------------------------------------------
       
   199     //
       
   200     EXPORT_C const TDesC& CPublisherInfo::LogoIcon() const
       
   201         {
       
   202         return iLogoIcon ? *iLogoIcon : KNullDesC();
       
   203         }
       
   204 
       
   205     // -----------------------------------------------------------------------
       
   206     // CPublisherInfo::SetDescriptionL()
       
   207     // -----------------------------------------------------------------------
       
   208     //
       
   209     EXPORT_C void CPublisherInfo::SetDescriptionL( const TDesC& aDescription )
       
   210         {
       
   211         delete iDescription;
       
   212         iDescription = NULL;
       
   213 
       
   214         iDescription = aDescription.AllocL();
       
   215         }
       
   216 
       
   217     // -----------------------------------------------------------------------
       
   218     // CPublisherInfo::Description()
       
   219     // -----------------------------------------------------------------------
       
   220     //
       
   221     EXPORT_C const TDesC& CPublisherInfo::Description() const
       
   222         {
       
   223         return iDescription ? *iDescription : KNullDesC();
       
   224         }
       
   225         
       
   226     // -----------------------------------------------------------------------
       
   227     // CPublisherInfo::SetMaxWidgets()
       
   228     // -----------------------------------------------------------------------
       
   229     //
       
   230     EXPORT_C void CPublisherInfo::SetMaxWidgets( const TInt32& aMaxWidget )
       
   231         {
       
   232         iMaxInst = aMaxWidget;
       
   233         }
       
   234 
       
   235     // -----------------------------------------------------------------------
       
   236     // CPublisherInfo::MaxWidgets()
       
   237     // -----------------------------------------------------------------------
       
   238     //
       
   239     EXPORT_C const TInt32& CPublisherInfo::MaxWidgets() const
       
   240         {
       
   241         return iMaxInst;
       
   242         }
       
   243     }
       
   244 
       
   245 // End of file
       
   246