home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
sybase
/
starbuck
/
hpp.z
/
WLOCALE.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
25KB
|
493 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WLocaleID --
*
*************************************************************************/
#ifndef _WLOCALE_HPP_INCLUDED
#define _WLOCALE_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WOBJECT_HPP_INCLUDED
# include "wobject.hpp"
#endif
/*
* Language IDs.
*
* The following two combinations of primary language ID and
* sublanguage ID have special semantics:
*
* Primary Language ID Sublanguage ID Result
* ------------------- --------------- ------------------------
* WPrimLangNeutral WSubLangNeutral Language neutral
* WPrimLangNeutral WSubLangDefault User default language
* WPrimLangNeutral WSubLangSysDefault System default language
*/
/*
* Primary language IDs.
*/
typedef WUShort WLanguageIDType;
enum WPrimaryLanguageID {
WPrimLangNeutral =0x00,
WPrimLangArabic =0x01,
WPrimLangAfrikaans =0x36,
WPrimLangAlbanian =0x1c,
WPrimLangBasque =0x2d,
WPrimLangBulgarian =0x02,
WPrimLangByelorussian =0x23,
WPrimLangCatalan =0x03,
WPrimLangChinese =0x04,
WPrimLangCroatian =0x1a,
WPrimLangCzech =0x05,
WPrimLangDanish =0x06,
WPrimLangDutch =0x13,
WPrimLangEnglish =0x09,
WPrimLangEstonian =0x25,
WPrimLangFaeroese =0x38,
WPrimLangFarsi =0x29,
WPrimLangFinnish =0x0b,
WPrimLangFrench =0x0c,
WPrimLangGerman =0x07,
WPrimLangGreek =0x08,
WPrimLangHebrow =0x0D,
WPrimLangHungarian =0x0e,
WPrimLangIcelandic =0x0f,
WPrimLangIndonesian =0x21,
WPrimLangItalian =0x10,
WPrimLangJapanese =0x11,
WPrimLangKorean =0x12,
WPrimLangLatvian =0x26,
WPrimLangLithuanian =0x27,
WPrimLangNorwegian =0x14,
WPrimLangPolish =0x15,
WPrimLangPortuguese =0x16,
WPrimLangRomanian =0x18,
WPrimLangRussian =0x19,
WPrimLangSlovak =0x1b,
WPrimLangSlovenian =0x24,
WPrimLangSorbian =0x2e,
WPrimLangSpanish =0x0a,
WPrimLangSwedish =0x1d,
WPrimLangThai =0x1e,
WPrimLangTurkish =0x1f,
WPrimLangUkrainian =0x22
};
/*
* Sublanguage IDs.
*
* The name immediately following WSubLang_ dictates which primary
* language ID that sublanguage ID can be combined with to form a
* valid language ID.
*/
enum WSubLanguageID {
WSubLangNeutral = 0x00, /* language neutral */
WSubLangDefault = 0x01, /* user default */
WSubLangSysDefault = 0x02, /* system default */
WSubLangArabic = 0x01, /* Arabic (Saudi Arabia) */
WSubLangArabicIraq = 0x02, /* Arabic (Iraq) */
WSubLangArabicEgypt = 0x03, /* Arabic (Egypt) */
WSubLangArabicLibya = 0x04, /* Arabic (Libya) */
WSubLangArabicAlgeria = 0x05, /* Arabic (Algeria) */
WSubLangArabicMorocco = 0x06, /* Arabic (Morocco) */
WSubLangArabicTunisia = 0x07, /* Arabic (Tunisia) */
WSubLangArabicOman = 0x08, /* Arabic (Oman) */
WSubLangArabicYemen = 0x09, /* Arabic (Yemen) */
WSubLangArabicSyria = 0x10, /* Arabic (Syria) */
WSubLangArabicJordan = 0x11, /* Arabic (Jordan) */
WSubLangArabicLebanon = 0x12, /* Arabic (Lebanon) */
WSubLangArabicKuwait = 0x13, /* Arabic (Kuwait) */
WSubLangArabicUnitedArabEmirates = 0x14, /* Arabic (United Arab Emirates) */
WSubLangArabicBahrain = 0x15, /* Arabic (Bahrain) */
WSubLangArabicQatar = 0x16, /* Arabic (Qatar) */
WSubLangChineseTaiwan = 0x01, /* Chinese (Taiwan) */
WSubLangChineseSimplified = 0x02, /* Chinese (PR China) */
WSubLangChineseHongKong = 0x03, /* Chinese (Hong Kong) */
WSubLangChineseSingapore = 0x04, /* Chinese (Singapore) */
WSubLangDutch = 0x01, /* Dutch */
WSubLangDutchBelgian = 0x02, /* Dutch (Belgian) */
WSubLangEnglishUSA = 0x01, /* English (USA) */
WSubLangEnglishUK = 0x02, /* English (UK) */
WSubLangEnglishAustralian = 0x03, /* English (Australian) */
WSubLangEnglishCanadian = 0x04, /* English (Canadian) */
WSubLangEnglishNewZealand = 0x05, /* English (New Zealand) */
WSubLangEnglishIrish = 0x06, /* English (Irish) */
WSubLangEnglishSouthAfrica = 0x07, /* English (South Africa) */
WSubLangEnglishJamaica = 0x08, /* English (Jamaica) */
WSubLangEnglishCarribean = 0x09, /* English (Carribean) */
WSubLangFrench = 0x01, /* French */
WSubLangFrenchBelgian = 0x02, /* French (Belgian) */
WSubLangFrenchCanadian = 0x03, /* French (Canadian) */
WSubLangFrenchSwiss = 0x04, /* French (Swiss) */
WSubLangFrenchLuxembourg = 0x05, /* French (Luxembourg) */
WSubLangGerman = 0x01, /* German */
WSubLangGermanSwiss = 0x02, /* German (Swiss) */
WSubLangGermanAustrian = 0x03, /* German (Austrian) */
WSubLangGermanLuxembourg = 0x04, /* German (Luxembourg) */
WSubLangGermanLiechtenstein = 0x05, /* German (Liechtenstein) */
WSubLangItalian = 0x01, /* Italian */
WSubLangItalianSwiss = 0x02, /* Italian (Swiss) */
WSubLangKorean = 0x01, /* Korean */
WSubLangKoreanJohab = 0x02, /* Korean (Johab) */
WSubLangNorwegianBokmal = 0x01, /* Norwegian (Bokmal) */
WSubLangNorwegianNynorsk = 0x02, /* Norwegian (Nynorsk) */
WSubLangPortuguese = 0x02, /* Portuguese */
WSubLangPortugueseBrazilian = 0x01, /* Portuguese (Brazilian) */
WSubLangSpanishCastilian = 0x01, /* Spanish (Castilian) */
WSubLangSpanishMexican = 0x02, /* Spanish (Mexican) */
WSubLangSpanishModern = 0x03, /* Spanish (Modern) */
WSubLangSpanishGuatemala = 0x04, /* Spanish (Guatemala) */
WSubLangSpanishCostaRica = 0x05, /* Spanish (Costa Rica) */
WSubLangSpanishPanama = 0x06, /* Spanish (Panama) */
WSubLangSpanishDominicanRepublic = 0x07, /* Spanish (Dominican Republic) */
WSubLangSpanishVenezuela = 0x08, /* Spanish (Venezuela) */
WSubLangSpanishColombia = 0x09, /* Spanish (Colombia) */
WSubLangSpanishPeru = 0x10, /* Spanish (Peru) */
WSubLangSpanishArgentina = 0x11, /* Spanish (Argentina) */
WSubLangSpanishEcuador = 0x12, /* Spanish (Ecuador) */
WSubLangSpanishChile = 0x13, /* Spanish (Chile) */
WSubLangSpanishUruguay = 0x14, /* Spanish (Uruguay) */
WSubLangSpanishParaguay = 0x15, /* Spanish (Paraguay) */
WSubLangSpanishBolivia = 0x16 /* Spanish (Bolivia) */
};
/*
* A language ID is a 16 bit value which is the combination of a
* primary language ID and a secondary language ID. The bits are
* allocated as follows:
*
* +-----------------------+-------------------------+
* | Sublanguage ID | Primary Language ID |
* +-----------------------+-------------------------+
* 15 10 9 0 bit
*
*
*/
enum WLanguageIDPart {
WLanguageIDPrimaryPart,
WLanguageIDSubPart,
WLanguageIDAllParts
};
class WCMCLASS WLanguageID : public WObject {
WDeclareSubclass( WLanguageID, WObject );
public:
/*********************************************************
* Constructors and destructors
*********************************************************/
WLanguageID();
WLanguageID( WUShort langID );
WLanguageID( WPrimaryLanguageID primID, WSubLanguageID subID );
~WLanguageID();
/*********************************************************
* Properties
*********************************************************/
// ID
WUShort GetID( WLanguageIDPart partID=WLanguageIDAllParts ) const;
/*********************************************************
* Methods
*********************************************************/
// Clean
void Clear();
// Create
WBool Create();
WBool Create( WLanguageIDType langID );
WBool Create( WPrimaryLanguageID primID, WSubLanguageID subID );
/*********************************************************
* Data members
*********************************************************/
private:
WUShort _languageID;
};
/*
* A locale ID is a 32 bit value which is the combination of a
* language ID, a sort ID, and a reserved area. The bits are
* allocated as follows:
*
* +-------------+---------+-------------------------+
* | Reserved | Sort ID | Language ID |
* +-------------+---------+-------------------------+
* 31 20 19 16 15 0 bit
*
*
*/
/*
* Sorting IDs.
*
*/
enum WLocaleSortID {
WLocaleSortDefault = 0x0, /* sorting default */
WLocaleSortJapaneseXJIS = 0x0, /* Japanese XJIS order */
WLocaleSortJapaneseUnicode = 0x1, /* Japanese Unicode order */
WLocaleSortChineseBig5 = 0x0, /* Chinese BIG5 order */
WLocaleSortChineseUnicode = 0x1, /* Chinese Unicode order */
WLocaleSortKoreanKSC = 0x0, /* Korean KSC order */
WLocaleSortKoreanUnicode = 0x1 /* Korean Unicode order */
};
#define WNlsValidLocaleMask 0x000fffff
enum WLocaleConst {
WLocaleConstNoUserOverride =0x80000000, /* do not use user overrides */
WLocaleConstUseSystemACP =0x40000000, /* use the system ACP */
WLocaleConstLanguageId =0x00000001, /* language id */
WLocaleConstLocalLangName =0x00000002, /* localized name of language */
WLocaleConstEngLangName =0x00001001, /* English name of language */
WLocaleConstAbbrevLangName =0x00000003, /* abbreviated language name */
WLocaleConstNativeLangName =0x00000004, /* native name of language */
WLocaleConstCountryCode =0x00000005, /* country code */
WLocaleConstLocalCountryName =0x00000006, /* localized name of country */
WLocaleConstEngCountryName =0x00001002, /* English name of country */
WLocaleConstAbbrevCountryName =0x00000007, /* abbreviated country name */
WLocaleConstNativeCountryName =0x00000008, /* native name of country */
WLocaleConstDefaultLangName =0x00000009, /* default language id */
WLocaleConstDefaultCountryCode =0x0000000A, /* default country code */
WLocaleConstDefaultOemCodePage =0x0000000B, /* default oem code page */
WLocaleConstDefaultAnsiCodePage =0x00001004, /* default ansi code page */
WLocaleConstListItemSeparator =0x0000000C, /* list item separator */
WLocaleConstMeasureId =0x0000000D, /* 0 = metric, 1 = US */
WLocaleConstDecimalSeparator =0x0000000E, /* decimal separator */
WLocaleConstThousandSeparator =0x0000000F, /* thousand separator */
WLocaleConstDigitGrouping =0x00000010, /* digit grouping */
WLocaleConstNumberFractionalDigit =0x00000011, /* number of fractional digits */
WLocaleConstLeadingZerosDecimal =0x00000012, /* leading zeros for decimal */
WLocaleConstNegativeNumberMode =0x00001010, /* negative number mode */
WLocaleConstNativeAscii =0x00000013, /* native ascii 0-9 */
WLocaleConstCurrencySymbol =0x00000014, /* local monetary symbol */
WLocaleConstIntMonetarySymbol =0x00000015, /* intl monetary symbol */
WLocaleConstMonetaryDecimalSeparator =0x00000016, /* monetary decimal separator */
WLocaleConstMonetaryThousandSeparator =0x00000017, /* monetary thousand separator */
WLocaleConstMonetaryGrouping =0x00000018, /* monetary grouping */
WLocaleConstNLocalMonetaryDigits =0x00000019, /* # local monetary digits */
WLocaleConstNIntMonetaryDigits =0x0000001A, /* # intl monetary digits */
WLocaleConstPositiveCurrencyMode =0x0000001B, /* positive currency mode */
WLocaleConstNegativeCurrencyMode =0x0000001C, /* negative currency mode */
WLocaleConstDateSeparator =0x0000001D, /* date separator */
WLocaleConstTimeSeparator =0x0000001E, /* time separator */
WLocaleConstShortDateFormatString =0x0000001F, /* short date format string */
WLocaleConstLongDateFormatString =0x00000020, /* long date format string */
WLocaleConstTimeFormatString =0x00001003, /* time format string */
WLocaleConstShortDateFormatOrdering =0x00000021, /* short date format ordering */
WLocaleConstLongDateFormatOrdering =0x00000022, /* long date format ordering */
WLocaleConstTimeFormatSpecifier =0x00000023, /* time format specifier */
WLocaleConstTimeMarkerPosition =0x00001005, /* time marker position */
WLocaleConstCenturyFormatSpec =0x00000024, /* century format specifier (short date) */
WLocaleConstLeadingZerosTimeField =0x00000025, /* leading zeros in time field */
WLocaleConstLeadingZerosDayField =0x00000026, /* leading zeros in day field (short date) */
WLocaleConstLeadingZerosMonthField =0x00000027, /* leading zeros in month field (short date) */
WLocaleConstAmDesignator =0x00000028, /* AM designator */
WLocaleConstPmDesignator =0x00000029, /* PM designator */
WLocaleConstCalendarTypeSpec =0x00001009, /* type of calendar specifier */
WLocaleConstAdditionalCalendarTypeSpec =0x0000100B, /* additional calendar types specifier */
WLocaleConstFirstDayWeekSpec =0x0000100C, /* first day of week specifier */
WLocaleConstFirstWeekYearSpec =0x0000100D, /* first week of year specifier */
WLocaleConstLongMondayName =0x0000002A, /* long name for Monday */
WLocaleConstLongTuesdayName =0x0000002B, /* long name for Tuesday */
WLocaleConstLongWednesdayName =0x0000002C, /* long name for Wednesday */
WLocaleConstLongThursdayName =0x0000002D, /* long name for Thursday */
WLocaleConstLongFridayName =0x0000002E, /* long name for Friday */
WLocaleConstLongSaturdayName =0x0000002F, /* long name for Saturday */
WLocaleConstLongSundayName =0x00000030, /* long name for Sunday */
WLocaleConstAbbrevMondayName =0x00000031, /* abbreviated name for Monday */
WLocaleConstAbbrevTuesdayName =0x00000032, /* abbreviated name for Tuesday */
WLocaleConstAbbrevWednesdayName =0x00000033, /* abbreviated name for Wednesday */
WLocaleConstAbbrevThursdayName =0x00000034, /* abbreviated name for Thursday */
WLocaleConstAbbrevFridayName =0x00000035, /* abbreviated name for Friday */
WLocaleConstAbbrevSaturdayName =0x00000036, /* abbreviated name for Saturday */
WLocaleConstAbbrevSundayName =0x00000037, /* abbreviated name for Sunday */
WLocaleConstLongJanuaryName =0x00000038, /* long name for January */
WLocaleConstLongFebruaryName =0x00000039, /* long name for February */
WLocaleConstLongMarchName =0x0000003A, /* long name for March */
WLocaleConstLongAprilName =0x0000003B, /* long name for April */
WLocaleConstLongMayName =0x0000003C, /* long name for May */
WLocaleConstLongJuneName =0x0000003D, /* long name for June */
WLocaleConstLongJulyName =0x0000003E, /* long name for July */
WLocaleConstLongAugustName =0x0000003F, /* long name for August */
WLocaleConstLongSeptemberName =0x00000040, /* long name for September */
WLocaleConstLongOctoberName =0x00000041, /* long name for October */
WLocaleConstLongNovemberName =0x00000042, /* long name for November */
WLocaleConstLongDecemberName =0x00000043, /* long name for December */
WLocaleConstLong13monthName =0x0000100E, /* long name for 13th month (if exists) */
WLocaleConstAbbrevJanuaryName =0x00000044, /* abbreviated name for January */
WLocaleConstAbbrevFebruaryName =0x00000045, /* abbreviated name for February */
WLocaleConstAbbrevMarchName =0x00000046, /* abbreviated name for March */
WLocaleConstAbbrevAprilName =0x00000047, /* abbreviated name for April */
WLocaleConstAbbrevMayName =0x00000048, /* abbreviated name for May */
WLocaleConstAbbrevJuneName =0x00000049, /* abbreviated name for June */
WLocaleConstAbbrevJulyName =0x0000004A, /* abbreviated name for July */
WLocaleConstAbbrevAugustName =0x0000004B, /* abbreviated name for August */
WLocaleConstAbbrevSeptemberName =0x0000004C, /* abbreviated name for September */
WLocaleConstAbbrevOctoberName =0x0000004D, /* abbreviated name for October */
WLocaleConstAbbrevNovemberName =0x0000004E, /* abbreviated name for November */
WLocaleConstAbbrevDecemberName =0x0000004F, /* abbreviated name for December */
WLocaleConstAbbrev13monthName =0x0000100F, /* abbreviated name for 13th month (if exists) */
WLocaleConstPositiveSign =0x00000050, /* positive sign */
WLocaleConstNegativeSign =0x00000051, /* negative sign */
WLocaleConstPositiveSignPosition =0x00000052, /* positive sign position */
WLocaleConstNegativeSignPosition =0x00000053, /* negative sign position */
WLocaleConstMonSymPrecedesPosAmt =0x00000054, /* mon sym precedes pos amt */
WLocaleConstMonSymSepBySpaceFromPosAmt =0x00000055, /* mon sym sep by space from pos amt */
WLocaleConstMonSymPrecedesNegAmt =0x00000056, /* mon sym precedes neg amt */
WLocaleConstMonSymSepBySpaceFromNegAmt =0x00000057, /* mon sym sep by space from neg amt */
WLocaleConstFontSignature =0x00000058 /* font signature */
};
/*
* Time Flags for GetTimeFormat
*/
enum WTimeFormat {
WTimeFormatNoMinutesOrSeconds =0x00000001, /* do not use minutes or seconds */
WTimeFormatNoSeconds =0x00000002, /* do not use seconds */
WTimeFormatNoTimeMarker =0x00000004, /* do not use time marker */
WTimeFormatForce24hourFormat =0x00000008 /* always use 24 hour format */
};
/*
* Date Flags for GetDateFormat
*/
enum WDateFormat {
WDateFormatShortDatePicture =0x00000001, /* use short date picture */
WDateFormatLongDatePicture =0x00000002, /* use long date picture */
WDateFormatUseAltCalendar =0x00000004 /* use alternate calendar (if any) */
};
typedef WDWord WLocaleIDType;
class WCMCLASS WLocaleID : public WObject {
WDeclareSubclass( WLocaleID, WObject );
public:
/*********************************************************
* Constructors and destructors
*********************************************************/
WLocaleID();
WLocaleID( WDWord locID );
WLocaleID( const WLanguageID & langID,
WLocaleSortID sortID=WLocaleSortDefault );
~WLocaleID();
/*********************************************************
* Properties
*********************************************************/
// ID
WDWord GetID() const;
// Info
WString GetInfo( WLocaleConst locConst ) const;
WBool SetInfo( WLocaleConst locConst, const WString & locInfo ) const;
// LanguageID
WLanguageIDType GetLanguageID() const;
// Time/Date Format
WString GetFormatTime( WTimeFormat tFormat ) const;
WString GetFormatDate( WDateFormat dFormat ) const;
// Thread
WBool SetThread() const;
/*********************************************************
* Methods
*********************************************************/
// Clean
void Clear();
// Create
WBool Create();
WBool Create( WDWord locID );
WBool Create( const WLanguageID & langID,
WLocaleSortID sortID=WLocaleSortDefault );
/*********************************************************
* Data members
*********************************************************/
private:
WDWord _localeID;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WLOCALE_HPP_INCLUDED