1 /* This file is part of the KDE project 2 Copyright 2005-2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net> 3 2006 Fredrik Edemar <f_edemar@linux.se> 4 2005-2006 Raphael Langerhorst <raphael.langerhorst@kdemail.net> 5 2004 Tomas Mecir <mecirt@gmail.com> 6 2003 Norbert Andres <nandres@web.de> 7 2002 Philipp Mueller <philipp.mueller@gmx.de> 8 2000 David Faure <faure@kde.org> 9 2000 Werner Trobin <trobin@kde.org> 10 2000-2006 Laurent Montel <montel@kde.org> 11 1999, 2000 Torben Weis <weis@kde.org> 12 1999 Stephan Kulow <coolo@kde.org> 13 14 This library is free software; you can redistribute it and/or 15 modify it under the terms of the GNU Library General Public 16 License as published by the Free Software Foundation; either 17 version 2 of the License, or (at your option) any later version. 18 19 This library is distributed in the hope that it will be useful, 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 Library General Public License for more details. 23 24 You should have received a copy of the GNU Library General Public License 25 along with this library; see the file COPYING.LIB. If not, write to 26 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 27 Boston, MA 02110-1301, USA. 28 */ 29 30 #ifndef CALLIGRA_SHEETS_FORMAT 31 #define CALLIGRA_SHEETS_FORMAT 32 33 #include "sheets_odf_export.h" 34 35 namespace Calligra 36 { 37 namespace Sheets 38 { 39 40 /** 41 * \ingroup Style 42 * Collection of string formatting enumeration and functions. 43 */ 44 namespace Format 45 { 46 47 enum Type { 48 Generic = 0, 49 Number = 1, 50 Text = 5, 51 Money = 10, 52 Percentage = 25, 53 Scientific = 30, 54 55 ShortDate = 35, ///< Short (numeric) date format, e.g. 08-04-2007 (locale specific) 56 TextDate = 36, ///< Long (text) date format, e.g. Sunday 08 April 2007 (locale specific) 57 DatesBegin = 200, ///< \internal 58 Date1 = 200, ///< e.g. 18-Feb-99 59 Date2 = 201, ///< e.g. 18-Feb-1999 60 Date3 = 202, ///< e.g. 18-Feb 61 Date4 = 203, ///< e.g. 18-05 62 Date5 = 204, ///< e.g. 18/05/00 63 Date6 = 205, ///< e.g. 18/05/1999 64 Date7 = 206, ///< e.g. Feb-99 65 Date8 = 207, ///< e.g. February-99 66 Date9 = 208, ///< e.g. February-1999 67 Date10 = 209, ///< e.g. F-99 68 Date11 = 210, ///< e.g. 18/Feb 69 Date12 = 211, ///< e.g. 18/02 70 Date13 = 212, ///< e.g. 18/Feb/1999 71 Date14 = 213, ///< e.g. 2000/Feb/18 72 Date15 = 214, ///< e.g. 2000-Feb-18 73 Date16 = 215, ///< e.g. 2000-02-18 74 Date17 = 216, ///< e.g. 2 February 2000 75 Date18 = 217, ///< e.g. 02/18/1999 76 Date19 = 218, ///< e.g. 02/18/99 77 Date20 = 219, ///< e.g. Feb/18/99 78 Date21 = 220, ///< e.g. Feb/18/1999 79 Date22 = 221, ///< e.g. Feb-1999 80 Date23 = 222, ///< e.g. 1999 81 Date24 = 223, ///< e.g. 99 82 Date25 = 224, ///< e.g. 2000/02/18 83 Date26 = 225, ///< e.g. 2000/Feb/18 84 Date27 = 226, ///< e.g. Feb/99, complements Date7 85 Date28 = 227, ///< e.g. Feb/1999, complements Date22 86 Date29 = 228, ///< e.g. February/99, complements Date8 87 Date30 = 229, ///< e.g. February/1999, complements Date9 88 Date31 = 230, ///< e.g. 18-02, complements Date12 89 Date32 = 231, ///< e.g. 02/99 90 Date33 = 232, ///< e.g. 02-99, complements Date32 91 Date34 = 233, ///< e.g. Mon, 2 Feb 99 92 Date35 = 234, ///< e.g. Mon, 2 February 1999 93 DatesEnd = 234, ///< \internal 94 95 DateTime = 40, ///< e.g. 08-04-2007 11:02 (locale specific) 96 97 TimesBegin = 50, ///< \internal 98 Time = 50, ///< Short time format without seconds, e.g. 11:02 (locale specific) 99 SecondeTime = 51, ///< Long time format with seconds, e.g. 11:02:45 (locale specific) 100 Time1 = 52, ///< e.g. 9:01 AM 101 Time2 = 53, ///< e.g. 9:01:05 AM 102 Time3 = 54, ///< e.g. 9 h 01 min 28 s 103 Time4 = 55, ///< e.g. 9:01 104 Time5 = 56, ///< e.g. 9:01:12 105 Time6 = 57, ///< [mm]:ss 106 Time7 = 58, ///< [h]:mm:ss 107 Time8 = 59, ///< [h]:mm 108 TimesEnd = 59, ///< \internal 109 110 FractionsBegin = 70, ///< \internal 111 fraction_half = 70, 112 fraction_quarter = 71, 113 fraction_eighth = 72, 114 fraction_sixteenth = 73, 115 fraction_tenth = 74, 116 fraction_hundredth = 75, 117 fraction_one_digit = 76, 118 fraction_two_digits = 77, 119 fraction_three_digits = 78, 120 FractionsEnd = 78, ///< \internal 121 122 Custom = 300, 123 None = 400 124 }; 125 126 //helper functions for the formatting 127 CALLIGRA_SHEETS_ODF_EXPORT bool isDate(Type type); 128 CALLIGRA_SHEETS_ODF_EXPORT bool isTime(Type type); 129 CALLIGRA_SHEETS_ODF_EXPORT bool isFraction(Type type); 130 CALLIGRA_SHEETS_ODF_EXPORT bool isMoney(Type type); 131 CALLIGRA_SHEETS_ODF_EXPORT bool isNumber(Type type); 132 133 } // namespace Format 134 } // namespace Sheets 135 } // namespace Calligra 136 137 #endif // CALLIGRA_SHEETS_FORMAT 138