voipplugins/sipconnectionprovider/inc/scppropertynotifier.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2002-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CSCPPROPERTYNOTIFIER_H
       
    20 #define C_CSCPPROPERTYNOTIFIER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32property.h>
       
    24 
       
    25 class MScpPropertyObserver;
       
    26 
       
    27 /**
       
    28 *  Property notifier
       
    29 *
       
    30 */
       
    31 class CScpPropertyNotifier : public CActive
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Two-phased constructor.
       
    37      */
       
    38     static CScpPropertyNotifier* NewL( TUid aUid, 
       
    39                                        TInt aType,
       
    40                                        MScpPropertyObserver& aObserver  );
       
    41     
       
    42     /**
       
    43      * Destructor.
       
    44      */
       
    45     virtual ~CScpPropertyNotifier();
       
    46 
       
    47     /**
       
    48      * Returns the property's value
       
    49      * @param aValue Value
       
    50      * @return Symbian error codes
       
    51      */
       
    52     TInt GetValue( TInt& aValue ) const;
       
    53        
       
    54 // From CActive         
       
    55 private:
       
    56 
       
    57     /**
       
    58      * RunL
       
    59      */
       
    60     void RunL();
       
    61     
       
    62     /**
       
    63      * Catches errors if RunL leaves
       
    64      * @param aError error code
       
    65      * @return error code
       
    66      */
       
    67     TInt RunError( TInt aError );
       
    68     
       
    69     /**
       
    70      * Cancels the monitor
       
    71      */
       
    72     void DoCancel();  
       
    73 
       
    74 private:
       
    75 
       
    76     /**
       
    77      * C++ default constructor.
       
    78      */
       
    79     CScpPropertyNotifier( TUid aUid, 
       
    80                           TInt aType, 
       
    81                           MScpPropertyObserver& aObserver );
       
    82     
       
    83     /**
       
    84      * ConstructL
       
    85      */
       
    86     void ConstructL();
       
    87 
       
    88     /**
       
    89      * Subscribes to property's notifications
       
    90      */
       
    91     void Subscribe();
       
    92 
       
    93 private:
       
    94 
       
    95     /**
       
    96      * UID of the property
       
    97      */
       
    98     TUid iUid;
       
    99     
       
   100     /**
       
   101      * Property type
       
   102      */
       
   103     TInt iType; 
       
   104 
       
   105     /**
       
   106      * Property observer
       
   107      */
       
   108     MScpPropertyObserver& iObserver;
       
   109 
       
   110     /**
       
   111      * Property
       
   112      */
       
   113     RProperty iProperty;
       
   114 
       
   115 #ifdef _DEBUG
       
   116 
       
   117 friend class T_CScpPropertyNotifier;
       
   118 
       
   119 #endif
       
   120 
       
   121     };
       
   122 
       
   123 
       
   124 #endif      // C_CSCPPROPERTYNOTIFIER_H   
       
   125             
       
   126 // End of File