taskswitcher/contextengine/tsfswpreviewprovider/inc/tspreviewprovider.h
changeset 4 4d54b72983ae
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
       
     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:  Preview provider API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TSFASTSWAPPREVIEWPROVIDER_H
       
    20 #define TSFASTSWAPPREVIEWPROVIDER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <gdi.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CTsFastSwapPreviewProviderClient;
       
    28 class MTsFastSwapPreviewObserver;
       
    29 
       
    30 /**
       
    31  * Preview provider API class. Applications (window groups) must be
       
    32  * registered before screenshots can be received. Also, closed apps
       
    33  * should be unregistered to save resources.
       
    34  * TakePreview() can be called to take a screenshot right away.
       
    35  * A client needing notifications has to create an instance
       
    36  * so that screenshots can be delivered to it via MTsFastSwapPreviewObserver.
       
    37  *
       
    38  * @see MTsFastSwapPreviewObserver
       
    39  * @lib tspreviewprovider.lib
       
    40  */
       
    41 NONSHARABLE_CLASS( CTsFastSwapPreviewProvider ) : public CBase
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Two phased constructor.
       
    47      * @see MTsFastSwapPreviewObserver
       
    48      *
       
    49      * @param aObs Observer.     
       
    50      */   
       
    51     IMPORT_C static CTsFastSwapPreviewProvider* NewL(
       
    52         MTsFastSwapPreviewObserver& aObs );
       
    53     
       
    54     /**
       
    55      * Destructor.
       
    56      */   
       
    57     IMPORT_C ~CTsFastSwapPreviewProvider();
       
    58     
       
    59     /**
       
    60      * Registers window group for screenshots.
       
    61      *
       
    62      * @param aWgId Window group id.
       
    63      * @return Error code.     
       
    64      */       
       
    65     IMPORT_C TInt Register( TInt aWgId );
       
    66     
       
    67     /**
       
    68      * Unregisters window group.
       
    69      *
       
    70      * @param aWgId Window group id.
       
    71      * @return Error code.     
       
    72      */       
       
    73     IMPORT_C TInt Unregister( TInt aWgId );
       
    74     
       
    75     /**
       
    76      * Change screen.
       
    77      *
       
    78      * @param aScreenId Screen id.
       
    79      * @return Error code.     
       
    80      */       
       
    81     IMPORT_C TInt ChangeScreen( TInt aScreenId );
       
    82     
       
    83     /**
       
    84      * Defines the dimensions and format of the screenshots.
       
    85      * @see TDisplayMode.
       
    86      *
       
    87      * @param aSize Size to be used for the preview screenshots.
       
    88      * @param aMode Color depth to be used for the preview screenshots.
       
    89      * @return Error code.
       
    90      */       
       
    91     IMPORT_C TInt SetPreviewParam( const TSize& aSize, TDisplayMode aMode );
       
    92     
       
    93     /**
       
    94      * Takes a screenshot.
       
    95      * 
       
    96      * @return Error code.     
       
    97      */       
       
    98     IMPORT_C TInt TakePreview();
       
    99     
       
   100     /**
       
   101      * Ack preview ready message
       
   102      */
       
   103     IMPORT_C void AckPreview( TInt aPreviewId );
       
   104     
       
   105 private:
       
   106 
       
   107     /**
       
   108      * C++ constructor.
       
   109      */   
       
   110     CTsFastSwapPreviewProvider();
       
   111     
       
   112     /**
       
   113      * 2nd phase constructor.
       
   114      *
       
   115      * @param aObs Observer.
       
   116      */       
       
   117     void ConstructL( MTsFastSwapPreviewObserver& aObs );
       
   118        
       
   119 private:    
       
   120 
       
   121     /**
       
   122      * Implementation class.
       
   123      */   
       
   124     CTsFastSwapPreviewProviderClient* iClient;
       
   125     };
       
   126 
       
   127 #endif // TSFASTSWAPPREVIEWPROVIDER_H
       
   128 
       
   129 // End of file