psln/pslnengine/inc/PslnEcomListener.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     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:  Listens to ECOM for screensaver plugin changes.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNECOMLISTENER_H
       
    20 #define C_PSLNECOMLISTENER_H
       
    21 
       
    22 #include    <e32base.h>
       
    23 #include    <ecom/ecom.h>
       
    24 
       
    25 class CPslnModel;
       
    26 class REComSession;
       
    27 class MPslnScreenSaverECOMObserver;
       
    28 
       
    29 /**
       
    30  *  Listens to ECOM for screensaver plugin changes.
       
    31  *
       
    32  *  Monitor changes in ECOM framework and requests model to update screensaver list, 
       
    33  *  if a change is notified.
       
    34  *
       
    35  *  @lib PslnEngine
       
    36  *  @since S60 v3.1
       
    37  */
       
    38 NONSHARABLE_CLASS( CPslnEcomListener ): public CActive
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43     * Creates a new instance of CPslnEcomListener. Listener starts immediately
       
    44     * monitor ECOM and continues to do so, until class is destroyed.
       
    45     * @param aModel reference to PslnModel.
       
    46     * @return new instance of CPslnEcomListener.
       
    47     */
       
    48     IMPORT_C static CPslnEcomListener* NewL( 
       
    49         CPslnModel& aModel, 
       
    50         MPslnScreenSaverECOMObserver& aObserver );
       
    51 
       
    52     virtual ~CPslnEcomListener();
       
    53 
       
    54     /**
       
    55     * From CActive. 
       
    56     * Called when Active Object is ready.
       
    57     */
       
    58     void RunL();
       
    59 
       
    60     /**
       
    61     * From CActive. 
       
    62     * Called when Active Object has been cancelled.
       
    63     */
       
    64     void DoCancel();
       
    65 
       
    66 
       
    67 private:
       
    68 
       
    69     /* Starts listening for ECOM changes */
       
    70     void StartECOMMonitoringL();
       
    71 
       
    72     CPslnEcomListener( 
       
    73         CPslnModel& aModel, 
       
    74         MPslnScreenSaverECOMObserver& aObserver );
       
    75 
       
    76     void ConstructL();
       
    77 
       
    78 private: // data
       
    79 
       
    80     /**
       
    81      * Psln engine model reference.
       
    82      * Not own.
       
    83      */
       
    84     CPslnModel* iModel;
       
    85 
       
    86     /**
       
    87      * ECOM session.
       
    88      */
       
    89     REComSession iSession;
       
    90 
       
    91     /**
       
    92      * Observer interface,
       
    93      * Not own.
       
    94      */
       
    95     MPslnScreenSaverECOMObserver* iObserver;
       
    96 
       
    97     };
       
    98 
       
    99 
       
   100 #endif // C_PSLNECOMLISTENER_H
       
   101 
       
   102 // End of file