Eneboo - Documentación para desarrolladores
src/qt/include/private/qlocale_p.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qlocale_p.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Declaration of the QLocalePrivate class
00005 **
00006 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00007 **
00008 ** This file is part of the widgets module of the Qt GUI Toolkit.
00009 **
00010 ** This file may be distributed under the terms of the Q Public License
00011 ** as defined by Trolltech ASA of Norway and appearing in the file
00012 ** LICENSE.QPL included in the packaging of this file.
00013 **
00014 ** This file may be distributed and/or modified under the terms of the
00015 ** GNU General Public License version 2 as published by the Free Software
00016 ** Foundation and appearing in the file LICENSE.GPL included in the
00017 ** packaging of this file.
00018 **
00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00020 ** licenses may use this file in accordance with the Qt Commercial License
00021 ** Agreement provided with the Software.
00022 **
00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00025 **
00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00027 **   information about Qt Commercial License Agreements.
00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00030 **
00031 ** Contact info@trolltech.com if any conditions of this licensing are
00032 ** not clear to you.
00033 **
00034 **********************************************************************/
00035 
00036 #ifndef QLOCALE_P_H
00037 #define QLOCALE_P_H
00038 
00039 //
00040 //  W A R N I N G
00041 //  -------------
00042 //
00043 // This file is not part of the Qt API.  It exists for the convenience
00044 // of internal files.  This header file may change from version to version
00045 // without notice, or even be removed.
00046 //
00047 // We mean it.
00048 //
00049 //
00050 
00051 #include <qstring.h>
00052 
00053 struct QLocalePrivate
00054 {
00055 public:
00056     const QChar &decimal() const { return (QChar&)m_decimal; }
00057     const QChar &group() const { return (QChar&)m_group; }
00058     const QChar &list() const { return (QChar&)m_list; }
00059     const QChar &percent() const { return (QChar&)m_percent; }
00060     const QChar &zero() const { return (QChar&)m_zero; }
00061     QChar plus() const { return QChar('+'); }
00062     const QChar &minus() const { return (QChar&)m_minus; }
00063     const QChar &exponential() const { return (QChar&)m_exponential; }
00064     QString infinity() const;
00065     QString nan() const;
00066 
00067     Q_UINT32 languageId() const { return m_language_id; }
00068     Q_UINT32 countryId() const { return m_country_id; }
00069 
00070     bool isDigit(QChar d) const;
00071 
00072     enum GroupSeparatorMode {
00073         FailOnGroupSeparators,
00074         ParseGroupSeparators
00075     };
00076 
00077     enum DoubleForm {
00078         DFExponent = 0,                 // %e or %E
00079         DFDecimal,                      // %f or %F
00080         DFSignificantDigits,            // %g or %G
00081         _DFMax = DFSignificantDigits
00082     };
00083 
00084     enum Flags {
00085         NoFlags         = 0,
00086         
00087         // These correspond to the options in a printf format string
00088         Alternate           = 0x01,
00089         ZeroPadded          = 0x02,
00090         LeftAdjusted        = 0x04,
00091         BlankBeforePositive = 0x08,
00092         AlwaysShowSign      = 0x10,
00093         ThousandsGroup      = 0x20,
00094         CapitalEorX         = 0x40 // %x, %e, %f, %g vs. %X, %E, %F, %G
00095     };
00096 
00097     QString doubleToString(double d,
00098                            int precision = -1,
00099                            DoubleForm form = DFSignificantDigits,
00100                            int width = -1,
00101                            unsigned flags = NoFlags) const;
00102     QString longLongToString(Q_LLONG l, int precision = -1,
00103                              int base = 10,
00104                              int width = -1,
00105                              unsigned flags = NoFlags) const;
00106     QString unsLongLongToString(Q_ULLONG l, int precision = -1,
00107                                 int base = 10,
00108                                 int width = -1,
00109                                 unsigned flags = NoFlags) const;
00110     double stringToDouble(QString num, bool *ok, GroupSeparatorMode group_sep_mode) const;
00111     Q_LLONG stringToLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const;
00112     Q_ULLONG stringToUnsLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const;
00113     bool removeGroupSeparators(QString &num_str) const;
00114     bool numberToCLocale(QString &locale_num, GroupSeparatorMode group_sep_mode) const;
00115 
00116     Q_UINT32 m_language_id, m_country_id;
00117 
00118     Q_UINT16 m_decimal, m_group, m_list, m_percent,
00119         m_zero, m_minus, m_exponential;
00120 
00121     static const QString m_infinity;
00122     static const QString m_nan;
00123     static const QChar m_plus;
00124 
00125     static const char *systemLocaleName();
00126 };
00127 
00128 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'