homesync/contentmanager/cmserver/cmstoremanager/src/cmsmcontentchangeobserver.cpp
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     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:  Handles devices content change events
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cmsmcontentchangeobserver.h"
       
    20 #include "cmsmfileprocessingobserver.h"
       
    21 #include "msdebug.h"
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 // CCmSmContentChangeObserver::NewL
       
    25 // ---------------------------------------------------------------------------
       
    26 // 
       
    27 CCmSmContentChangeObserver* CCmSmContentChangeObserver::NewL( 
       
    28     CMdESession& aSession, 
       
    29     MCmSmFileProcessingObserver& aObserver )
       
    30     {
       
    31     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::NewL() start"));    
       
    32     CCmSmContentChangeObserver* self = 
       
    33         CCmSmContentChangeObserver::NewLC( aSession, aObserver );
       
    34     CleanupStack::Pop( self );
       
    35     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::NewL() end")); 
       
    36     return self;
       
    37     }
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // CCmSmContentChangeObserver::NewLC
       
    41 // ---------------------------------------------------------------------------
       
    42 //     
       
    43 CCmSmContentChangeObserver* CCmSmContentChangeObserver::NewLC( 
       
    44     CMdESession& aSession,
       
    45     MCmSmFileProcessingObserver& aObserver )
       
    46     {
       
    47     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::NewLC() start"));     
       
    48     CCmSmContentChangeObserver* self = 
       
    49         new ( ELeave ) CCmSmContentChangeObserver( aSession, aObserver );
       
    50     CleanupStack::PushL( self );
       
    51     self->ConstructL();
       
    52     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::NewLC() end"));     
       
    53     return self;  
       
    54     }    
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CCmSmContentChangeObserver::~CCmSmContentChangeObserver
       
    58 // ---------------------------------------------------------------------------
       
    59 // 
       
    60 CCmSmContentChangeObserver::~CCmSmContentChangeObserver()
       
    61     {
       
    62     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::\
       
    63         ~CCmSmContentChangeObserver() start"));
       
    64     TRAP_IGNORE( iMdSSession.RemoveObjectObserverL( *this ) );
       
    65     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::\
       
    66         ~CCmSmContentChangeObserver() end"));            
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CCmSmContentChangeObserver::StartObserversL
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 void CCmSmContentChangeObserver::StartObserversL()
       
    74     {
       
    75     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::StartObserversL")); 
       
    76     
       
    77     iMdSSession.AddObjectObserverL( *this );
       
    78     iStarted = ETrue;    
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // CCmSmContentChangeObserver::IsStarted
       
    83 // ---------------------------------------------------------------------------
       
    84 // 
       
    85 TBool CCmSmContentChangeObserver::IsStarted()
       
    86     {
       
    87     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::IsStarted")); 
       
    88     
       
    89     return iStarted;
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // CCmSmContentChangeObserver::HandleObjectNotification
       
    94 // ---------------------------------------------------------------------------
       
    95 // 
       
    96 void CCmSmContentChangeObserver::HandleObjectNotification(
       
    97                                   CMdESession& /*aSession*/, 
       
    98 						          TObserverNotificationType /*aType*/,
       
    99 						          const RArray<TItemId>& /*aObjectIdArray*/)
       
   100     {
       
   101     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::\
       
   102     HandleObjectNotification")); 
       
   103     
       
   104     iObserver.FileProcessingStatus( ECmSmContentChanged );
       
   105     }
       
   106     
       
   107 // ---------------------------------------------------------------------------
       
   108 // C++ default constructor
       
   109 // ---------------------------------------------------------------------------
       
   110 //            
       
   111 CCmSmContentChangeObserver::CCmSmContentChangeObserver( 
       
   112     CMdESession& aSession,
       
   113     MCmSmFileProcessingObserver& aObserver ) : iMdSSession( aSession ), 
       
   114     iObserver( aObserver )
       
   115     {
       
   116     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::\
       
   117     CCmSmContentChangeObserver")); 
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // ConstructL
       
   122 // ---------------------------------------------------------------------------
       
   123 //  
       
   124 void CCmSmContentChangeObserver::ConstructL()
       
   125     {
       
   126     LOG(_L("[STORE MNGR]\t CCmSmContentChangeObserver::ConstructL"));
       
   127     
       
   128     iStarted = EFalse;
       
   129     }    
       
   130 
       
   131 // End of file