00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef OCRSRV_H
00027 #define OCRSRV_H
00028
00029
00030 #include <ocrcommon.h>
00031
00032
00033
00034
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
00471 #endif
00472
00473