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