javauis/mmapi_akn/baseline/inc/cmmacallstatemonitor.h
branchRCL_3
changeset 60 6c158198356e
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Publish and Subscribe key watcher
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMMACALLSTATEMONITOR_H
       
    20 #define CMMACALLSTATEMONITOR_H
       
    21 
       
    22 #include <e32property.h>
       
    23 
       
    24 class MMMACallStateObserver;
       
    25 
       
    26 /**
       
    27  *  Publish and subscribe key watcher.
       
    28  *
       
    29  *  @lib 
       
    30  */
       
    31 class CMMACallStateMonitor : public CActive
       
    32     {
       
    33 public:
       
    34 
       
    35     /*
       
    36     * Two Phased Constructor.
       
    37     *
       
    38     * @since 
       
    39     * @param aUid PubSub UID to watch
       
    40     * @param aKey specific key to watch
       
    41     * @return Construced object
       
    42     */
       
    43     static CMMACallStateMonitor* NewL( TUid aUid, TInt aKey,
       
    44                                             MMMACallStateObserver* aObserver );
       
    45 
       
    46     /*
       
    47     * virtual destructor.
       
    48     *
       
    49     * @since 
       
    50     */
       
    51     virtual ~CMMACallStateMonitor();
       
    52 
       
    53 public:     // New Functions
       
    54 
       
    55     /*
       
    56     * Return the value of the key.
       
    57     *
       
    58     * @since 
       
    59     * @param aValue
       
    60     * @return KErrNone, if successful otherwise system error
       
    61     */
       
    62     TInt GetValue( TInt& aValue );
       
    63     
       
    64 protected:  // From Base class
       
    65 
       
    66     /*
       
    67     * From CActive.
       
    68     *
       
    69     * @since 
       
    70     */
       
    71     void RunL();
       
    72     
       
    73     /*
       
    74     * From CActive.
       
    75     *
       
    76     * @since 
       
    77     */
       
    78     void DoCancel();
       
    79     
       
    80 private:
       
    81 
       
    82     /*
       
    83     * Default Constructor.
       
    84     *
       
    85     * @since 
       
    86     * @param aUid PubSub key to watch
       
    87     * @param aKey specific key to watch
       
    88     */
       
    89     CMMACallStateMonitor( TUid aUid,
       
    90                       TInt aKey,
       
    91                       MMMACallStateObserver* aObserver );
       
    92 
       
    93     /*
       
    94     * Second phased constructor.
       
    95     *
       
    96     * @since 
       
    97     */
       
    98     void ConstructL();
       
    99 
       
   100 private: // data
       
   101     
       
   102     RProperty             iProperty;
       
   103     MMMACallStateObserver*    iObserver;  // not owned
       
   104     TUid                  iUid;       // Uid that we are watching
       
   105     TInt                  iKey;       // Key that we are watching
       
   106     };
       
   107 
       
   108 #endif // C_MMAPSKEYWATCHER_H