harvester/harvesterserver/src/contentinfomgr.cpp
changeset 23 d4d56f5e7c55
parent 20 556534771396
child 24 65456528cac2
equal deleted inserted replaced
20:556534771396 23:d4d56f5e7c55
     1 /*
       
     2 * Copyright (c) 2010 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 "contentinfomgr.h"
       
    19 #include "ccotentinfodb.h"
       
    20 #include "ccontentinfo.h"
       
    21 #include "OstTraceDefinitions.h"
       
    22 #ifdef OST_TRACE_COMPILER_IN_USE
       
    23 #include "contentinfomgrTraces.h"
       
    24 #endif
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CContentInfoMgr::NewL()
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CContentInfoMgr* CContentInfoMgr::NewL()
       
    32     {
       
    33     OstTraceFunctionEntry0( CCONTENTINFOMGR_NEWL_ENTRY );
       
    34     CContentInfoMgr* instance = CContentInfoMgr::NewLC();
       
    35     CleanupStack::Pop( instance );
       
    36     OstTraceFunctionExit0( CCONTENTINFOMGR_NEWL_EXIT );
       
    37     return instance;
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // CContentInfoMgr::NewLC()
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CContentInfoMgr* CContentInfoMgr::NewLC()
       
    45     {
       
    46     OstTraceFunctionEntry0( CCONTENTINFOMGR_NEWLC_ENTRY );
       
    47     CContentInfoMgr* instance = new (ELeave) CContentInfoMgr();
       
    48     CleanupStack::PushL( instance );
       
    49     instance->ConstructL();
       
    50     OstTraceFunctionExit0( CCONTENTINFOMGR_NEWLC_EXIT );
       
    51     return instance;
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // Constructor
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CContentInfoMgr::CContentInfoMgr()
       
    59     {
       
    60     //Do the necessary initialisation
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // Destructor
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 CContentInfoMgr::~CContentInfoMgr()
       
    68     {
       
    69     delete iContentInfoDb;
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CContentInfoMgr::ConstructL
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 void CContentInfoMgr::ConstructL()
       
    77     { 
       
    78     OstTraceFunctionEntry0( CCONTENTINFOMGR_CONSTRUCTL_ENTRY );
       
    79     iContentInfoDb = CContentInfoDb::NewL();
       
    80     OstTraceFunctionExit0( CCONTENTINFOMGR_CONSTRUCTL_EXIT );
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CContentInfoMgr::AddL
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 TInt CContentInfoMgr::AddL( CContentInfo* aContentInfo )
       
    88     {
       
    89     return iContentInfoDb->AddL( aContentInfo );
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CContentInfoMgr::UpdateBlacklistStatusL
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 TInt CContentInfoMgr::UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus )
       
    97     {
       
    98     return iContentInfoDb->UpdateBlacklistStatusL( aContentName, aBlacklistStatus );
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CContentInfoMgr::UpdatePluginIndexStatusL
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CContentInfoMgr::UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus )
       
   106     {
       
   107     return iContentInfoDb->UpdatePluginIndexStatusL( aContentName, aIndexStatus );
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CContentInfoMgr::FindL
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TBool CContentInfoMgr::FindL( const TDesC& aContentName )
       
   115     {
       
   116     return iContentInfoDb->FindL( aContentName );
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CContentInfoMgr::Remove
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 void CContentInfoMgr::RemoveL( const TDesC& aContentName )
       
   124     {
       
   125     iContentInfoDb->RemoveL( aContentName );
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CContentInfoMgr::Remove
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 void CContentInfoMgr::ResetL( )
       
   133     {
       
   134     iContentInfoDb->ResetDatabaseL();
       
   135     }
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CContentInfoMgr::GetContentCountL
       
   139 // -----------------------------------------------------------------------------
       
   140 //
       
   141 TInt CContentInfoMgr::GetContentCountL( )
       
   142     {
       
   143     return iContentInfoDb->GetContentCountL();
       
   144     }
       
   145 //EOF