FX::QTransString Class Reference

#include <QTrans.h>

List of all members.


Detailed Description

Provides a delayed translation string.

QTrans::tr() returns one of these which basically accumulates argument inserts via arg() and then when asked to cast to FXString, actually performs the translation based upon any parameter specialisations defined for the current locale in the translation file.

QTransString also can convert to arbitrary language ids, but this functionality is protected as QTransString has an implicit conversion to FXString. It can even invoke a functor to return what language id to use, a facility used by Tn to return Just-In-Time-Help strings to multiple clients in multiple languages in a thread safe fashion. If you want this extended functionality, subclass QTransString.

Public Member Functions

 QTransString (QTransString &o)
QTransStringoperator= (QTransString &)
QTransStringarg (const FXString &str, FXint fieldwidth=0)
QTransStringarg (char c, FXint fieldwidth=0)
QTransStringarg (FXlong num, FXint fieldwidth=0, FXint base=10)
QTransStringarg (FXulong num, FXint fieldwidth=0, FXint base=10)
QTransStringarg (FXint num, FXint fieldwidth=0, FXint base=10)
QTransStringarg (FXuint num, FXint fieldwidth=0, FXint base=10)
QTransStringarg (double num, FXint fieldwidth=0, FXchar fmt='g', int prec=-1)
 operator FXString ()
const FXchar * text ()
void save (FXStream &s) const
void load (FXStream &s)

Protected Types

typedef Generic::Functor
< Generic::TL::create< const
FXString * >::value > 
GetLangIdSpec

Protected Member Functions

 QTransString (const char *context, const char *text, const char *hint, const FXString *langid=0)
bool empty () const throw ()
QTransString copy () const
GetLangIdSpeclangIdFunc () const throw ()
void setLangIdFunc (GetLangIdSpec *idfunc) throw ()
FXString translate (const FXString *id=0)
void contents (const char *&context, const char *&text, const char *&hint) const

Friends

class QTrans
struct QTransStringPrivate


Member Typedef Documentation

The type of functor called to determine destination translation language.


Member Function Documentation

bool FX::QTransString::empty (  )  const throw () [protected]

Returns true if the string is empty.

QTransString FX::QTransString::copy (  )  const [protected]

Returns a copy of the string.

GetLangIdSpec* FX::QTransString::langIdFunc (  )  const throw () [protected]

Gets the langid functor setting (=0 for none ie; use current user's).

void FX::QTransString::setLangIdFunc ( GetLangIdSpec idfunc  )  throw () [protected]

Sets what to call to determine the destination translation language.

FXString FX::QTransString::translate ( const FXString id = 0  )  [protected]

Returns a translated FXString. Up until this point all operations are merely stored until this moment.

void FX::QTransString::contents ( const char *&  context,
const char *&  text,
const char *&  hint 
) const [protected]

Returns the context, text and hint.

QTransString& FX::QTransString::arg ( const FXString str,
FXint  fieldwidth = 0 
)

Inserts an argument into the lowest numbered x. Specifying a negative number for fieldwidth fills with zeros instead of spaces except for the string insert where negative numbers align to the left rather than right (as Qt does but for all these)

FX::QTransString::operator FXString (  )  [inline]

const FXchar* FX::QTransString::text (  ) 

For FOX use only

void FX::QTransString::save ( FXStream s  )  const

Stores the translatable string's text plus id to identify this translation.

void FX::QTransString::load ( FXStream s  ) 

Loads the translatable string's text plus id to identify this translation.


The documentation for this class was generated from the following file:

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:29:01 2008 for TnFOX by doxygen v1.5.6