taskswitcher/contextengine/hgfswpreviewprovider/inc/hgpreviewprovider.h
changeset 4 4d54b72983ae
parent 3 fb3763350a08
child 5 c743ef5928ba
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
     1 /*
       
     2 * ==============================================================================
       
     3 *  Name        : %name: hgpreviewprovider.h %
       
     4 *  Part of     : Hg fast swap preview provider plugin
       
     5 *  Description : Preview provider API
       
     6 *  Version     : %version: sa1spcx1#2 %
       
     7 *
       
     8 *  Copyright (c) 2008 Nokia Corporation.
       
     9 *  This material, including documentation and any related
       
    10 *  computer programs, is protected by copyright controlled by
       
    11 *  Nokia Corporation. All rights are reserved. Copying,
       
    12 *  including reproducing, storing, adapting or translating, any
       
    13 *  or all of this material requires the prior written consent of
       
    14 *  Nokia Corporation. This material also contains confidential
       
    15 *  information which may not be disclosed to others without the
       
    16 *  prior written consent of Nokia Corporation.
       
    17 * ==============================================================================
       
    18 */
       
    19 
       
    20 #ifndef HGPREVIEWPROVIDER_H
       
    21 #define HGPREVIEWPROVIDER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <gdi.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CHgFastSwapPreviewProviderClient;
       
    29 class MHgFastSwapPreviewObserver;
       
    30 
       
    31 /**
       
    32  * Preview provider API class. Applications (window groups) must be
       
    33  * registered before screenshots can be received. Also, closed apps
       
    34  * should be unregistered to save resources.
       
    35  * TakePreview() can be called to take a screenshot right away.
       
    36  * A client needing notifications has to create an instance
       
    37  * so that screenshots can be delivered to it via MHgFastSwapPreviewObserver.
       
    38  *
       
    39  * @see MHgFastSwapPreviewObserver
       
    40  * @lib hgpreviewprovider.lib
       
    41  */
       
    42 NONSHARABLE_CLASS( CHgFastSwapPreviewProvider ) : public CBase
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two phased constructor.
       
    48      * @see MHgFastSwapPreviewObserver
       
    49      *
       
    50      * @param aObs Observer.     
       
    51      */   
       
    52     IMPORT_C static CHgFastSwapPreviewProvider* NewL(
       
    53         MHgFastSwapPreviewObserver& aObs );
       
    54     
       
    55     /**
       
    56      * Destructor.
       
    57      */   
       
    58     IMPORT_C ~CHgFastSwapPreviewProvider();
       
    59     
       
    60     /**
       
    61      * Registers window group for screenshots.
       
    62      *
       
    63      * @param aWgId Window group id.
       
    64      * @return Error code.     
       
    65      */       
       
    66     IMPORT_C TInt Register( TInt aWgId );
       
    67     
       
    68     /**
       
    69      * Unregisters window group.
       
    70      *
       
    71      * @param aWgId Window group id.
       
    72      * @return Error code.     
       
    73      */       
       
    74     IMPORT_C TInt Unregister( TInt aWgId );
       
    75     
       
    76     /**
       
    77      * Change screen.
       
    78      *
       
    79      * @param aScreenId Screen id.
       
    80      * @return Error code.     
       
    81      */       
       
    82     IMPORT_C TInt ChangeScreen( TInt aScreenId );
       
    83     
       
    84     /**
       
    85      * Defines the dimensions and format of the screenshots.
       
    86      * @see TDisplayMode.
       
    87      *
       
    88      * @param aSize Size to be used for the preview screenshots.
       
    89      * @param aMode Color depth to be used for the preview screenshots.
       
    90      * @return Error code.
       
    91      */       
       
    92     IMPORT_C TInt SetPreviewParam( const TSize& aSize, TDisplayMode aMode );
       
    93     
       
    94     /**
       
    95      * Takes a screenshot.
       
    96      * 
       
    97      * @return Error code.     
       
    98      */       
       
    99     IMPORT_C TInt TakePreview();
       
   100     
       
   101     /**
       
   102      * Ack preview ready message
       
   103      */
       
   104     IMPORT_C void AckPreview( TInt aPreviewId );
       
   105     
       
   106 private:
       
   107 
       
   108     /**
       
   109      * C++ constructor.
       
   110      */   
       
   111     CHgFastSwapPreviewProvider();
       
   112     
       
   113     /**
       
   114      * 2nd phase constructor.
       
   115      *
       
   116      * @param aObs Observer.
       
   117      */       
       
   118     void ConstructL( MHgFastSwapPreviewObserver& aObs );
       
   119        
       
   120 private:    
       
   121 
       
   122     /**
       
   123      * Implementation class.
       
   124      */   
       
   125     CHgFastSwapPreviewProviderClient* iClient;
       
   126     };
       
   127 
       
   128 #endif // HGPREVIEWPROVIDER_H
       
   129 
       
   130 // End of file