Recognizer.h

00001 /*---------------------------------------------------------------------------*
00002  *  Recognizer.h                                                             *
00003  *                                                                           *
00004  *  Copyright 2007 Nuance Communciations, Inc.                               *
00005  *                                                                           *
00006  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
00007  *  you may not use this file except in compliance with the License.         *
00008  *                                                                           *
00009  *  You may obtain a copy of the License at                                  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0                           *
00011  *                                                                           *
00012  *  Unless required by applicable law or agreed to in writing, software      *
00013  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
00014  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
00015  *  See the License for the specific language governing permissions and      *
00016  *  limitations under the License.                                           *
00017  *                                                                           *
00018  *---------------------------------------------------------------------------*/
00019 
00020 #ifndef __UAPI__RECOGNIZER
00021 #define __UAPI__RECOGNIZER
00022 
00023 #include "exports.h"
00024 #include "types.h"
00025 #include "SmartProxy.h"
00026 #include "Grammar.h"
00027 
00028 
00029 namespace android
00030 {
00031   namespace speech
00032   {
00033     namespace recognition
00034     {
00035       class GrammarProxy;
00036       class GrammarListenerProxy;
00037       class AudioStreamProxy;
00038       class ParametersProxy;
00039       class RecognizerListenerProxy;
00040     }
00041   }
00042 }
00043 
00044 
00045 //
00046 // DESIGN NOTES:
00047 //
00048 // @see http://ciaranm.org/show_post/146 for a discussion of shared_ptr and covariant return-types
00049 //
00050 namespace android
00051 {
00052   namespace speech
00053   {
00054     namespace recognition
00055     {
00056       class RecognizerProxy;
00062       class Recognizer
00063       {
00064         public:
00071           virtual void setListener(RecognizerListenerProxy& listener,
00072                                    ReturnCode::Type& returnCode) = 0;
00073 
00081           virtual GrammarProxy createGrammar(const char* value, GrammarListenerProxy& listener, ReturnCode::Type& returnCode) = 0;
00082 
00093           virtual void recognize(AudioStreamProxy& audio, GrammarProxy* grammars,
00094                                  ARRAY_LIMIT grammarCount,
00095                                  ReturnCode::Type& returnCode) = 0;
00096                                  
00107           virtual void recognize(AudioStreamProxy& audio, GrammarProxy& grammar,
00108                                  ReturnCode::Type& returnCode) = 0;
00109                                  
00115           virtual void stop(ReturnCode::Type& returnCode) = 0;
00116           
00125           virtual void setParameters(const char** keys, const char** values,
00126                                      ARRAY_LIMIT count, ReturnCode::Type& returnCode) = 0;
00127                                      
00135           virtual void getParameters(const char** keys, ARRAY_LIMIT count,
00136                                      ReturnCode::Type& returnCode) = 0;
00137         protected:
00141           Recognizer();
00145           virtual ~Recognizer();
00146           
00147           friend class RecognizerProxy;
00148       };
00149       
00150       /*
00151        * @see android::speech::recognition::SmartProxy
00152        */
00153       DECLARE_SMARTPROXY(UAPI_EXPORT, RecognizerProxy, android::speech::recognition::SmartProxy, Recognizer)
00154     }
00155   }
00156 }
00157 
00158 #endif

Generated on Thu May 1 17:16:37 2008 for UAPI by  doxygen 1.5.3