homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h
branchRCL_3
changeset 14 15e4dd19031c
parent 0 79c6a41cd166
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
    22 */
    22 */
    23 
    23 
    24 #ifndef HSPSFAMILYLISTENER_H_
    24 #ifndef HSPSFAMILYLISTENER_H_
    25 #define HSPSFAMILYLISTENER_H_
    25 #define HSPSFAMILYLISTENER_H_
    26 
    26 
    27 #include <e32base.h>
    27 #include "hspsfamily.h"
    28 #include <w32std.h>
       
    29 
    28 
    30 #include "hspsthememanagement.h"
    29 class ChspsFamilyListener;
    31 
       
    32 
       
    33 /**
    30 /**
    34  * @ingroup group_hspsserver  
    31  * @ingroup group_hspsserver  
    35  * HandleFamilyChangeL.
    32  * HandleFamilyChangeL.
    36  * Handles notifications related to resolution/orientation changes.
    33  * Handles notifications related to resolution/orientation changes.
    37  * Clients are requested to reload UIs with a resolution specific widget set.      
    34  * Clients are requested to reload UIs with a resolution specific widget set.      
    45     {
    42     {
    46     public:
    43     public:
    47         virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0;
    44         virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0;
    48     };
    45     };
    49 
    46 
    50 /**
    47 
    51 *  @ingroup group_hspsserver
    48 class ChspsFamilyListenerActive : public CActive
    52 *  ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation.
    49 	{
    53 *  Used on emulator environment only. 
       
    54 *
       
    55 *  @lib hspsThemeServer.exe 
       
    56 *  @since S60 5.0
       
    57 */
       
    58 class ChspsFamilyListener : public CActive
       
    59     {
       
    60     public:  // Constructors and destructor
    50     public:  // Constructors and destructor
    61 
    51 
    62         /**
    52         /**
    63         * NewL
    53         * NewL
    64         * Two-phased constructor.
    54         * Two-phased constructor.
    65         */
    55         */
    66         static ChspsFamilyListener* NewL(
    56         static ChspsFamilyListenerActive* NewL(
       
    57                 ChspsFamilyListener& aListener,
    67                 MhspsFamilyObserver& aObserver );
    58                 MhspsFamilyObserver& aObserver );
    68         
    59         
    69         /**
    60         /**
    70         * ~ChspsFamilyListener
    61         * ~ChspsFamilyListener
    71         * Destructor.
    62         * Destructor.
    72         */
    63         */
    73         virtual ~ChspsFamilyListener();
    64         virtual ~ChspsFamilyListenerActive();
    74         
    65         
       
    66 
       
    67     private:
       
    68 
    75         /**
    69         /**
    76          * Retrieves family type from a string
    70         * ConstructL
    77          * @since S60 5.0 
    71         * By default Symbian 2nd phase constructor is private.
       
    72         */
       
    73         void ConstructL();
       
    74 
       
    75         ChspsFamilyListenerActive(
       
    76                         ChspsFamilyListener& aListener,
       
    77                         MhspsFamilyObserver& iObserver);
       
    78 
       
    79     public:
       
    80          /**
       
    81          * Start listener.
    78          */
    82          */
    79         static ThspsFamily GetFamilyType( 
    83         void Queue();
    80                 const TDesC8& aFamilyString );
    84 
    81         
       
    82         /**
       
    83          * Retrieves family type from the current resolution.
       
    84          * @since S60 5.0
       
    85          * @return Family id
       
    86          */
       
    87         ThspsFamily GetFamilyType();
       
    88                 
       
    89     protected:  // Functions from base classes
    85     protected:  // Functions from base classes
    90 
    86 
    91         /**
    87         /**
    92         * From CActive Called when asynchronous request has completed
    88         * From CActive Called when asynchronous request has completed
    93         * RunL
    89         * RunL
   106          * RunError
   102          * RunError
   107          * Handles a leave occurring in the request completion event handler RunL().
   103          * Handles a leave occurring in the request completion event handler RunL().
   108          * @since S60 5.0 
   104          * @since S60 5.0 
   109          */
   105          */
   110         TInt RunError(TInt aError);
   106         TInt RunError(TInt aError);
       
   107         
       
   108     private: // data
       
   109     
       
   110         // Listener reference, not owned
       
   111         ChspsFamilyListener& iListener;
       
   112 
       
   113         // Observer which is called when RunL occurs
       
   114         MhspsFamilyObserver& iObserver;
       
   115 
       
   116 	};
       
   117 
       
   118 /**
       
   119 *  @ingroup group_hspsserver
       
   120 *  ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation.
       
   121 *  Used on emulator environment only. 
       
   122 *
       
   123 *  @lib hspsThemeServer.exe 
       
   124 *  @since S60 5.0
       
   125 */
       
   126 class ChspsFamilyListener : public ChspsFamily
       
   127     {
       
   128     public:  // Constructors and destructor
       
   129 
       
   130         /**
       
   131         * NewL
       
   132         * Two-phased constructor.
       
   133         */
       
   134         static ChspsFamilyListener* NewL(
       
   135                 MhspsFamilyObserver& aObserver );
       
   136         
       
   137         /**
       
   138         * ~ChspsFamilyListener
       
   139         * Destructor.
       
   140         */
       
   141         virtual ~ChspsFamilyListener();
       
   142         
   111 
   143 
   112     private:
   144     private:
   113 
   145 
   114         /**
   146         /**
   115         * ConstructL
   147         * ConstructL
   116         * By default Symbian 2nd phase constructor is private.
   148         * By default Symbian 2nd phase constructor is private.
   117         */
   149         */
   118         void ConstructL();
   150         void ConstructL( MhspsFamilyObserver& aObserver );
   119 
   151 
   120         /**
   152         /**
   121         * ChspsCenRepListener
   153         * ChspsCenRepListener
   122         * C++ default constructor.
   154         * C++ default constructor.
   123         */
   155         */
   124         ChspsFamilyListener( 
   156         ChspsFamilyListener();
   125                 MhspsFamilyObserver& aObserver );
       
   126         
   157         
   127         /**
       
   128          * Start listener.
       
   129          */
       
   130         void Queue();
       
   131         
   158         
   132         /**
   159         /**
   133          * Retrieves used display code.
   160          * Retrieves used display code.
   134          */
   161          */
   135         void GetFamilyString(        
   162         void GetFamilyString(        
   136                 TDes8& aFamily );                
   163                 TDes8& aFamily );                
   137 
   164 
   138     private:    // Data
   165     private:    // Data
   139 
   166 
   140         // Observer which is called when RunL occurs
       
   141         MhspsFamilyObserver& iObserver;
       
   142         
       
   143         // Window server session.
       
   144         RWsSession iWsSession;   
       
   145         
       
   146         // Client-side handle to a server-side window group.
   167         // Client-side handle to a server-side window group.
   147         RWindowGroup iWindowGroup;
   168         RWindowGroup iWindowGroup;
   148         
   169         
   149         CWsScreenDevice* iScreenDevice;
   170         ChspsFamilyListenerActive* iFamilyListenerActive;
   150         
       
   151         TUint32 iActiveFamily;
       
   152         
       
   153         TBool iFeatureManagerLoaded;
       
   154         
   171         
   155     };
   172     };
   156 
   173 
   157 #endif /* HSPSFAMILYLISTENER_H_ */
   174 #endif /* HSPSFAMILYLISTENER_H_ */
   158 
   175