00001 /* 00002 * ============================================================================ 00003 * Name : ocrsrv.h 00004 * Part of : OCR / ocrsrv 00005 * Interface : Optical Character Recognition API, OCR APIs 00006 * 00007 * Description : APIs of the OCR(Optical Character Recognition), current engine 00008 * can recognize 24 bit colored image and 8 bit gray scale image 00009 * in BMP format.And the size of images are also limited within 00010 * 1600x1200 in pixel 00011 * 00012 * Version : %version: 3 % 00013 * 00014 * Copyright 2002-2005 Nokia. All rights reserved. 00015 * This material, including documentation and any related computer 00016 * programs, is protected by copyright controlled by Nokia. All 00017 * rights are reserved. Copying, including reproducing, storing, 00018 * adapting or translating, any or all of this material requires the 00019 * prior written consent of Nokia. This material also contains 00020 * confidential information which may not be disclosed to others 00021 * without the prior written consent of Nokia. 00022 * ============================================================================ 00023 * Template version: 4.0 00024 */ 00025 00026 #ifndef OCRSRV_H 00027 #define OCRSRV_H 00028 00029 // INCLUDE FILES 00030 #include <ocrcommon.h> 00031 00032 // Constants 00033 00034 //class declaration 00035 class OCREngineFactory; 00036 00047 class MOCREngineObserver 00048 { 00049 public: 00064 virtual void RecognizeBlockComplete(TInt aError, 00065 const TOCRTextRgnInfo* aBlocks, 00066 const TInt aBlockCount) = 0; 00067 00082 virtual void RecognizeSpecialRegionComplete(TInt aError, 00083 const TOCRTextRgnInfo* aBlocks, 00084 const TInt aBlockCount) = 0; 00085 00100 virtual void RecognizeComplete(TInt aError, 00101 const TOCRTextRgnInfo* aBlocks, 00102 const TInt aBlockCount) = 0; 00103 00118 virtual void LayoutComplete(TInt aError, 00119 const TOCRBlockInfo* aBlocks, 00120 const TInt aBlockCount) = 0; 00121 00129 virtual void RecognizeProcess(const TUint aPercent) = 0; 00130 }; 00131 00132 00142 class MOCREngineBase 00143 { 00144 public: 00145 00152 virtual TVersion GetVersion() const = 0; 00153 00164 virtual void RefreshInstalledLanguageL() = 0; 00165 00179 virtual void SetActiveLanguageL(const RArray<TLanguage>& aActiveLanguage) = 0; 00180 00188 virtual void GetInstalledLanguage(RArray<TLanguage>& aLanguages) const = 0; 00189 00201 virtual void CancelOperation() = 0; 00202 00210 virtual TBool IsLanguageSupported(const TLanguage aLanguage) = 0; 00211 00224 virtual TBool IsEngineActive() const = 0; 00225 }; 00226 00227 00237 class MOCREngineInterface 00238 { 00239 public: 00240 00248 virtual MOCREngineBase* Base() const = 0; 00249 00253 virtual ~MOCREngineInterface() { }; 00254 }; 00255 00256 00282 class MOCREngineLayoutRecognize : public MOCREngineInterface 00283 { 00284 public: 00285 00300 virtual void LayoutAnalysisL(const TInt aBitmapHandle, 00301 const TOCRLayoutSetting aSettings) = 0; 00302 00317 virtual void RecognizeL(const TOCRRecognizeSetting aSettings, 00318 const RArray<TInt>& aBlockIdsToRecognize) = 0; 00319 }; 00320 00338 class MOCREngineRecognizeBlock : public MOCREngineInterface 00339 { 00340 public: 00341 00359 virtual void RecognizeBlockL(const TInt aBitmapHandle, 00360 const TOCRLayoutBlockInfo aLayoutInfo) = 0; 00361 00381 virtual void RecognizeSpecialRegionL(const TInt aBitmapHandle, 00382 const TRegionInfo aRegionInfo) = 0; 00383 }; 00384 00411 class OCREngineFactory 00412 { 00413 public: 00417 enum TEngineType 00418 { 00424 EEngineLayoutRecognize, 00425 00431 EEngineRecognizeBlock 00432 00433 }; 00434 00435 public: 00436 00449 IMPORT_C static MOCREngineInterface* CreateOCREngineL(MOCREngineObserver& aObserver, 00450 const TOcrEngineEnv aEngineEnv, 00451 TEngineType aEngineType); 00452 00460 IMPORT_C static void ReleaseOCREngine(MOCREngineInterface* aEng); 00461 00462 private: 00463 00467 OCREngineFactory(); 00468 }; 00469 00470 // OCRSRV_H 00471 #endif 00472 00473 // End of file