~ubuntu-branches/ubuntu/edgy/koffice/edgy-updates

« back to all changes in this revision

Viewing changes to kspread/kspread_autofill.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040509113300-xi5t1z4yxe7n03x7
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
class AutoFillSequenceItem;
25
25
class AutoFillSequence;
26
26
 
27
 
#include <qarray.h>
 
27
#include <qdatetime.h>
 
28
#include <qmemarray.h>
28
29
#include <qstring.h>
29
 
#include <qlist.h>
 
30
#include <qptrlist.h>
30
31
#include <qstringlist.h>
31
32
 
32
33
class KSpreadCell;
34
35
class AutoFillSequenceItem
35
36
{
36
37
public:
37
 
    enum Type { INTEGER, FLOAT, STRING, DAY, MONTH, FORMULAR, OTHER };
 
38
    enum Type { INTEGER, FLOAT, STRING, DAY, SHORTDAY,
 
39
      MONTH, SHORTMONTH, FORMULA, OTHER, DATE, TIME };
38
40
 
39
41
    AutoFillSequenceItem( int _i );
40
42
    AutoFillSequenceItem( double _d );
43
45
    bool getDelta( AutoFillSequenceItem *_seq, double &delta );
44
46
 
45
47
    QString getSuccessor( int _no, double _delta );
 
48
    QString getPredecessor( int _no, double _delta );
46
49
 
47
 
    Type getType() { return type; }
48
 
    int getIValue() { return ivalue; }
49
 
    double getDValue() { return dvalue; }
50
 
    QString getString() { return string; }
51
 
    int getIOtherEnd() {return otherEnd; }
52
 
    int getIOtherBegin() {return otherBegin; }
 
50
    Type getType()const { return m_Type; }
 
51
    int getIValue()const { return m_IValue; }
 
52
    double getDValue()const { return m_DValue; }
 
53
    QString getString()const { return m_String; }
 
54
    int getIOtherEnd()const {return m_OtherEnd; }
 
55
    int getIOtherBegin()const {return m_OtherBegin; }
53
56
    static QStringList *other;
54
 
 
55
 
protected:
56
 
    int ivalue;
57
 
    double dvalue;
58
 
    int otherBegin;
59
 
    int otherEnd;
60
 
 
61
 
    QString string;
62
 
 
63
 
    Type type;
64
 
 
65
57
    static QStringList *month;
66
58
    static QStringList *day;
67
 
    //static QStringList *other;
 
59
    static QStringList *shortMonth;
 
60
    static QStringList *shortDay;
 
61
protected:
 
62
    int    m_IValue;
 
63
    double m_DValue;
 
64
    int    m_OtherBegin;
 
65
    int    m_OtherEnd;
 
66
 
 
67
    QString m_String;
 
68
 
 
69
    Type m_Type;
68
70
};
69
71
 
70
72
class AutoFillSequence
72
74
public:
73
75
    AutoFillSequence( KSpreadCell *_obj );
74
76
 
75
 
    int count() { return sequence.count(); }
 
77
    int count()const { return sequence.count(); }
76
78
 
77
79
    AutoFillSequenceItem* getFirst() { return sequence.first(); }
78
80
    AutoFillSequenceItem* getNext() { return sequence.next(); }
79
81
 
80
82
    bool matches( AutoFillSequence* _seq, AutoFillDeltaSequence *_delta );
81
83
 
82
 
    void fillCell( KSpreadCell *src, KSpreadCell *dest, AutoFillDeltaSequence *delta, int _block );
 
84
    void fillCell( KSpreadCell *src, KSpreadCell *dest, AutoFillDeltaSequence *delta, int _block, bool down = true );
83
85
 
84
86
protected:
85
 
    QList<AutoFillSequenceItem> sequence;
 
87
    QPtrList<AutoFillSequenceItem> sequence;
86
88
};
87
89
 
88
90
class AutoFillDeltaSequence
91
93
    AutoFillDeltaSequence( AutoFillSequence *_first, AutoFillSequence *_next );
92
94
    ~AutoFillDeltaSequence();
93
95
 
94
 
    bool isOk() { return ok; }
 
96
    bool isOk()const { return m_ok; }
95
97
 
96
98
    bool equals( AutoFillDeltaSequence *_delta );
97
99
 
98
 
    QArray<double>* getSequence() { return sequence; }
 
100
    QMemArray<double>* getSequence() { return m_sequence; }
99
101
 
100
102
    double getItemDelta( int _pos );
101
103
 
102
104
protected:
103
 
    bool ok;
104
 
    QArray<double>* sequence;
 
105
    bool m_ok;
 
106
    QMemArray<double>* m_sequence;
105
107
};
106
108
 
107
109
#endif