vtengines/videoteleng/Inc/Base/CVtEngCRObserverItem.h
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2004-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:  Central repository observer class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CVTENGCROBSITEM_H
       
    20 #define CVTENGCROBSITEM_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32std.h>
       
    25 #include "cenrepnotifyhandler.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVtEngCRSettingObserver;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  Central repository listener for video telephony.
       
    34 *
       
    35 *  @lib videoteleng.lib
       
    36 *  @since Series 60 3.0
       
    37 */
       
    38 NONSHARABLE_CLASS( CVtEngCRObserverItem ) : public CBase,
       
    39     public MCenRepNotifyHandlerCallback
       
    40     {
       
    41     public:  // Constructors and destructor.
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * @param aObserver the real observer to notify
       
    46         * @param aUid UID for this listener
       
    47         * @param aKey ID for this listener
       
    48         * @param aType type of information interested in
       
    49         * @return this CR observer
       
    50         */
       
    51         static CVtEngCRObserverItem* NewL( 
       
    52             MVtEngCRSettingObserver* aObserver,
       
    53             TUid aUid, TUint32 aKey, 
       
    54             CCenRepNotifyHandler::TCenRepKeyType aType );
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CVtEngCRObserverItem();
       
    60 
       
    61     public: // From MCenRepNotifyHandlerCallback.
       
    62 
       
    63         /**
       
    64         * Callback to notify changed integer setting.
       
    65         * @param aId changed id
       
    66         * @param aNewValue 
       
    67         */
       
    68         void HandleNotifyInt( TUint32 aId, TInt aNewValue );
       
    69 
       
    70         /**
       
    71         * Callback to notify changed real setting.
       
    72         * @param aId changed id
       
    73         * @param aNewValue 
       
    74         */
       
    75         void HandleNotifyReal( TUint32 aId, TReal aNewValue );
       
    76 
       
    77         /**
       
    78         * Callback to notify changed string setting.
       
    79         * @param aId changed id
       
    80         * @param aNewValue 
       
    81         */
       
    82         void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue );
       
    83 
       
    84         /**
       
    85         * Callback to notify changed binary setting.
       
    86         * @param aId changed id
       
    87         * @param aNewValue 
       
    88         */
       
    89         void HandleNotifyBinary( TUint32 aId, const TDesC8& aNewValue );
       
    90 
       
    91         /**
       
    92         * Callback to notify changed setting.
       
    93         * @param aId changed id
       
    94         */
       
    95         void HandleNotifyGeneric( TUint32 aId);
       
    96 
       
    97         /**
       
    98         * Callback to notify of an occurred error.
       
    99         * @param aId changed id
       
   100         * @param aError 
       
   101         * @param aHandler which handler
       
   102         */
       
   103         void HandleNotifyError( TUint32 aId, TInt aError, 
       
   104             CCenRepNotifyHandler* aHandler );
       
   105         
       
   106         public: // New functions.
       
   107         
       
   108         /**
       
   109         * Checks if this one matches given UID and key.
       
   110         * @param aUID UID to use in comparison 
       
   111         * @param aKey key to use in comparison
       
   112         * @return ETrue if match
       
   113         */
       
   114         TBool Offer( const TUid aUid, const TUint32 aKey ) const;
       
   115         
       
   116         /**
       
   117         * Checks if this one matches given UID.
       
   118         * @param aUID UID to use in comparison 
       
   119         * @return ETrue if match
       
   120         */
       
   121         TBool Offer( const TUid aUid ) const;
       
   122         
       
   123         /**
       
   124         * Checks if this one matches given key.
       
   125         * @param aKey key to use in comparison 
       
   126         * @return ETrue if match
       
   127         */
       
   128         TBool Offer( const TUint32 aKey ) const;
       
   129         
       
   130         /**
       
   131         * Returns UID of this handler.
       
   132         * @return UID
       
   133         */
       
   134         TUid Uid() const;
       
   135 
       
   136         /**
       
   137         * Returns key of this handler.
       
   138         * @return key
       
   139         */
       
   140         TUint32 Key() const;
       
   141         
       
   142         /**
       
   143         * Returns notifier of this handler.
       
   144         * @return notifier
       
   145         */
       
   146         CCenRepNotifyHandler* Notifier() const;
       
   147         
       
   148         /**
       
   149         * Returns type of this handler.
       
   150         * @return type
       
   151         */
       
   152         CCenRepNotifyHandler::TCenRepKeyType Type() const;
       
   153         
       
   154         /**
       
   155         * Returns observer of this handler.
       
   156         * @return observer
       
   157         */
       
   158         MVtEngCRSettingObserver* Observer() const;
       
   159         
       
   160         /**
       
   161         * Sets CenRep notifier
       
   162         * @param notifier to set.
       
   163         */
       
   164         void SetCenRepNotifier( CCenRepNotifyHandler* aNotifier );
       
   165         
       
   166         
       
   167     private: // Constructor.
       
   168 
       
   169         /**
       
   170         * C++ default constructor.
       
   171         * @param aObserver the real observer to notify
       
   172         * @param aUid UID for this listener
       
   173         * @param aKey ID for this listener
       
   174         * @param aType type of information interested in
       
   175         */
       
   176         CVtEngCRObserverItem( MVtEngCRSettingObserver* Observer,
       
   177             TUid aUid, TUint32 aKey, 
       
   178             CCenRepNotifyHandler::TCenRepKeyType aType );
       
   179 
       
   180     private:    // Data
       
   181 
       
   182         // Callback for notifications.
       
   183         MVtEngCRSettingObserver* iObserver;
       
   184 
       
   185         // UID for this item.
       
   186         TUid                     iUid;
       
   187 
       
   188         // Key for this item.
       
   189         TUint32                  iKey;
       
   190 
       
   191         // Type of listener.
       
   192         CCenRepNotifyHandler::TCenRepKeyType iType;
       
   193 
       
   194         // Central repository notifier.
       
   195         CCenRepNotifyHandler*   iNotifier;
       
   196 };
       
   197 #endif      // CVTENGCROBSITEM_H
       
   198             
       
   199 // End of File