kspread
kspread_condition.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __kspread_condition_h__
00023 #define __kspread_condition_h__
00024
00025 #include <qdom.h>
00026 #include <qvaluelist.h>
00027
00028 #include <koffice_export.h>
00029
00030 #include "kspread_global.h"
00031
00032 class QColor;
00033 class QFont;
00034 class QString;
00035 class KoGenStyle;
00036
00037 namespace KSpread
00038 {
00039 class Cell;
00040 class Style;
00041
00046 class KSPREAD_EXPORT Conditional
00047 {
00048 public:
00049 enum Type { None, Equal, Superior, Inferior, SuperiorEqual,
00050 InferiorEqual, Between, Different, DifferentTo };
00051
00052 double val1;
00053 double val2;
00054 QString * strVal1;
00055 QString * strVal2;
00056 QColor * colorcond;
00057 QFont * fontcond;
00058 QString * styleName;
00059 Style * style;
00060 Type cond;
00061
00062 Conditional();
00063 ~Conditional();
00064 Conditional( const Conditional& );
00065 Conditional& operator=( const Conditional& );
00066 };
00067
00068
00072 class Conditions
00073 {
00074 public:
00075
00080 Conditions( const Cell * ownerCell );
00081 virtual ~Conditions();
00082
00093 bool currentCondition( Conditional & condition );
00094
00098 QValueList<Conditional> conditionList() const;
00099
00103 void setConditionList( const QValueList<Conditional> & list );
00104
00109 QDomElement saveConditions( QDomDocument & doc ) const;
00110
00115 void loadConditions( const QDomElement & element );
00116
00117 void loadOasisConditions( const QDomElement & element );
00118
00119 void saveOasisConditions( KoGenStyle ¤tCellStyle );
00120
00121
00125 Style * matchedStyle() const { return m_matchedStyle; }
00126
00127 void checkMatches();
00128
00129 private:
00130 Conditions() {}
00131
00132 QString saveOasisConditionValue(Conditional &cond);
00133 void loadOasisConditionValue( const QString &styleCondition, Conditional &newCondition );
00134 void loadOasisValidationValue( const QStringList &listVal, Conditional &newCondition );
00135 void loadOasisCondition( QString &valExpression, Conditional &newCondition );
00136
00137
00138 const Cell * m_cell;
00139 QValueList<Conditional> m_condList;
00140 Style * m_matchedStyle;
00141 };
00142
00143 }
00144
00145 #endif
|