srsf/nssvasapi/nssvasdb/inc/nssvasmcoresyncrecoveryhandler.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2002 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:  The MCoreDbSyncRecoveryHandler provides means to restore the database
       
    15 *                synchronisation between Speech Recognition DB (SR DB) and VAS DB.
       
    16 *
       
    17 *                Training a new name saves stuff to SR DB. The SaveTag() call saves
       
    18 *                stuff to VAS DB. If the client decides after training not to save, or
       
    19 *                battery is removed between training the name and saving it, then the
       
    20 *                two databases are out of sync.
       
    21 *                These functions add to VAS DB enough information for proper rollback.
       
    22 *                If they are called before changing SR DB, the databases will always
       
    23 *                stay in sync.
       
    24 *
       
    25 *
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef MNSSCORERECOVERYHANDLER_H
       
    30 #define MNSSCORERECOVERYHANDLER_H
       
    31 
       
    32 class CNssTag;
       
    33 
       
    34 /**
       
    35 * The MNssCoreSrsDBEventHandler provides interface to handle events
       
    36 * from Save and Delete utterance data into SRS.
       
    37 *
       
    38 *  @lib NssVasApi.lib
       
    39 *  @since 2.0
       
    40 */
       
    41 class MNssCoreSyncRecoveryHandler
       
    42 {
       
    43 public:
       
    44 
       
    45    /**
       
    46    * Recovery functions.
       
    47    * These are called, before changing the speech recognition database.
       
    48    * They save enough information to clean up and fall back, if:
       
    49    * (a) The client changes SR DB, but doesn't save the tag.
       
    50    * (b) A crash happens during operation.
       
    51    */
       
    52 
       
    53    /**
       
    54    * Callback
       
    55    * @return None
       
    56    */
       
    57    virtual void PrepareRecoveryInTraining( const RPointerArray<CNssSpeechItem>& anArray,
       
    58                                            const CNssContext* aContext )=0;
       
    59 
       
    60    /**
       
    61    * Callback
       
    62    * @return None
       
    63    */
       
    64    virtual void PrepareRecoveryInChanging(const RPointerArray<CNssSpeechItem>& anArray)=0;
       
    65 
       
    66    /**
       
    67    * Callback
       
    68    * @return None
       
    69    */
       
    70    virtual void PrepareRecoveryInDeleting(const RPointerArray<CNssSpeechItem>& anArray)=0;
       
    71 
       
    72 
       
    73 };
       
    74 
       
    75 #endif