idlehomescreen/sapiwrapper/hspswrapper/src/pluginmap.cpp
branchRCL_3
changeset 34 5456b4e8b3a8
equal deleted inserted replaced
33:5f0182e07bfb 34:5456b4e8b3a8
       
     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:  contains id and uid
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "pluginmap.h"
       
    20 
       
    21 namespace hspswrapper{
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 CPluginMap::CPluginMap()
       
    27     {
       
    28     }
       
    29 
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // ---------------------------------------------------------------------------
       
    33 //
       
    34 void CPluginMap::ConstructL()
       
    35     {
       
    36     }
       
    37 
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 EXPORT_C CPluginMap* CPluginMap::NewL()
       
    43     {
       
    44     CPluginMap* self = CPluginMap::NewLC();
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 EXPORT_C CPluginMap* CPluginMap::NewLC()
       
    54     {
       
    55     CPluginMap* self = new( ELeave ) CPluginMap;
       
    56     CleanupStack::PushL( self );
       
    57     self->ConstructL();
       
    58     return self;
       
    59     }
       
    60 
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 EXPORT_C CPluginMap::~CPluginMap()
       
    66     {
       
    67     delete iPluginId;
       
    68     delete iPluginUid;
       
    69     delete iActivationState;
       
    70     delete iLockingStatus;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 EXPORT_C CPluginMap& CPluginMap::SetPluginIdL(const TDesC8& aPluginId)
       
    77     {
       
    78     delete iPluginId;
       
    79     iPluginId = NULL;
       
    80     iPluginId = aPluginId.AllocL();
       
    81     return *this;
       
    82     }
       
    83     
       
    84 // ---------------------------------------------------------------------------
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 EXPORT_C const TDesC8& CPluginMap::PluginId()const
       
    88     {
       
    89     if(iPluginId)
       
    90        {
       
    91        return *iPluginId;
       
    92        }
       
    93     else
       
    94        {
       
    95        return KNullDesC8;
       
    96        }
       
    97     }
       
    98     
       
    99 // ---------------------------------------------------------------------------
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 EXPORT_C CPluginMap& CPluginMap::SetPluginUidL(const TDesC8& aPluginUid)
       
   103     {
       
   104     delete iPluginUid;
       
   105     iPluginUid = NULL;
       
   106     iPluginUid = aPluginUid.AllocL();
       
   107     return *this;
       
   108     }
       
   109     
       
   110 // ---------------------------------------------------------------------------
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C const TDesC8& CPluginMap::PluginUid()const
       
   114     {
       
   115     if(iPluginUid)
       
   116        {
       
   117        return *iPluginUid;
       
   118        }
       
   119     else
       
   120        {
       
   121        return KNullDesC8;
       
   122        }
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // ---------------------------------------------------------------------------
       
   127 //
       
   128 EXPORT_C CPluginMap& CPluginMap::SetActivationStateL(const TDesC8& aState)
       
   129     {
       
   130     delete iActivationState;
       
   131     iActivationState = NULL;
       
   132     iActivationState = aState.AllocL();
       
   133     return *this;    
       
   134     }
       
   135 
       
   136 // ---------------------------------------------------------------------------
       
   137 // ---------------------------------------------------------------------------
       
   138 //
       
   139 EXPORT_C TBool CPluginMap::ActivationState()const
       
   140     {
       
   141     if( iActivationState )
       
   142         {               
       
   143         return ( *iActivationState == _L8("1") ) ? ETrue : EFalse; 
       
   144         }
       
   145     
       
   146     return EFalse;
       
   147     }
       
   148 
       
   149 // ---------------------------------------------------------------------------
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 EXPORT_C CPluginMap& CPluginMap::SetLockingStatusL( const TDesC8& aLockingStatus )
       
   153     {
       
   154     delete iLockingStatus;
       
   155     iLockingStatus = NULL;
       
   156     iLockingStatus = aLockingStatus.AllocL();
       
   157     return *this;
       
   158     }
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // ---------------------------------------------------------------------------
       
   162 //
       
   163 EXPORT_C const TDesC8& CPluginMap::LockingStatus() const
       
   164     {
       
   165     if ( iLockingStatus )
       
   166         {
       
   167         return *iLockingStatus;
       
   168         }
       
   169     else
       
   170         {
       
   171         return KNullDesC8;
       
   172         }
       
   173     }
       
   174 
       
   175 }