ULAPI  8.0
ulnumbertranslator.h
1 
7 #ifndef ULNUMBERTRANSLATOR_H
8 #define ULNUMBERTRANSLATOR_H
9 
10 #include "ulworker.h"
11 #include "ullanguage.h"
12 #include "ulstring.h"
13 
19 {
20  int number;
21  const char *text;
22 };
23 
30 {
31 public:
34  virtual ~ULNumberTranslator();
35 
36  // Factory method.
37  static ULNumberTranslator *createNumberTranslator(const ULLanguage& language);
38 
39  // ULWorker interfaces.
40  virtual bool isServiceAvailable(const ULServiceDescriptor& service) = 0;
41  virtual void getAvailableServices(ULList<ULServiceDescriptor>& services) = 0;
42 
43  // The number translator's core services.
44 
55  virtual ULError translateNumber(const ULString& digits, ULString& result) = 0;
56 
57 protected:
58  static bool getPrimitiveNumberText(int n, const ULPrimitiveNumber *primitives, ULString& text);
59 };
60 
61 // ADDLANGUAGE (This marks places where changes are needed when adding a new language.)
62 #include "ulnumbertranslatorenglish.h"
63 #include "ulnumbertranslatorfrench.h"
64 #include "ulnumbertranslatorspanish.h"
65 #include "ulnumbertranslatorgerman.h"
66 #include "ulnumbertranslatoritalian.h"
67 #include "ulnumbertranslatorportuguese.h"
68 #include "ulnumbertranslatorrussian.h"
69 #include "ulnumbertranslatordutch.h"
70 #include "ulnumbertranslatornorwegian.h"
71 #include "ulnumbertranslatorswedish.h"
72 #include "ulnumbertranslatorpolish.h"
73 #include "ulnumbertranslatorlatin.h"
74 #include "ulnumbertranslatoresperanto.h"
75 #include "ulnumbertranslatorklingon.h"
76 #include "ulnumbertranslatormandarin.h"
77 #include "ulnumbertranslatorhaitian.h"
78 
79 #endif
80