convergedcallengine/csplugin/inc/csppubsublistener.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 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:  Declarations for class CCSPPubSubListener
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSPPUBSUBLISTENER_H
       
    20 #define CSPPUBSUBLISTENER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32std.h>
       
    25 #include <e32property.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MCSPPubSubObserver;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  RProperty poller.
       
    34 *
       
    35 *  @lib videoteleng.lib
       
    36 *  @since Series 60 2.8
       
    37 */
       
    38 NONSHARABLE_CLASS( CSPPubSubListener ) : public CActive
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41         
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param aUid the Uid to use
       
    45         * @param aKey item's key
       
    46         * @param aObserver callback interface for notification
       
    47         * @return instance of CSPPubSubListener
       
    48         */
       
    49         static CSPPubSubListener* NewL( const TUid aUid, const TInt aKey, 
       
    50             MCSPPubSubObserver* aObserver );
       
    51         
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         virtual ~CSPPubSubListener();
       
    56         
       
    57     public: // New functions.
       
    58 
       
    59         /**
       
    60         * Gets integer value from P & S.
       
    61         * @param aVal a value in return
       
    62         * @return error code
       
    63         */       
       
    64         TInt Get( TInt& aVal );
       
    65 
       
    66         /**
       
    67         * Gets 8 bit string value from P&S.
       
    68         * @param aVal a value in return
       
    69         * @return error code
       
    70         */
       
    71         TInt Get( TDes8& aVal );
       
    72         
       
    73         /**
       
    74         * Gets 16 bit descriptor value from P&S.
       
    75         * @param aVal a value in return
       
    76         * @return error code
       
    77         */
       
    78         TInt Get( TDes16& aVal );
       
    79 
       
    80     private: // New functions.
       
    81 
       
    82         /**
       
    83         * Starts the listening (RunL).
       
    84         */
       
    85         void StartListening();
       
    86 
       
    87     private: // From CActive.
       
    88 
       
    89         /** @see CActive::RunL */
       
    90         virtual void RunL();
       
    91 
       
    92         /** @see CActive::Cancel */
       
    93         virtual void DoCancel();
       
    94 
       
    95         /** @see CActive::RunError */
       
    96         virtual TInt RunError( TInt aError );
       
    97 
       
    98     private:
       
    99 
       
   100         /**
       
   101         * Constructor of the listener.
       
   102         * @param aUid the Uid to use
       
   103         * @param aKey item's key
       
   104         * @param aObserver callback interface for notification
       
   105         */
       
   106         CSPPubSubListener( const TUid aUid,  TInt aKey, 
       
   107             MCSPPubSubObserver* aObserver );
       
   108 
       
   109         /**
       
   110         * By default Symbian 2nd phase constructor is private.
       
   111         */
       
   112         void ConstructL();
       
   113     
       
   114     private:    // Data
       
   115     
       
   116         /** UID of the monitored item. */
       
   117         TUid        iUid;
       
   118         
       
   119         /** ID of the monitored item. */
       
   120         TInt        iId;
       
   121         
       
   122         /** Property to subscribe to. */
       
   123         RProperty   iProperty;
       
   124         
       
   125         /** Observer for PS notifications. */
       
   126         MCSPPubSubObserver* iObserver;
       
   127     };
       
   128 
       
   129 #endif // CVTENGPUBSUBSGSETTINGS_H
       
   130 // End of File