kspread Library API Documentation

kspread_genvalidationstyle.h

00001 /* This file is part of the KDE project
00002 
00003    Copyright 2004 Laurent Montel <montel@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 
00022 #ifndef KSPREAD_GENVALIDATIONSTYLE
00023 #define KSPREAD_GENVALIDATIONSTYLE
00024 
00025 #include <qdict.h>
00026 #include <qmap.h>
00027 
00028 class KoXmlWriter;
00029 class KSpreadValidity;
00030 class KSpreadGenValidationStyle;
00031 
00032 class KSpreadGenValidationStyles
00033 {
00034 public:
00035     KSpreadGenValidationStyles();
00036     ~KSpreadGenValidationStyles();
00037     QString lookup( const KSpreadGenValidationStyle& style );
00038 
00039     typedef QMap<KSpreadGenValidationStyle, QString> StyleMap;
00040     void writeStyle( KoXmlWriter& writer );
00041 
00042 private:
00043     QString makeUniqueName( const QString& base ) const;
00044 
00046     StyleMap m_styles;
00048     typedef QMap<QString, bool> NameMap;
00049     NameMap m_names;
00050 
00051 };
00052 
00053 class KSpreadGenValidationStyle
00054 {
00055 public:
00056     explicit KSpreadGenValidationStyle(KSpreadValidity *_val=0) { initVal( _val ); }
00057 
00058 
00059     bool operator<( const KSpreadGenValidationStyle &other ) const {
00060         if ( allowEmptyCell != other.allowEmptyCell ) return ( allowEmptyCell < other.allowEmptyCell );
00061         if ( condition != other.condition ) return ( condition < other.condition );
00062         if ( titleInfo != other.titleInfo ) return ( titleInfo < other.titleInfo );
00063         if ( displayValidationInformation != other.displayValidationInformation ) return ( displayValidationInformation < other.displayValidationInformation );
00064         if ( messageInfo != other.messageInfo ) return ( messageInfo < other.messageInfo );
00065         if ( messageType != other.messageType ) return ( messageType < other.messageType );
00066         if ( displayMessage != other.displayMessage ) return ( displayMessage < other.displayMessage );
00067         if ( message != other.message ) return ( message < other.message );
00068         if ( title != other.title ) return ( title < other.title );
00069 
00070         return false;
00071     }
00072 private:
00073     QString createValidationCondition( KSpreadValidity* _val );
00074     QString createTextValidationCondition( KSpreadValidity* _val );
00075     QString createTimeValidationCondition( KSpreadValidity* _val );
00076     QString createDateValidationCondition( KSpreadValidity* _val );
00077     QString createNumberValidationCondition( KSpreadValidity* _val );
00078     QString createListValidationCondition( KSpreadValidity* _val );
00079 
00080     void initVal( KSpreadValidity *_val );
00081 
00082     QString allowEmptyCell;
00083     QString condition;
00084     QString titleInfo;
00085     QString displayValidationInformation;
00086     QString messageInfo;
00087     QString messageType;
00088     QString displayMessage;
00089     QString message;
00090     QString title;
00091     friend class KSpreadGenValidationStyles;
00092 };
00093 
00094 
00095 #endif
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:13 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003