summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-sheet/sortdlg.h
blob: 2c99f023170601593165576a3afada9e96a6f040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef SORTDLG_H
#define SORTDLG_H

#include <qdialog.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qvbuttongroup.h>
#include "sheet.h"

class SortDialog: public QDialog
{
  Q_OBJECT

  // QT objects
  QBoxLayout *box;
  QTabWidget *tabs;
  QWidget *widgetSort, *widgetOptions;
  QVButtonGroup *groupOrderA, *groupOrderB, *groupOrderC, *groupDirection;
  QCheckBox *checkCase;
  QComboBox *comboFieldA, *comboFieldB, *comboFieldC;

  // Other objects & variables
  int row1, col1, row2, col2, direction;
  Sheet *sheet;

  // Private functions
  QVButtonGroup *createOrderButtons(int y);
  QComboBox *createFieldCombo(const QString &caption, int y);
  void fillFieldCombo(QComboBox *combo);
  int compareItems(QTableItem *item1, QTableItem *item2, int descending=0, bool caseSensitive=TRUE);

  private slots:
    void directionChanged(int id);

  public:
    SortDialog(QWidget *parent=0);
    ~SortDialog();

    int exec(Sheet *s);
};

#endif