kspread_autofill.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __kspread_autofill_h__
00027 #define __kspread_autofill_h__
00028
00029 class AutoFillDeltaSequence;
00030 class AutoFillSequenceItem;
00031 class AutoFillSequence;
00032
00033 #include <qdatetime.h>
00034 #include <qmemarray.h>
00035 #include <qstring.h>
00036 #include <qptrlist.h>
00037 #include <qstringlist.h>
00038
00039 class KSpreadCell;
00040
00041 class AutoFillSequenceItem
00042 {
00043 public:
00044 enum Type { INTEGER, FLOAT, STRING, DAY, SHORTDAY,
00045 MONTH, SHORTMONTH, FORMULA, OTHER, DATE, TIME };
00046
00047 AutoFillSequenceItem( int _i );
00048 AutoFillSequenceItem( double _d );
00049 AutoFillSequenceItem( const QString &_str );
00050
00051 bool getDelta( AutoFillSequenceItem *_seq, double &delta );
00052
00053 QString getSuccessor( int _no, double _delta );
00054 QString getPredecessor( int _no, double _delta );
00055
00056 Type getType()const { return m_Type; }
00057 int getIValue()const { return m_IValue; }
00058 double getDValue()const { return m_DValue; }
00059 QString getString()const { return m_String; }
00060 int getIOtherEnd()const {return m_OtherEnd; }
00061 int getIOtherBegin()const {return m_OtherBegin; }
00062 static QStringList *other;
00063 static QStringList *month;
00064 static QStringList *day;
00065 static QStringList *shortMonth;
00066 static QStringList *shortDay;
00067 protected:
00068 int m_IValue;
00069 double m_DValue;
00070 int m_OtherBegin;
00071 int m_OtherEnd;
00072
00073 QString m_String;
00074
00075 Type m_Type;
00076 };
00077
00078 class AutoFillSequence
00079 {
00080 public:
00081 AutoFillSequence( KSpreadCell *_obj );
00082
00083 int count()const { return sequence.count(); }
00084
00085 AutoFillSequenceItem* getFirst() { return sequence.first(); }
00086 AutoFillSequenceItem* getNext() { return sequence.next(); }
00087
00088 bool matches( AutoFillSequence* _seq, AutoFillDeltaSequence *_delta );
00089
00090 void fillCell( KSpreadCell *src, KSpreadCell *dest, AutoFillDeltaSequence *delta, int _block, bool down = true );
00091
00092 protected:
00093 QPtrList<AutoFillSequenceItem> sequence;
00094 };
00095
00096 class AutoFillDeltaSequence
00097 {
00098 public:
00099 AutoFillDeltaSequence( AutoFillSequence *_first, AutoFillSequence *_next );
00100 ~AutoFillDeltaSequence();
00101
00102 bool isOk()const { return m_ok; }
00103
00104 bool equals( AutoFillDeltaSequence *_delta );
00105
00106 QMemArray<double>* getSequence() { return m_sequence; }
00107
00108 double getItemDelta( int _pos );
00109
00110 protected:
00111 bool m_ok;
00112 QMemArray<double>* m_sequence;
00113 };
00114
00115 #endif
This file is part of the documentation for kspread Library Version 1.4.2.