home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / ScriptTranslationTable.h < prev   
C/C++ Source or Header  |  2000-06-10  |  1KB  |  48 lines

  1. //
  2. //  $Id: ScriptTranslationTable.h,v 1.2 2000/06/10 00:19:54 sergey Exp $
  3. //
  4.  
  5. #ifndef _ScriptTranslationTable_h_
  6. #define _ScriptTranslationTable_h_
  7.  
  8. #include "Util/TemplateTranslator.h"
  9.  
  10. namespace DB
  11. {
  12.     class AddressAppInfo;
  13.     class AdresseRecord;
  14. }
  15. class PrintCardPreferences;
  16.  
  17.  
  18. //
  19. // This translation table will be used to replace placeholders inside
  20. // the script by the values from the concrete Address record.
  21. //
  22. class ScriptTranslationTable: public Util::TemplateTranslator::TranslationTable
  23. {
  24. public:
  25.     ScriptTranslationTable(const DB::AddressAppInfo& addressAppInfo, const DB::AdresseRecord& address, const PrintCardPreferences& preferences);
  26.  
  27. // operations
  28. public:
  29.     // Keywords passed to this method must be within the Address entry names range.
  30.     virtual const char* get(const char* keyword) const;
  31.  
  32. // implermentation
  33. private:
  34.     const char* getPhoneLabel(const char* keyword) const;
  35.     int getPhoneEntryIndex(const char* keyword) const;
  36.  
  37.     const char* getPreference(const char* keyword) const;
  38.  
  39. // data members
  40. private:
  41.     const DB::AddressAppInfo&   _addressAppInfo;
  42.     const DB::AdresseRecord&    _address;
  43.     const PrintCardPreferences& _preferences;
  44.     mutable char                _numBuffer[sizeof(int)*8+1];
  45. };
  46.  
  47. #endif  // _ScriptTranslationTable_h_
  48.