Link to: source code | other
interface directory
Copyright Turtle Creek Software 1996-2006. All Rights Reserved.
This class manages info about the basic hardware environment in the
Goldenseal small business estimating software,
project management software, construction
estimating software
and construction software.
class CTCS_Environment : public UEnvironment
{
public:
#define DrawInColor() (CTCS_Environment::ScreenDepth() > 1)
static void GetSystemInfo();
static SInt32 GetFeatureResult (OSType inSelector);
static Boolean HasMacDragManager() { return sDragManager == eMacDragMgr; }
static Boolean HasIconFamilies() { return sIconType == eMacIconFamilies; }
#if TCS_CANUSE_QUICKTIME
// Not currently needed for MacOS
// It might be useful to store/return the Process Serial Number (PSN) though
#else
// * GetAppInstance() should be used whenever calling a Windows
// API routine which requires a handle to the application instance
// * SetAppInstance() should be called once from WinMain() to set up
// the current application instance handle
static HINSTANCE GetAppInstance() { return sAppInstance; }
static void SetAppInstance (const HINSTANCE theInstance)
{
sAppInstance = theInstance;
}
static ATOM GetErrorWindClassAtom() { return sErrorWindClass; }
static HWND GetErrorWindow() { return sErrorWindow; }
static void ErrorInit();
#endif
static UInt8 GetAbbrevLength() { return sAbbrevLength; } // rev TCS 12/1/02
static SInt16 GetDateOrder() { return sDateOrder; }
static UInt8 GetLongDateFormat() { return sLongDateFormat; }
static SInt16 GetShortDateFormat() { return sShortDateFormat; }
static SInt16 GetTimeCycle() { return sTimeCycle; }
static SInt16 GetTimeFormat() { return sTimeFormat; }
static Boolean UsingMetric() { return sUsingMetric; }
static UInt16 ScreenDepth();
static TCS_Rect ScreenSize();
static CTextString DecimalMark() { return sDecimalMark; }
static CTextString ThousandsSeparator() { return sThousandsSeparator; }
static CTextString ListSeparator() { return sListSeparator; }
static CTextString DateSeparator() { return sDateSeparator; }
static CTextString TimeSeparator() { return sTimeSeparator; }
static CTextString GetCurrencySymbol() { return sCurrencySymbol; }
static CTextString GetMorningString() { return sMorningSuffix; }
static CTextString GetEveningString() { return sEveningSuffix; }
static char DecimalChar() { return sDecimalMark.GetFirstChar(); } // TCS rev 12/19/03
static char ThousandsChar() { return sThousandsSeparator.GetFirstChar(); }
static char CurrencyChar() { return sCurrencySymbol.GetFirstChar(); }
static char PercentChar();
static UInt8 GetCurrencyFormat() { return sCurrencyFormat; }
static Boolean HasLeftCurrencySign();
static Boolean HasRightCurrencySign();
static CTextString GetTimeSuffix();
static CTextString GetMonthName (unsigned char inMonth,
unsigned char inAbbrev = name_Full);
static CTextString GetDayName (unsigned char inDay,
unsigned char inAbbrev = name_Full);
static CTextString GetLongDateSeparator (UInt8 inPosition);
// Number names
static CTextString GetOnesName (const UInt8 index)
{ // v1.1, 10-21-96, 04-02-97
if ((index >= 0) && (index < cNumOnesNames))
return sOnesNumNames [index];
else
return cEmptyString;
}
static CTextString GetTensName (const UInt8 index)
{ // v1.0, 10-21-96
if (index > 1)
return sTensNumNames [index - 1];
else
return cEmptyString;
}
static CTextString GetHundredsName(const UInt8 index)
{ // v1.0, 10-21-96
return &sHundredsNames [index - 1];
}
static CTextString GetThousandsName(const UInt8 index)
{ // TCS 8/1/02
return &sThousandsNames [index - 1];
}
static CTextString GetLargeNumName (const UInt8 index)
{ // v1.0, 10-21-96
return sLargeNumNames [index];
}
// Currency names
static CTextString GetCurrencyName (const Boolean plural = cSingular)
{ // v1.0, 10-22-96
return sCurrencyNames[plural ? 1 : 0];
}
static CTextString GetAndWordName()
{ // v1.0, 10-22-96
return sCurrencyNames[2];
}
static CTextString GetCentName (const Boolean plural = cSingular)
{ // v1.0, 10-22-96
return sCurrencyNames[plural ? 4 : 3];
}
static CTextString GetExactCurrencyName()
{ // v1.0, 10-22-96
return sCurrencyNames [5];
}
static CTextString GetLeftNegative()
{ // TCS 10/16/02
return sCurrencyNames [6];
}
static CTextString GetRightNegative()
{ // TCS 10/16/02
return sCurrencyNames [7];
}
static CTextString GetPercentSign()
{ // TCS 10/16/02
return sCurrencyNames [8];
}
static CTextString GetFractionDivider()
{ // TCS 10/16/02
return sCurrencyNames [9];
}
static CTextString GetTensOnesSpacer()
{ // TCS 8/1/02
return sCurrencyNames [10];
}
protected:
static UInt8 sIconType,
sDragManager,
sAbbrevLength,
sLongDateFormat,
sCurrencyFormat;
static SInt16 sDateOrder;
static SInt16 sShortDateFormat;
static SInt16 sTimeCycle;
static SInt16 sTimeFormat;
static Boolean sUsingMetric;
static CTextString sDecimalMark,
sThousandsSeparator,
sListSeparator,
sDateSeparator,
sTimeSeparator,
sMorningSuffix,
sEveningSuffix,
sTime24Suffix,
sCurrencySymbol,
sMonthNames [cNumMonths],
sDayNames [cNumDays],
sLongDateSeparators [5],
sOnesNumNames [cNumOnesNames],
sTensNumNames [cNumTensNames],
sHundredsNames [cNumTensNames],
sThousandsNames [cNumTensNames],
sLargeNumNames [5],
sCurrencyNames [cNumCurrencyNames];
#if TCS_CANUSE_QUICKTIME
// sInstance is not currently defined for MacOS
#elif TCS_FOR_WINDOWS
static HINSTANCE sAppInstance;
static ATOM sErrorWindClass;
static HWND sErrorWindow;
#endif
private :
#if TCS_CANUSE_QUICKTIME
static void InitCalendarInfo (const Intl0Rec & inIntlMarks);
#elif TCS_FOR_WINDOWS
static void InitCalendarInfo();
#endif
static void InitNumNames();
static void InitCurrencyNames();
}; |