SciDAVis
1.D4
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scidavis
src
future
core
column
columncommands.h
Go to the documentation of this file.
1
/***************************************************************************
2
File : columncommands.h
3
Project : SciDAVis
4
Description : Commands to be called by Column to modify Column::Private
5
--------------------------------------------------------------------
6
Copyright : (C) 2007-2009 Tilman Benkert (thzs*gmx.net)
7
(replace * with @ in the email addresses)
8
9
***************************************************************************/
10
11
/***************************************************************************
12
* *
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
17
* *
18
* This program is distributed in the hope that it will be useful, *
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21
* GNU General Public License for more details. *
22
* *
23
* You should have received a copy of the GNU General Public License *
24
* along with this program; if not, write to the Free Software *
25
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26
* Boston, MA 02110-1301 USA *
27
* *
28
***************************************************************************/
29
30
#ifndef COLUMNCOMMANDS_H
31
#define COLUMNCOMMANDS_H
32
33
#include <QUndoCommand>
34
#include <QStringList>
35
#include "
core/column/Column.h
"
36
#include "
core/AbstractSimpleFilter.h
"
37
#include "
lib/IntervalAttribute.h
"
38
40
// class ColumnSetModeCmd
43
class
ColumnSetModeCmd
:
public
QUndoCommand
44
{
45
public
:
47
ColumnSetModeCmd
(
Column::Private
* col,
SciDAVis::ColumnMode
mode,
48
AbstractFilter
*conversion_filter, QUndoCommand * parent = 0 );
50
~ColumnSetModeCmd
();
51
53
virtual
void
redo
();
55
virtual
void
undo
();
56
57
private
:
59
Column::Private
*
d_col
;
61
SciDAVis::ColumnMode
d_old_mode
;
63
SciDAVis::ColumnMode
d_mode
;
65
SciDAVis::ColumnDataType
d_old_type
;
67
SciDAVis::ColumnDataType
d_new_type
;
69
void
*
d_old_data
;
71
void
*
d_new_data
;
73
AbstractSimpleFilter
*
d_new_in_filter
;
75
AbstractSimpleFilter
*
d_new_out_filter
;
77
AbstractSimpleFilter
*
d_old_in_filter
;
79
AbstractSimpleFilter
*
d_old_out_filter
;
81
IntervalAttribute<bool>
d_old_validity
;
83
IntervalAttribute<bool>
d_new_validity
;
85
bool
d_undone
;
87
bool
d_executed
;
89
AbstractFilter
*
d_conversion_filter
;
90
};
92
// end of class ColumnSetModeCmd
94
95
97
// class ColumnFullCopyCmd
100
class
ColumnFullCopyCmd
:
public
QUndoCommand
101
{
102
public
:
104
ColumnFullCopyCmd
(
Column::Private
* col,
const
AbstractColumn
* src, QUndoCommand * parent = 0 );
106
~ColumnFullCopyCmd
();
107
109
virtual
void
redo
();
111
virtual
void
undo
();
112
113
private
:
115
Column::Private
*
d_col
;
117
const
AbstractColumn
*
d_src
;
119
Column::Private
*
d_backup
;
121
126
Column
*
d_backup_owner
;
127
128
};
130
// end of class ColumnFullCopyCmd
132
134
// class ColumnPartialCopyCmd
137
class
ColumnPartialCopyCmd
:
public
QUndoCommand
138
{
139
public
:
141
ColumnPartialCopyCmd
(
Column::Private
* col,
const
AbstractColumn
* src,
int
src_start,
int
dest_start,
int
num_rows, QUndoCommand * parent = 0 );
143
~ColumnPartialCopyCmd
();
144
146
virtual
void
redo
();
148
virtual
void
undo
();
149
150
private
:
152
Column::Private
*
d_col
;
154
const
AbstractColumn
*
d_src
;
156
Column::Private
*
d_col_backup
;
158
Column::Private
*
d_src_backup
;
160
165
Column
*
d_col_backup_owner
;
167
172
Column
*
d_src_backup_owner
;
174
int
d_src_start
;
176
int
d_dest_start
;
178
int
d_num_rows
;
180
int
d_old_row_count
;
182
IntervalAttribute<bool>
d_old_validity
;
183
184
185
};
187
// end of class ColumnPartialCopyCmd
189
190
192
// class ColumnInsertEmptyRowsCmd
195
class
ColumnInsertEmptyRowsCmd
:
public
QUndoCommand
196
{
197
public
:
199
ColumnInsertEmptyRowsCmd
(
Column::Private
* col,
int
before,
int
count, QUndoCommand * parent = 0 );
201
~ColumnInsertEmptyRowsCmd
();
202
204
virtual
void
redo
();
206
virtual
void
undo
();
207
208
private
:
210
Column::Private
*
d_col
;
212
int
d_before
;
214
int
d_count
;
215
216
};
218
// end of class ColumnInsertEmptyRowsCmd
220
222
// class ColumnRemoveRowsCmd
225
class
ColumnRemoveRowsCmd
:
public
QUndoCommand
226
{
227
public
:
229
ColumnRemoveRowsCmd
(
Column::Private
* col,
int
first,
int
count, QUndoCommand * parent = 0 );
231
~ColumnRemoveRowsCmd
();
232
234
virtual
void
redo
();
236
virtual
void
undo
();
237
238
private
:
240
Column::Private
*
d_col
;
242
int
d_first
;
244
int
d_count
;
246
int
d_data_row_count
;
248
int
d_old_size
;
250
Column::Private
*
d_backup
;
252
257
Column
*
d_backup_owner
;
259
IntervalAttribute<bool>
d_masking
;
261
IntervalAttribute<QString>
d_formulas
;
262
};
264
// end of class ColumnRemoveRowsCmd
266
268
// class ColumnSetPlotDesignationCmd
271
class
ColumnSetPlotDesignationCmd
:
public
QUndoCommand
272
{
273
public
:
275
ColumnSetPlotDesignationCmd
(
Column::Private
* col,
SciDAVis::PlotDesignation
pd, QUndoCommand * parent = 0 );
277
~ColumnSetPlotDesignationCmd
();
278
280
virtual
void
redo
();
282
virtual
void
undo
();
283
284
private
:
286
Column::Private
*
d_col
;
288
SciDAVis::PlotDesignation
d_new_pd
;
290
SciDAVis::PlotDesignation
d_old_pd
;
291
};
293
// end of class ColumnSetPlotDesignationCmd
295
296
298
// class ColumnClearCmd
301
class
ColumnClearCmd
:
public
QUndoCommand
302
{
303
public
:
305
ColumnClearCmd
(
Column::Private
* col, QUndoCommand * parent = 0 );
307
~ColumnClearCmd
();
308
310
virtual
void
redo
();
312
virtual
void
undo
();
313
314
private
:
316
Column::Private
*
d_col
;
318
SciDAVis::ColumnDataType
d_type
;
320
void
*
d_data
;
322
void
*
d_empty_data
;
324
IntervalAttribute<bool>
d_validity
;
326
bool
d_undone
;
327
328
};
330
// end of class ColumnClearCmd
332
333
335
// class ColumnClearValidityCmd
338
class
ColumnClearValidityCmd
:
public
QUndoCommand
339
{
340
public
:
342
ColumnClearValidityCmd
(
Column::Private
* col, QUndoCommand * parent = 0 );
344
~ColumnClearValidityCmd
();
345
347
virtual
void
redo
();
349
virtual
void
undo
();
350
351
private
:
353
Column::Private
*
d_col
;
355
IntervalAttribute<bool>
d_validity
;
357
bool
d_copied
;
358
359
};
361
// end of class ColumnClearValidityCmd
363
365
// class ColumnClearMasksCmd
368
class
ColumnClearMasksCmd
:
public
QUndoCommand
369
{
370
public
:
372
ColumnClearMasksCmd
(
Column::Private
* col, QUndoCommand * parent = 0 );
374
~ColumnClearMasksCmd
();
375
377
virtual
void
redo
();
379
virtual
void
undo
();
380
381
private
:
383
Column::Private
*
d_col
;
385
IntervalAttribute<bool>
d_masking
;
387
bool
d_copied
;
388
389
};
391
// end of class ColumnClearMasksCmd
393
395
// class ColumnSetInvalidCmd
398
class
ColumnSetInvalidCmd
:
public
QUndoCommand
399
{
400
public
:
402
ColumnSetInvalidCmd
(
Column::Private
* col,
Interval<int>
interval,
bool
invalid, QUndoCommand * parent = 0 );
404
~ColumnSetInvalidCmd
();
405
407
virtual
void
redo
();
409
virtual
void
undo
();
410
411
private
:
413
Column::Private
*
d_col
;
415
Interval<int>
d_interval
;
417
bool
d_invalid
;
419
IntervalAttribute<bool>
d_validity
;
421
bool
d_copied
;
422
423
};
425
// end of class ColumnSetInvalidCmd
427
429
// class ColumnSetMaskedCmd
432
class
ColumnSetMaskedCmd
:
public
QUndoCommand
433
{
434
public
:
436
ColumnSetMaskedCmd
(
Column::Private
* col,
Interval<int>
interval,
bool
masked, QUndoCommand * parent = 0 );
438
~ColumnSetMaskedCmd
();
439
441
virtual
void
redo
();
443
virtual
void
undo
();
444
445
private
:
447
Column::Private
*
d_col
;
449
Interval<int>
d_interval
;
451
bool
d_masked
;
453
IntervalAttribute<bool>
d_masking
;
455
bool
d_copied
;
456
457
};
459
// end of class ColumnSetMaskedCmd
461
463
// class ColumnSetFormulaCmd
466
class
ColumnSetFormulaCmd
:
public
QUndoCommand
467
{
468
public
:
470
ColumnSetFormulaCmd
(
Column::Private
* col,
Interval<int>
interval,
const
QString& formula, QUndoCommand * parent = 0 );
472
~ColumnSetFormulaCmd
();
473
475
virtual
void
redo
();
477
virtual
void
undo
();
478
479
private
:
481
Column::Private
*
d_col
;
483
Interval<int>
d_interval
;
485
QString
d_formula
;
487
IntervalAttribute<QString>
d_formulas
;
489
bool
d_copied
;
490
491
};
493
// end of class ColumnSetFormulaCmd
495
497
// class ColumnClearFormulasCmd
500
class
ColumnClearFormulasCmd
:
public
QUndoCommand
501
{
502
public
:
504
ColumnClearFormulasCmd
(
Column::Private
* col, QUndoCommand * parent = 0 );
506
~ColumnClearFormulasCmd
();
507
509
virtual
void
redo
();
511
virtual
void
undo
();
512
513
private
:
515
Column::Private
*
d_col
;
517
IntervalAttribute<QString>
d_formulas
;
519
bool
d_copied
;
520
521
};
523
// end of class ColumnClearFormulasCmd
525
527
// class ColumnSetTextCmd
530
class
ColumnSetTextCmd
:
public
QUndoCommand
531
{
532
public
:
534
ColumnSetTextCmd
(
Column::Private
* col,
int
row,
const
QString& new_value, QUndoCommand * parent = 0 );
536
~ColumnSetTextCmd
();
537
539
virtual
void
redo
();
541
virtual
void
undo
();
542
543
private
:
545
Column::Private
*
d_col
;
547
int
d_row
;
549
QString
d_new_value
;
551
QString
d_old_value
;
553
int
d_row_count
;
555
IntervalAttribute<bool>
d_validity
;
556
557
};
559
// end of class ColumnSetTextCmd
561
563
// class ColumnSetValueCmd
566
class
ColumnSetValueCmd
:
public
QUndoCommand
567
{
568
public
:
570
ColumnSetValueCmd
(
Column::Private
* col,
int
row,
double
new_value, QUndoCommand * parent = 0 );
572
~ColumnSetValueCmd
();
573
575
virtual
void
redo
();
577
virtual
void
undo
();
578
579
private
:
581
Column::Private
*
d_col
;
583
int
d_row
;
585
double
d_new_value
;
587
double
d_old_value
;
589
int
d_row_count
;
591
IntervalAttribute<bool>
d_validity
;
592
593
};
595
// end of class ColumnSetValueCmd
597
599
// class ColumnSetDateTimeCmd
602
class
ColumnSetDateTimeCmd
:
public
QUndoCommand
603
{
604
public
:
606
ColumnSetDateTimeCmd
(
Column::Private
* col,
int
row,
const
QDateTime& new_value, QUndoCommand * parent = 0 );
608
~ColumnSetDateTimeCmd
();
609
611
virtual
void
redo
();
613
virtual
void
undo
();
614
615
private
:
617
Column::Private
*
d_col
;
619
int
d_row
;
621
QDateTime
d_new_value
;
623
QDateTime
d_old_value
;
625
int
d_row_count
;
627
IntervalAttribute<bool>
d_validity
;
628
629
};
631
// end of class ColumnSetDateTimeCmd
633
635
// class ColumnReplaceTextsCmd
638
class
ColumnReplaceTextsCmd
:
public
QUndoCommand
639
{
640
public
:
642
ColumnReplaceTextsCmd
(
Column::Private
* col,
int
first,
const
QStringList& new_values, QUndoCommand * parent = 0 );
644
~ColumnReplaceTextsCmd
();
645
647
virtual
void
redo
();
649
virtual
void
undo
();
650
651
private
:
653
Column::Private
*
d_col
;
655
int
d_first
;
657
QStringList
d_new_values
;
659
QStringList
d_old_values
;
661
bool
d_copied
;
663
int
d_row_count
;
665
IntervalAttribute<bool>
d_validity
;
666
667
};
669
// end of class ColumnReplaceTextsCmd
671
673
// class ColumnReplaceValuesCmd
676
class
ColumnReplaceValuesCmd
:
public
QUndoCommand
677
{
678
public
:
680
ColumnReplaceValuesCmd
(
Column::Private
* col,
int
first,
const
QVector<qreal>& new_values, QUndoCommand * parent = 0 );
682
~ColumnReplaceValuesCmd
();
683
685
virtual
void
redo
();
687
virtual
void
undo
();
688
689
private
:
691
Column::Private
*
d_col
;
693
int
d_first
;
695
QVector<qreal>
d_new_values
;
697
QVector<qreal>
d_old_values
;
699
bool
d_copied
;
701
int
d_row_count
;
703
IntervalAttribute<bool>
d_validity
;
704
705
};
707
// end of class ColumnReplaceValuesCmd
709
711
// class ColumnReplaceDateTimesCmd
714
class
ColumnReplaceDateTimesCmd
:
public
QUndoCommand
715
{
716
public
:
718
ColumnReplaceDateTimesCmd
(
Column::Private
* col,
int
first,
const
QList<QDateTime>& new_values, QUndoCommand * parent = 0 );
720
~ColumnReplaceDateTimesCmd
();
721
723
virtual
void
redo
();
725
virtual
void
undo
();
726
727
private
:
729
Column::Private
*
d_col
;
731
int
d_first
;
733
QList<QDateTime>
d_new_values
;
735
QList<QDateTime>
d_old_values
;
737
bool
d_copied
;
739
int
d_row_count
;
741
IntervalAttribute<bool>
d_validity
;
742
743
};
745
// end of class ColumnReplaceDateTimesCmd
747
748
749
750
751
#endif
Generated by
1.8.1