imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagimageobserver.h
changeset 54 48dd0f169f0d
parent 42 2e2a89493e2b
equal deleted inserted replaced
42:2e2a89493e2b 54:48dd0f169f0d
     1 /*
       
     2 * Copyright (c) 2006-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:  Thumbnail Auto Generate Daemon
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef THUMBAGIMAGEOBSERVER_H
       
    20 #define THUMBAGIMAGEOBSERVER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <w32std.h>
       
    24 
       
    25 #include <mdesession.h>
       
    26 
       
    27 #include "thumbagprocessor.h"
       
    28 #include "thumbnaillog.h"
       
    29 #include "tmshutdownobserver.h"
       
    30 
       
    31 /**
       
    32  *  ThumbAG daemon.
       
    33  *
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CThumbAGImageObserver ): public CBase, 
       
    37                                      public MMdESessionObserver,
       
    38                                      public MMdEObjectObserver,
       
    39                                      public MTMShutdownObserver
       
    40     {
       
    41 public:
       
    42 
       
    43     /**
       
    44      * Two-phased constructor
       
    45      *
       
    46      * @since S60 v5.0
       
    47      * @return New CThumbAGImageObserver server.
       
    48      */
       
    49     static CThumbAGImageObserver* NewLC(CThumbAGProcessor* aProcessor);
       
    50 
       
    51     /**
       
    52      * Two-phased constructor
       
    53      *
       
    54      * @since S60 v5.0
       
    55      * @return New CThumbAGImageObserver server.
       
    56      */
       
    57     static CThumbAGImageObserver* NewL(CThumbAGProcessor* aProcessor);
       
    58     
       
    59     /**
       
    60      * Destructor
       
    61      *
       
    62      * @since S60 v5.0
       
    63      */
       
    64     virtual ~CThumbAGImageObserver();
       
    65 
       
    66 
       
    67 public:
       
    68     
       
    69     // from MMdESessionObserver
       
    70     void HandleSessionOpened( CMdESession& aSession, TInt aError );
       
    71     void HandleSessionError( CMdESession& aSession, TInt aError );
       
    72     
       
    73     // from MMdEObjectObserver
       
    74     void HandleObjectNotification(CMdESession& aSession, 
       
    75                                   TObserverNotificationType aType,
       
    76                                   const RArray<TItemId>& aObjectIdArray);
       
    77     
       
    78     // from MTMShutdownObserver
       
    79     void ShutdownNotification();
       
    80     
       
    81 protected:
       
    82     
       
    83     /**
       
    84      * AddObserversL
       
    85      *
       
    86      * @since S60 v5.0
       
    87      */
       
    88     void AddObserversL();    
       
    89     
       
    90     
       
    91 private:
       
    92 
       
    93     /**
       
    94      * C++ default constructor
       
    95      *
       
    96      * @since S60 v5.0
       
    97      * @return New CThumbAGImageObserver instance.
       
    98      */
       
    99     CThumbAGImageObserver(CThumbAGProcessor* aProcessor);
       
   100 
       
   101     /**
       
   102      * Symbian 2nd phase constructor can leave.
       
   103      *
       
   104      * @since S60 v5.0
       
   105      */
       
   106     void ConstructL();
       
   107     
       
   108 	 /**
       
   109      * Initilization helper
       
   110      *
       
   111      * @since S60 v5.2
       
   112      */
       
   113     void InitializeL();
       
   114     
       
   115     /**
       
   116      * Callback for reconnect timer
       
   117      *
       
   118      * @since S60 v5.0
       
   119      */
       
   120     static TInt ReconnectCallBack(TAny* aAny);
       
   121 
       
   122 private:
       
   123 	
       
   124     // own
       
   125     CTMShutdownObserver* iShutdownObserver;
       
   126     CTMShutdownObserver* iMDSShutdownObserver;
       
   127     CMdESession* iMdESession;
       
   128     //not owned
       
   129     CThumbAGProcessor* iProcessor;
       
   130     
       
   131     TBool iShutdown;
       
   132  
       
   133     // reconnect timer
       
   134     CPeriodic* iReconnect;
       
   135     
       
   136     TBool iSessionError;
       
   137     
       
   138 #ifdef _DEBUG
       
   139     TUint32 iAddCounter;
       
   140     TUint32 iModCounter;
       
   141 #endif
       
   142 };
       
   143 
       
   144 #endif // THUMBAGDAEMON_H