Subversion Repositories Scribus

Rev

Rev 15442 | Rev 21616 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13453 pierre 1
//
2
// C++ Interface: sclocale
3
//
4
// Description: 
5
//
6
//
7
// Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2009
8
//
9
// Copyright: See COPYING file that comes with this distribution
10
//
11
//
12
 
13
#ifndef SCCLOCALE_H
14
#define SCCLOCALE_H
15
 
16
#include <QLocale>
13469 cbradney 17
#include <QString>
13497 jghali 18
 
13589 jghali 19
#include <clocale>
13596 cbradney 20
#if defined(Q_OS_MAC)
21
#include <xlocale.h>
22
#endif
13589 jghali 23
 
18186 craig 24
#if defined(Q_OS_SOLARIS) || defined (Q_OS_OPENBSD) || defined(Q_OS_FREEBSD) || defined(Q_OS_HAIKU)
14566 cbradney 25
#include <locale.h>
26
#endif
27
 
13589 jghali 28
#if defined(Q_WS_WIN)
29
#define XLocaleType _locale_t
30
#else
18186 craig 31
  #if defined (Q_OS_SOLARIS) || defined (Q_OS_OPENBSD) || defined(Q_OS_FREEBSD) || defined(Q_OS_HAIKU)
14671 cbradney 32
  #define XLocaleType char*   //dummy?
14669 cbradney 33
  #else
34
  #define XLocaleType locale_t
35
  #endif
13589 jghali 36
#endif
37
 
13455 jghali 38
#include "scribusapi.h"
13453 pierre 39
 
13497 jghali 40
class SCRIBUS_API ScCLocale
13453 pierre 41
{
42
        ScCLocale();
13589 jghali 43
        ~ScCLocale();
13497 jghali 44
        QLocale qLocale;
13589 jghali 45
        XLocaleType cLocale;
13497 jghali 46
 
13453 pierre 47
        static ScCLocale * m_instance;
48
        static ScCLocale * that();
49
 
50
        public:
51
                static double toDoubleC(const QString& str, bool * ok = 0);
13460 jghali 52
                static double toDoubleC(const QString& str, double defValue);
13469 cbradney 53
                static float toFloatC(const QString& str, bool * ok = 0);
54
                static float toFloatC(const QString& str, float defValue);
15179 jghali 55
                static QString toQStringC(double d, int prec = 3);
13589 jghali 56
                static double strtod ( const char * str, char ** endptr );
13453 pierre 57
 
58
};
59
 
60
#endif // SCCLOCALE_H
61
 
13497 jghali 62
 
13589 jghali 63