psln/pslnengine/src/PslnSkinEntry.cpp
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2004-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:  One skin entry in skin store.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <AknsSkinUID.h>
       
    20 
       
    21 #include "PslnConst.h"
       
    22 #include "PslnSkinEntry.h"
       
    23 #include "PslnDebug.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS =============================
       
    26 // -----------------------------------------------------------------------------
       
    27 // Two-phased constructor.
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 CPslnSkinEntry* CPslnSkinEntry::NewL( CAknsSrvSkinInformationPkg* aInfo )
       
    31     {
       
    32     CleanupStack::PushL( aInfo );
       
    33 
       
    34     CPslnSkinEntry* self = new( ELeave ) CPslnSkinEntry;
       
    35 
       
    36     self->iInfo = aInfo;
       
    37     self->iProtection = aInfo->ProtectionType();
       
    38     CleanupStack::Pop( aInfo );
       
    39     
       
    40     CleanupStack::PushL( self );
       
    41     self->ConstructL();
       
    42     CleanupStack::Pop( self );
       
    43     return self;
       
    44     }
       
    45     
       
    46 // -----------------------------------------------------------------------------
       
    47 // Destructor.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CPslnSkinEntry::~CPslnSkinEntry()
       
    51     {
       
    52     delete iInfo;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CPslnSkinEntry::GetSkinPath
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 EXPORT_C void CPslnSkinEntry::GetSkinPath( TDes& aDst ) const
       
    60     {
       
    61     CopyHonoringSize( aDst, iInfo->Directory() );
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CPslnSkinEntry::IsCorrupted
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 EXPORT_C TBool CPslnSkinEntry::IsCorrupted() const
       
    69     {
       
    70     return iInfo->IsCorrupted();
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CPslnSkinEntry::IsSupportAnimBg
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 EXPORT_C TBool CPslnSkinEntry::IsSupportAnimBg() const
       
    78     {
       
    79     return iInfo->IsSupportAnimBg();
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CPslnSkinEntry::Protection
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 EXPORT_C TAknsSkinSrvSkinProtectionType CPslnSkinEntry::Protection() const
       
    87     {
       
    88     return iProtection;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CPslnSkinEntry::FullName
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 EXPORT_C TDesC& CPslnSkinEntry::FullName() const
       
    96     {
       
    97     return iInfo->FullName();
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CPslnSkinEntry::IsOnMassDrive
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 EXPORT_C TBool CPslnSkinEntry::IsOnMassDrive() const
       
   105     {
       
   106     return iInternalState.IsSet( EPslnSkinEntryStateMassDrive );
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CPslnSkinEntry::IsOnMemoryCard
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C TBool CPslnSkinEntry::IsOnMemoryCard() const
       
   114     {
       
   115     return iInternalState.IsSet( EPslnSkinEntryStateMemoryCard );
       
   116     }
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CPslnSkinEntry::GetIniPath
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 void CPslnSkinEntry::GetIniPath( TDes& aDst ) const
       
   123     {
       
   124     CopyHonoringSize( aDst, iInfo->IniFileDirectory() );
       
   125     }
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // CPslnSkinEntry::SetProtection
       
   129 // -----------------------------------------------------------------------------
       
   130 //
       
   131 void CPslnSkinEntry::SetProtection(
       
   132     const TAknsSkinSrvSkinProtectionType aProtection )
       
   133     {
       
   134     iProtection = aProtection;
       
   135     }
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CPslnSkinEntry::SetDeleteFlag
       
   139 // -----------------------------------------------------------------------------
       
   140 //
       
   141 void CPslnSkinEntry::SetDeleteFlag( const TBool& aValue )
       
   142     {
       
   143     if ( aValue && iInternalState.IsClear( EPslnSkinEntryStateDeleted ) )
       
   144         {
       
   145         iInternalState.Set( EPslnSkinEntryStateDeleted );
       
   146         }
       
   147     else if ( !aValue && iInternalState.IsSet( EPslnSkinEntryStateDeleted ) )
       
   148         {
       
   149         iInternalState.Clear( EPslnSkinEntryStateDeleted );
       
   150         }
       
   151     }
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // CPslnSkinEntry::IsDeleteFlag
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 TBool CPslnSkinEntry::IsDeleteFlag() const
       
   158     {
       
   159     return iInternalState.IsSet( EPslnSkinEntryStateDeleted );
       
   160     }
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CPslnSkinEntry::LinearOrder
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 TInt CPslnSkinEntry::LinearOrder( 
       
   167     const CPslnSkinEntry& aFirst, 
       
   168     const CPslnSkinEntry& aSecond )
       
   169     {
       
   170     return CPslnSkinNameEntry::LinearOrder( aFirst, aSecond );
       
   171     }
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // CPslnSkinEntry::SetMemoryCardFlag
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 void CPslnSkinEntry::SetMemoryCardFlag( const TBool& aValue )
       
   178     {
       
   179     if ( aValue && iInternalState.IsClear( EPslnSkinEntryStateMemoryCard ) )
       
   180         {
       
   181         iInternalState.Set( EPslnSkinEntryStateMemoryCard );
       
   182         }
       
   183     else if ( !aValue && iInternalState.IsSet( EPslnSkinEntryStateMemoryCard ) )
       
   184         {
       
   185         iInternalState.Clear( EPslnSkinEntryStateMemoryCard );
       
   186         }
       
   187     }
       
   188 
       
   189 // -----------------------------------------------------------------------------
       
   190 // CPslnSkinEntry::SetMassDriveFlag
       
   191 // -----------------------------------------------------------------------------
       
   192 //
       
   193 void CPslnSkinEntry::SetMassDriveFlag( const TBool& aValue )
       
   194     {
       
   195     if ( aValue && iInternalState.IsClear( EPslnSkinEntryStateMassDrive ) )
       
   196         {
       
   197         iInternalState.Set( EPslnSkinEntryStateMassDrive );
       
   198         }
       
   199     else if ( !aValue && iInternalState.IsSet( EPslnSkinEntryStateMassDrive ) )
       
   200         {
       
   201         iInternalState.Clear( EPslnSkinEntryStateMassDrive );
       
   202         }
       
   203     }
       
   204 
       
   205 // -----------------------------------------------------------------------------
       
   206 // C++ default constructor can NOT contain any code, that might leave.
       
   207 // -----------------------------------------------------------------------------
       
   208 //
       
   209 CPslnSkinEntry::CPslnSkinEntry()
       
   210     {
       
   211     }
       
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // Symbian 2nd phase constructor can leave.
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 void CPslnSkinEntry::ConstructL()
       
   218     {
       
   219     BaseConstructL( iInfo );
       
   220     }
       
   221 
       
   222 //  End of File