taskswitcher/contextengine/hgfswserver/client/inc/hgfswclient.h
changeset 4 4d54b72983ae
parent 3 fb3763350a08
child 5 c743ef5928ba
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
     1 /*
       
     2  * ===========================================================================
       
     3  *  Name        : hgfswclient.h
       
     4  *  Part of     : Huriganes / Fast Swap Server
       
     5  *  Description : Client API
       
     6  *  Version     : %version: 6 %
       
     7  *
       
     8  *  Copyright © 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 __HGFSWCLIENT_H
       
    21 #define __HGFSWCLIENT_H
       
    22 
       
    23 #include <e32std.h>
       
    24 #include "hgfswentry.h"
       
    25 
       
    26 class MHgFswObserver;
       
    27 class CHgFswClientImpl;
       
    28 
       
    29 /**
       
    30  * Client API for the Huriganes Fast Swap Server.
       
    31  */    
       
    32 NONSHARABLE_CLASS( CHgFswClient ) : public CBase
       
    33     {
       
    34 public:
       
    35     /**
       
    36      * Possible values for aType argument of ForegroundAppUid().
       
    37      */
       
    38     enum THgFswFgAppType
       
    39         {
       
    40         /**
       
    41          * Means that even when the foreground app has another app embedded
       
    42          * into it the uid of the container application will be returned.
       
    43          */
       
    44         EUseStandaloneUid,
       
    45         /**
       
    46          * Means that if the foreground app has another app embedded
       
    47          * into it then the returned uid will be the uid of the embedded
       
    48          * app.
       
    49          */
       
    50         EUseEmbeddedUid
       
    51         };
       
    52 
       
    53     /**
       
    54      * Creates a new instance.
       
    55      * @capability LocalServices
       
    56      */
       
    57     IMPORT_C static CHgFswClient* NewL();
       
    58     
       
    59     /**
       
    60      * Creates a new instance.
       
    61      * @capability LocalServices
       
    62      */
       
    63     IMPORT_C static CHgFswClient* NewLC();
       
    64     
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     ~CHgFswClient();
       
    69     
       
    70     /**
       
    71      * Queries the fast swap content from the server and
       
    72      * copies it into the given array.
       
    73      * Previous content of the array is removed (by using ResetAndDestroy).
       
    74      * @param   aDst    array to which data is stored
       
    75      * @capability LocalServices
       
    76      */
       
    77     IMPORT_C void GetContentL( RHgFswArray& aDst );
       
    78     
       
    79     /**
       
    80      * Subscribes for continuous notifications about changes in the
       
    81      * fast swap content.
       
    82      * The notifications are generated until CancelSubscribe is called
       
    83      * or the instance is destroyed.
       
    84      * @capability LocalServices
       
    85      */
       
    86     IMPORT_C void Subscribe( MHgFswObserver& aObserver );
       
    87     
       
    88     /**
       
    89      * Cancels the subscription for change notifications.
       
    90      * @capability LocalServices
       
    91      */
       
    92     IMPORT_C void CancelSubscribe();
       
    93     
       
    94     /**
       
    95      * Tries to close the application with the given id.
       
    96      * @capability LocalServices
       
    97      */
       
    98     IMPORT_C void CloseApp( TInt aWgId );
       
    99     
       
   100     /**
       
   101      * Brings the application with the given id into foreground.
       
   102      * @capability LocalServices
       
   103      */
       
   104     IMPORT_C void SwitchToApp( TInt aWgId );
       
   105 
       
   106     /**
       
   107      * Returns the uid of the foreground app or KNullUid if something goes wrong.
       
   108      *
       
   109      * Will never return hidden apps, only those which can also be seen in the
       
   110      * array returned by GetContentL.
       
   111      *
       
   112      * However the handling of embedded applications might be different:
       
   113      * (as opposed to GetContentL)
       
   114      * If aType == EUseEmbeddedUid:
       
   115      *   This function will always return the embedded application's uid, unlike
       
   116      *   GetContentL which will always refer to the container app (except for the
       
   117      *   screenshot of course). This means that the returned uid is simply the
       
   118      *   uid belonging to the first (non-hidden, etc.) window group from the window group list.
       
   119      * If aType == EUseStandaloneUid:
       
   120      *   Embedded applications are ignored and the returned uid is the app uid belonging
       
   121      *   to the first parentless window group.
       
   122      */
       
   123     IMPORT_C TUid ForegroundAppUid( THgFswFgAppType aType );
       
   124 
       
   125 private:
       
   126     CHgFswClient();
       
   127     void ConstructL();
       
   128 
       
   129     CHgFswClientImpl* iImpl;
       
   130     };
       
   131 
       
   132 #endif