speechsrv_plat/vas_api/inc/nssvasmcontextmgr.h
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     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:  MNssContextManager interface provides context processing methods for 
       
    15 *				 the client. The client  gets an instance of the context manager 
       
    16 *				 from the vas db manager. The vas db manager owns the context manager 
       
    17 *				 and is responsible for deleting the context manager. Clients should not 
       
    18 *				 directly delete the context manager. The context manager is simply a 
       
    19 *				 colllection of utility methods  that are pure virtuals. These methods are implemented
       
    20 *				 internal to VAS, and thus transparent to the client.
       
    21 *
       
    22 */
       
    23 
       
    24 
       
    25 
       
    26 #ifndef MNSSCONTEXTMGR_H
       
    27 #define MNSSCONTEXTMGR_H
       
    28 
       
    29 #include <e32std.h>
       
    30 
       
    31 #include "nssvascoreconstant.h"
       
    32 
       
    33 //FORWARD DECLARATIONS
       
    34 class MNssGetContextClient;
       
    35 class MNssDeleteContextClient;
       
    36 class MNssSaveContextClient;
       
    37 class MNssContext;
       
    38 
       
    39 
       
    40 
       
    41 // CLASS DECLARATIONS
       
    42 /**
       
    43 *  MNssContextMgr is the public interface class for context management.
       
    44 *  It provides methods for context creation, saving context into the
       
    45 *  VAS database, retriving contexts from VAS database, and deletion of 
       
    46 *  context from the VAS database. A context manager cannot be instantiated
       
    47 *  directly but needs to be got from the VAS DB manager.
       
    48 *  @lib NssVASApi.lib
       
    49 *  @since 2.8
       
    50 *  
       
    51 */
       
    52 class MNssContextMgr
       
    53    {
       
    54 public:
       
    55     /**
       
    56     * Create a new empty context
       
    57     * @since 2.0
       
    58     * @param 
       
    59     * @return a reference to a new context object.
       
    60     */
       
    61     virtual MNssContext* CreateContextL()=0;
       
    62 
       
    63     /**
       
    64     * GetContext is called to retrieve a context from the VAS DB. 
       
    65     * This method is asynchronous. A call back will be made to 
       
    66     * either GetContextCompleted() or GetContextFailed() as
       
    67     * defined in the MNssGetContextClient interface. It also returns an
       
    68     * error code validating success of call to VAS DB.
       
    69     * @since 2.0
       
    70     * @param aContextClient - call back address
       
    71     * @param aName          - name of context to retreive
       
    72     * @return - syncronous error code from function return
       
    73     */    
       
    74     virtual TInt GetContext( MNssGetContextClient* aContextClient, const TDesC& aName ) = 0;
       
    75 
       
    76     /**
       
    77     * GetContextList is called to retrieve a context list from the VAS DB. 
       
    78     * This method is asynchronous. A call back will be made to 
       
    79     * either GetContextListCompleted() or GetContextFailed() as
       
    80     * defined in the MNssGetContextClient interface. It also returns an
       
    81     * error code validating success of call to VAS DB.
       
    82     * @since 2.0
       
    83     * @param aContextClient - call back address 
       
    84     * @param  
       
    85     * @return - syncronous error code from function return
       
    86     */    
       
    87     virtual TInt GetContextList( MNssGetContextClient* aContextClient ) = 0;
       
    88 
       
    89     /**
       
    90     * DeleteContext is called to remove a context from the VAS DB. 
       
    91     * This method is asynchronous. A call back will be made to 
       
    92     * either DeleteContextCompleted() or DeleteContextFailed() as
       
    93     * defined in the MNssDeleteContextClient interface. It also returns an
       
    94     * error code validating success of call to VAS DB.
       
    95     * @since 2.0
       
    96     * @param aContextClient - call back address
       
    97     * @param aContext       - context object to delete
       
    98     * @return syncronous error code from function return
       
    99     */     
       
   100     virtual TInt DeleteContext( MNssDeleteContextClient* aContextClient,
       
   101                                 MNssContext* aContext ) = 0;
       
   102     
       
   103     /**
       
   104     * SaveContext is called to store a context to the VAS DB. 
       
   105     * This method is asynchronous. A call back will be made to 
       
   106     * either SaveContextCompleted() or SaveContextFailed() as
       
   107     * defined in the MNssSaveContextClient interface. It also returns an
       
   108     * error code validating success of call to VAS DB.
       
   109     * @since 2.0
       
   110     * @param aContextClient - call back address
       
   111     * @param aContext       - context object to save
       
   112     * @return - syncronous error code from function return
       
   113     */
       
   114     virtual TInt SaveContext( MNssSaveContextClient* aContextClient, MNssContext* aContext ) = 0;
       
   115 
       
   116     /**
       
   117     * SaveClientData is called to save client-specific data about the context.
       
   118     * This method is asynchronous. A call back will be made to either
       
   119     * SaveContextCompleted or SaveContextFailed() as defined in the
       
   120     * MNssSaveContextClient interface. It also returns an error code validating
       
   121     * success of call to VAS DB.
       
   122     * @since 2.8
       
   123     * @param aContextClient - call back address.
       
   124     * @param aContext       - the client data of this context will be updated.
       
   125     * @param aClientData    - buffer of serialized client data, at most 100 bytes.
       
   126     */
       
   127     virtual TInt SaveClientData( MNssContext* aContext ) = 0;
       
   128     
       
   129     /**
       
   130     * Cancel get context / get context list / get global contexts 
       
   131     * @since 3.2
       
   132     * @param none
       
   133     * @return none
       
   134     */     
       
   135     virtual void CancelGetContext() = 0;
       
   136     
       
   137     };
       
   138 
       
   139 #endif // MNSSCONTEXTMGR_H