MagicSmoke  $VERSION$
misc.h File Reference
#include <QDateTime>
#include <QString>
#include <QStringList>
#include <QRegExp>
#include <MOServerFormat>
#include <DPtrBase>

Go to the source code of this file.

Classes

class  MLocalFormat
 localized formatter class for timestamps, numbers and money; per default it uses the local translation to format data, but can be overidden; More...
 

Macros

#define MSIFACE_EXPORT   Q_DECL_IMPORT
 

Functions

QString MSIFACE_EXPORT cent2str (qint64 cent, bool localize=true)
 converts a cent value into a (localized) string More...
 
QString MSIFACE_EXPORT currentDir ()
 returns the current directory (the one last used in a file dialog) More...
 
QString MSIFACE_EXPORT htmlize (QString str)
 converts special HTML characters into harmless &-codes, so the text can be included More...
 
QRegExp MSIFACE_EXPORT priceRegExp (bool localize=true)
 return a (localized) regular expression that validates prices More...
 
 Q_DECLARE_OPERATORS_FOR_FLAGS (MLocalFormat::MoneyFlags)
 
void MSIFACE_EXPORT setCurrentDir (QString)
 sets a new current directory (transparently handles files and directories) More...
 
qint64 MSIFACE_EXPORT str2cent (QString s, bool fromlocal=true)
 converts a (localized) string back into a cent value (must not contain spaces or extra dots) More...
 
QString MSIFACE_EXPORT unix2date (qint64, bool localize=true)
 converts a unix timestamp into a date More...
 
QString MSIFACE_EXPORT unix2dateTime (qint64, bool localize=true)
 converts a unix timestamp into a date-time-string More...
 
QString MSIFACE_EXPORT unix2time (qint64, bool localize=true)
 converts a unix timestamp into a time (ommitting the date) More...
 
QString MSIFACE_EXPORT xmlize (QString str, QString newline="\n")
 converts special XML characters into harmless &-codes, so the text can be included More...
 
QByteArray MSIFACE_EXPORT xmlize (QByteArray str, QString newline="\n")
 converts special XML characters into harmless &-codes, so the text can be included More...
 

Macro Definition Documentation

#define MSIFACE_EXPORT   Q_DECL_IMPORT

Function Documentation

QString MSIFACE_EXPORT currentDir ( )

returns the current directory (the one last used in a file dialog)

Referenced by MTicketEditor::openFile(), MOdfEditor::openFile(), and printOfficeFile().

QString MSIFACE_EXPORT htmlize ( QString  str)

converts special HTML characters into harmless &-codes, so the text can be included

Referenced by MEventSummary::MEventSummary(), toError(), and MApplication::versionDlg().

QRegExp MSIFACE_EXPORT priceRegExp ( bool  localize = true)

return a (localized) regular expression that validates prices

References MLocalFormat::moneyRegExp(), and MLocalFormat::setNonLocalized().

Q_DECLARE_OPERATORS_FOR_FLAGS ( MLocalFormat::MoneyFlags  )
void MSIFACE_EXPORT setCurrentDir ( QString  )

sets a new current directory (transparently handles files and directories)

Referenced by MTicketEditor::openFile(), MOdfEditor::openFile(), printOfficeFile(), MTicketEditor::saveFileAs(), and MOdfEditor::saveFileAs().

qint64 MSIFACE_EXPORT str2cent ( QString  s,
bool  fromlocal = true 
)

converts a (localized) string back into a cent value (must not contain spaces or extra dots)

References MLocalFormat::scanMoney(), and MLocalFormat::setNonLocalized().

Referenced by fromMoneyFunc(), MTELabel::getVariable(), MElamEngine::MElamEngine(), and MTEExampleDelegate::setEditorData().

QString MSIFACE_EXPORT unix2date ( qint64  ,
bool  localize = true 
)

converts a unix timestamp into a date

References MLocalFormat::formatDate(), and MLocalFormat::setNonLocalized().

Referenced by unix2DTFunc(), and MOVoucher::validDate().

QString MSIFACE_EXPORT unix2dateTime ( qint64  ,
bool  localize = true 
)
QString MSIFACE_EXPORT unix2time ( qint64  ,
bool  localize = true 
)

converts a unix timestamp into a time (ommitting the date)

References MLocalFormat::formatTime(), and MLocalFormat::setNonLocalized().

Referenced by unix2DTFunc().

QString MSIFACE_EXPORT xmlize ( QString  str,
QString  newline = "\n" 
)

converts special XML characters into harmless &-codes, so the text can be included

Referenced by MOdtRenderer::convertV1toV2().

QByteArray MSIFACE_EXPORT xmlize ( QByteArray  str,
QString  newline = "\n" 
)

converts special XML characters into harmless &-codes, so the text can be included