srsf/nssvasapi/nssvasdb/inc/nssvascdbtagselectnotifier.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2002-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:  CNssDBTagSelectNotifier provides tag select notification to 
       
    15 *               its clients (observers). It itslef receives tag select notification
       
    16 *               from Recognition Handler.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef NSSVASCDBTAGSELECTNOTIFIER_H
       
    22 #define NSSVASCDBTAGSELECTNOTIFIER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "nssvascvasdatabase.h"
       
    26 #include "nssvasmdbtagselectnotifierclient.h"
       
    27 
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 /**
       
    31 *  CNssDBTagSelectNotifier provides tag select notification to its clients.
       
    32 *  @lib NssVASApi.lib
       
    33 *  @since 2.8
       
    34 */
       
    35 class CNssDBTagSelectNotifier : public CActive
       
    36 {
       
    37 public:
       
    38 
       
    39    /**
       
    40    * 2 Phase construction
       
    41    * @param aVasDatabase - a pointer to the datatbase
       
    42    * @return a pointer to CNssDBTagSelectNotifier
       
    43    */
       
    44 	static CNssDBTagSelectNotifier* NewL( CNssVASDatabase* aVasDatabase );
       
    45    
       
    46    /**
       
    47    * 2 Phase construction
       
    48    * @param aVasDatabase - a pointer to the datatbase
       
    49    * @return a pointer to CNssDBTagSelectNotifier
       
    50    */
       
    51 	static CNssDBTagSelectNotifier* NewLC( CNssVASDatabase* aVasDatabase );
       
    52    
       
    53 	/**
       
    54    * Destructor.
       
    55    */	
       
    56 	~CNssDBTagSelectNotifier();
       
    57    
       
    58    /**
       
    59    * Register a client (observer) for tag select notification
       
    60    * @since 2.0
       
    61    * @param aObserver - MNssDBTagSelectNotifierClient 
       
    62    * @return error code
       
    63    */
       
    64    TInt RegisterForNotification( MNssDBTagSelectNotifierClient* aObserver );
       
    65 
       
    66    /**
       
    67    * Deregister a client (observer) from tag select notification
       
    68    * @since 2.0
       
    69    * @param aObserver - MNssDBTagSelectNotifierClient 
       
    70    * @return error code
       
    71    */
       
    72    TInt Deregister( MNssDBTagSelectNotifierClient* aObserver );
       
    73 
       
    74    /**
       
    75    * Handle selection, called by regconition when tag is selected
       
    76    * @since 2.0
       
    77    * @param None
       
    78    * @return None
       
    79    */
       
    80 	void HandleSelection( CNssTag* aTag );
       
    81 
       
    82 private:
       
    83 
       
    84     /**
       
    85     * C++ constructor
       
    86     */
       
    87     CNssDBTagSelectNotifier();
       
    88 
       
    89     /**
       
    90     * Overloaded C++constructor
       
    91     */
       
    92     CNssDBTagSelectNotifier( CNssVASDatabase* aVasDatabase );
       
    93 
       
    94     /**
       
    95     * Symbian construtor
       
    96     */
       
    97     void ConstructL ();
       
    98 
       
    99     /**
       
   100     * Handles selection of a tag based on tag and context ids
       
   101     *
       
   102     * @param "TInt aTagId" Tag identifier
       
   103     * @param "TInt aContextId" Context identifier
       
   104     */
       
   105     void DoHandleSelectionCallback( TInt aTagId, TInt aContextId );
       
   106 
       
   107 private: // From CActive
       
   108 
       
   109     void RunL();
       
   110     void DoCancel();
       
   111 
       
   112 private: 
       
   113 	// pointer to the VAS datatbase
       
   114 	CNssVASDatabase* iVasDatabase;
       
   115 
       
   116 	// list of observers (clients)
       
   117 	CArrayPtrFlat<MNssDBTagSelectNotifierClient> *iObserverList;
       
   118 	
       
   119 	// P&S handle
       
   120 	RProperty iProperty;
       
   121 	
       
   122 	// Values read from P&S
       
   123 	TInt iTagId;
       
   124 	TInt iContextId;
       
   125 };
       
   126 
       
   127 #endif // NSSVASCDBTAGSELECTNOTIFIER_H
       
   128 
       
   129 // End of file