26 #ifndef LOCALIZEDSTRING_H
27 #define LOCALIZEDSTRING_H
32 #ifndef NO_AUTOLOCALIZATION
34 # undef QT_TR_NOOP_UTF8
35 # undef QT_TRANSLATE_NOOP
36 # undef QT_TRANSLATE_NOOP_UTF8
37 # undef QT_TRANSLATE_NOOP3
38 # undef QT_TRANSLATE_NOOP3_UTF8
39 # define QT_TR_NOOP(x) qutim_sdk_0_3::LocalizedString(staticMetaObject.className(), x)
40 # define QT_TR_NOOP_UTF8(x) qutim_sdk_0_3::LocalizedString(staticMetaObject.className(), x)
41 # define QT_TRANSLATE_NOOP(scope, x) qutim_sdk_0_3::LocalizedString(scope, x)
42 # define QT_TRANSLATE_NOOP_UTF8(scope, x) qutim_sdk_0_3::LocalizedString(scope, x)
43 # define QT_TRANSLATE_NOOP3(scope,x,comment) qutim_sdk_0_3::LocalizedString(scope, x)
44 # define QT_TRANSLATE_NOOP3_UTF8(scope,x,comment) qutim_sdk_0_3::LocalizedString(scope, x)
45 #endif // NO_AUTOLOCALIZATION
47 namespace qutim_sdk_0_3
56 LocalizedString(
const char *cxt,
const QByteArray &str) : m_ctx(cxt), m_str(str) {}
57 LocalizedString(
const char *cxt,
const char *str,
int len) : m_ctx(cxt), m_str(str, len) {}
58 LocalizedString(
const char *cxt,
const char *str) : m_ctx(cxt), m_str(str, qstrlen(str)) {}
61 operator QString()
const {
return toString(); }
62 QString toString()
const;
66 QByteArray
context()
const {
return m_ctx; }
67 bool isNull()
const {
return m_str.isNull(); }
70 inline bool operator <(
const LocalizedString &s)
const {
return m_str < s.m_str; }
88 #endif // LOCALIZEDSTRING_H