home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WMSGID.HPP < prev    next >
C/C++ Source or Header  |  1996-11-18  |  11KB  |  229 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WMessageID --
  14.  *
  15.  *************************************************************************/
  16.  
  17. #ifndef _WMSGID_HPP_INCLUDED
  18. #define _WMSGID_HPP_INCLUDED
  19.  
  20. #ifndef _WNO_PRAGMA_PUSH
  21. #pragma pack(push,8);
  22. #pragma enum int;
  23. #endif
  24.  
  25. #ifndef _WOBJECT_HPP_INCLUDED
  26. #  include "wobject.hpp"
  27. #endif
  28. #ifndef _WARRAY_HPP_INCLUDED
  29. #  include "warray.hpp"
  30. #endif
  31.  
  32. #define WMakeLangID(p, s)       ((((WUShort  )(s)) << 10) | (WUShort  )(p))
  33. #define WPrimaryLangID(lgid)    ((WUShort)(lgid) & 0x3ff)
  34. #define WSubLangID(lgid)        ((WUShort)(lgid) >> 10)
  35.  
  36. // when passign a parameter for the Language ID you must use WMakeLangID
  37. // using a primary language and a sublanguage
  38. // primary languages
  39.  
  40. #define WLANG_NEUTRAL                     0x00
  41.  
  42. #define WLANG_ARABIC                      0x01
  43. #define WLANG_AFRIKAANS                   0x36
  44. #define WLANG_ALBANIAN                    0x1c
  45. #define WLANG_BASQUE                      0x2d
  46. #define WLANG_BULGARIAN                   0x02
  47. #define WLANG_BYELORUSSIAN                0x23
  48. #define WLANG_CATALAN                     0x03
  49. #define WLANG_CHINESE                     0x04
  50. #define WLANG_CROATIAN                    0x1a
  51. #define WLANG_CZECH                       0x05
  52. #define WLANG_DANISH                      0x06
  53. #define WLANG_DUTCH                       0x13
  54. #define WLANG_ENGLISH                     0x09
  55. #define WLANG_ESTONIAN                    0x25
  56. #define WLANG_FAEROESE                    0x38
  57. #define WLANG_FARSI                       0x29
  58. #define WLANG_FINNISH                     0x0b
  59. #define WLANG_FRENCH                      0x0c
  60. #define WLANG_GERMAN                      0x07
  61. #define WLANG_GREEK                       0x08
  62. #define WLANG_HEBREW                      0x0D
  63. #define WLANG_HUNGARIAN                   0x0e
  64. #define WLANG_ICELANDIC                   0x0f
  65. #define WLANG_INDONESIAN                  0x21
  66. #define WLANG_ITALIAN                     0x10
  67. #define WLANG_JAPANESE                    0x11
  68. #define WLANG_KOREAN                      0x12
  69. #define WLANG_LATVIAN                     0x26
  70. #define WLANG_LITHUANIAN                  0x27
  71. #define WLANG_NORWEGIAN                   0x14
  72. #define WLANG_POLISH                      0x15
  73. #define WLANG_PORTUGUESE                  0x16
  74. #define WLANG_ROMANIAN                    0x18
  75. #define WLANG_RUSSIAN                     0x19
  76. #define WLANG_SLOVAK                      0x1b
  77. #define WLANG_SLOVENIAN                   0x24
  78. #define WLANG_SORBIAN                     0x2e
  79. #define WLANG_SPANISH                     0x0a
  80. #define WLANG_SWEDISH                     0x1d
  81. #define WLANG_THAI                        0x1e
  82. #define WLANG_TURKISH                     0x1f
  83. #define WLANG_UKRAINIAN                   0x22
  84.  
  85. // sublanguage IDs
  86.  
  87. #define WSUBLANG_NEUTRAL                  0x00    /* language neutral */
  88. #define WSUBLANG_DEFAULT                  0x01    /* user default */
  89. #define WSUBLANG_SYS_DEFAULT              0x02    /* system default */
  90.  
  91. #define WSUBLANG_ARABIC                   0x01    /* Arabic (Saudi Arabia) */
  92. #define WSUBLANG_ARABIC_IRAQ              0x02    /* Arabic (Iraq) */
  93. #define WSUBLANG_ARABIC_EGYPT             0x03    /* Arabic (Egypt) */
  94. #define WSUBLANG_ARABIC_LIBYA             0x04    /* Arabic (Libya) */
  95. #define WSUBLANG_ARABIC_ALGERIA           0x05    /* Arabic (Algeria) */
  96. #define WSUBLANG_ARABIC_MOROCCO           0x06    /* Arabic (Morocco) */
  97. #define WSUBLANG_ARABIC_TUNISIA           0x07    /* Arabic (Tunisia) */
  98. #define WSUBLANG_ARABIC_OMAN              0x08    /* Arabic (Oman) */
  99. #define WSUBLANG_ARABIC_YEMEN             0x09    /* Arabic (Yemen) */
  100. #define WSUBLANG_ARABIC_SYRIA             0x10    /* Arabic (Syria) */
  101. #define WSUBLANG_ARABIC_JORDAN            0x11    /* Arabic (Jordan) */
  102. #define WSUBLANG_ARABIC_LEBANON           0x12    /* Arabic (Lebanon) */
  103. #define WSUBLANG_ARABIC_KUWAIT            0x13    /* Arabic (Kuwait) */
  104. #define WSUBLANG_ARABIC_UAE               0x14    /* Arabic (United Arab Emirates) */
  105. #define WSUBLANG_ARABIC_BAHRAIN           0x15    /* Arabic (Bahrain) */
  106. #define WSUBLANG_ARABIC_QATAR             0x16    /* Arabic (Qatar) */
  107. #define WSUBLANG_CHINESE_TRADITIONAL      0x01    /* Chinese (Taiwan) */
  108. #define WSUBLANG_CHINESE_SIMPLIFIED       0x02    /* Chinese (PR China) */
  109. #define WSUBLANG_CHINESE_HONGKONG         0x03    /* Chinese (Hong Kong) */
  110. #define WSUBLANG_CHINESE_SINGAPORE        0x04    /* Chinese (Singapore) */
  111. #define WSUBLANG_DUTCH                    0x01    /* Dutch */
  112. #define WSUBLANG_DUTCH_BELGIAN            0x02    /* Dutch (Belgian) */
  113. #define WSUBLANG_ENGLISH_US               0x01    /* English (USA) */
  114. #define WSUBLANG_ENGLISH_UK               0x02    /* English (UK) */
  115. #define WSUBLANG_ENGLISH_AUS              0x03    /* English (Australian) */
  116. #define WSUBLANG_ENGLISH_CAN              0x04    /* English (Canadian) */
  117. #define WSUBLANG_ENGLISH_NZ               0x05    /* English (New Zealand) */
  118. #define WSUBLANG_ENGLISH_EIRE             0x06    /* English (Irish) */
  119. #define WSUBLANG_ENGLISH_SAFRICA          0x07    /* English (South Africa) */
  120. #define WSUBLANG_ENGLISH_JAMAICA          0x08    /* English (Jamaica) */
  121. #define WSUBLANG_ENGLISH_CARRIBEAN        0x09    /* English (Carribean) */
  122. #define WSUBLANG_FRENCH                   0x01    /* French */
  123. #define WSUBLANG_FRENCH_BELGIAN           0x02    /* French (Belgian) */
  124. #define WSUBLANG_FRENCH_CANADIAN          0x03    /* French (Canadian) */
  125. #define WSUBLANG_FRENCH_SWISS             0x04    /* French (Swiss) */
  126. #define WSUBLANG_FRENCH_LUXEMBOURG        0x05    /* French (Luxembourg) */
  127. #define WSUBLANG_GERMAN                   0x01    /* German */
  128. #define WSUBLANG_GERMAN_SWISS             0x02    /* German (Swiss) */
  129. #define WSUBLANG_GERMAN_AUSTRIAN          0x03    /* German (Austrian) */
  130. #define WSUBLANG_GERMAN_LUXEMBOURG        0x04    /* German (Luxembourg) */
  131. #define WSUBLANG_GERMAN_LIECHTENSTEIN     0x05    /* German (Liechtenstein) */
  132. #define WSUBLANG_ITALIAN                  0x01    /* Italian */
  133. #define WSUBLANG_ITALIAN_SWISS            0x02    /* Italian (Swiss) */
  134. #define WSUBLANG_KOREAN                   0x01    /* Korean */
  135. #define WSUBLANG_KOREAN_JOHAB             0x02    /* Korean (Johab) */
  136. #define WSUBLANG_NORWEGIAN_BOKMAL         0x01    /* Norwegian (Bokmal) */
  137. #define WSUBLANG_NORWEGIAN_NYNORSK        0x02    /* Norwegian (Nynorsk) */
  138. #define WSUBLANG_PORTUGUESE               0x02    /* Portuguese */
  139. #define WSUBLANG_PORTUGUESE_BRAZILIAN     0x01    /* Portuguese (Brazilian) */
  140. #define WSUBLANG_SPANISH                  0x01    /* Spanish (Castilian) */
  141. #define WSUBLANG_SPANISH_MEXICAN          0x02    /* Spanish (Mexican) */
  142. #define WSUBLANG_SPANISH_MODERN           0x03    /* Spanish (Modern) */
  143. #define WSUBLANG_SPANISH_GUATEMALA        0x04    /* Spanish (Guatemala) */
  144. #define WSUBLANG_SPANISH_COSTARICA        0x05    /* Spanish (Costa Rica) */
  145. #define WSUBLANG_SPANISH_PANAMA           0x06    /* Spanish (Panama) */
  146. #define WSUBLANG_SPANISH_DOMINICAN        0x07    /* Spanish (Dominican Republic) */
  147. #define WSUBLANG_SPANISH_VENEZUELA        0x08    /* Spanish (Venezuela) */
  148. #define WSUBLANG_SPANISH_COLOMBIA         0x09    /* Spanish (Colombia) */
  149. #define WSUBLANG_SPANISH_PERU             0x10    /* Spanish (Peru) */
  150. #define WSUBLANG_SPANISH_ARGENTINA        0x11    /* Spanish (Argentina) */
  151. #define WSUBLANG_SPANISH_ECUADOR          0x12    /* Spanish (Ecuador) */
  152. #define WSUBLANG_SPANISH_CHILE            0x13    /* Spanish (Chile) */
  153. #define WSUBLANG_SPANISH_URUGUAY          0x14    /* Spanish (Uruguay) */
  154. #define WSUBLANG_SPANISH_PARAGUAY         0x15    /* Spanish (Paraguay) */
  155. #define WSUBLANG_SPANISH_BOLIVIA          0x16    /* Spanish (Bolivia) */
  156.  
  157. // Default system and user ids for language
  158.  
  159. #define WLANG_SYSTEM_DEFAULT    (WMakeLangID(WLANG_NEUTRAL, WSUBLANG_SYS_DEFAULT))
  160. #define WLANG_USER_DEFAULT      (WMakeLangID(WLANG_NEUTRAL, WSUBLANG_DEFAULT))
  161.  
  162.  
  163.  
  164. class WCMCLASS WMessageID : public WObject {
  165.     WDeclareSubclass( WMessageID, WObject );
  166.  
  167.     public:
  168.  
  169.         /*********************************************************
  170.          * Constructors and destructors
  171.          *********************************************************/
  172.  
  173.         WMessageID( WULong id, WULong langid );
  174.         WMessageID( const WMessageID & id );
  175.  
  176.         ~WMessageID();
  177.  
  178.         /*********************************************************
  179.          * Properties
  180.          *********************************************************/
  181.  
  182.         // ID
  183.  
  184.         WULong GetID() const;
  185.  
  186.         // LangID
  187.  
  188.         WULong GetLangID() const;
  189.  
  190.         /*********************************************************
  191.          * Methods
  192.          *********************************************************/
  193.  
  194.         // Create
  195.  
  196.         WBool Create( WULong number, WULong language );
  197.         WBool Create( const WMessageID & id );
  198.  
  199.         /*********************************************************
  200.          * Operators
  201.          *********************************************************/
  202.  
  203.         WMessageID & operator=( const WMessageID & msgId )
  204.             { Create( msgId ); return *this; }
  205.  
  206.         WMessageID & operator=( const WULong id )
  207.             { Create( id, WLANG_SYSTEM_DEFAULT ); return *this; }
  208.  
  209.  
  210.         /*********************************************************
  211.          * Data members
  212.          *********************************************************/
  213.  
  214.     private:
  215.         WULong  _msgID;
  216.         WULong  _langID;
  217. };
  218.  
  219. extern template WArrayReference<WMessageID>;
  220. extern template WArray<WMessageID>;
  221. typedef WArray<WMessageID>      WMessageIDArray;
  222.  
  223. #ifndef _WNO_PRAGMA_PUSH
  224. #pragma enum pop;
  225. #pragma pack(pop);
  226. #endif
  227.  
  228. #endif // _WRESID_HPP_INCLUDED
  229.