1 /***************************************************************************
5 -----------------------------------------------------------------------
7 begin : Tue Jan 4 19:04:53 PST 2005
9 copyright :(C) 2005 Peter Hedlund
11 email : peter@peterandlinda.com
13 -----------------------------------------------------------------------
15 ***************************************************************************/
17 /***************************************************************************
19 * This program is free software; you can redistribute it and/or modify *
20 * it under the terms of the GNU General Public License as published by *
21 * the Free Software Foundation; either version 2 of the License, or *
22 * (at your option) any later version. *
24 ***************************************************************************/
26 #ifndef KVOCTRAINTABLE_H
27 #define KVOCTRAINTABLE_H
32 #include "kvt-core/kvoctraindoc.h"
33 #include "kvt-core/kvoctrainexpr.h"
34 #include "kvoctraintableitem.h"
39 class KVocTrainTable
: public QTable
44 KVocTrainTable( kvoctrainDoc
*_doc
, const LangSet
*ls
, QWidget
*parent
= NULL
, const char *name
= NULL
);
46 int currentItem() { return currentRow(); }
47 void setCurrentItem(int row
);
48 int count() { return numRows(); }
50 void setModified(bool _dirty
= true) { m_doc
->setModified(_dirty
); }
51 QString
getIdent(int i
) const { return m_doc
->getIdent(i
); }
52 QString
getOriginalIdent() const { return m_doc
->getOriginalIdent(); }
53 int findIdent(QString id
) const { return m_doc
->findIdent(id
); }
54 void setCurrentRow(int row
, int col
);
55 void updateContents(int row
= -1, int col
= -1);
56 kvoctrainExpr
*getRow(int row
);
57 void setDoc(kvoctrainDoc
*rows
);
58 void setFont(const QFont
&);
61 void selected(int row
);
62 void rightButtonClicked(int header
, int x
, int y
);
63 void forwardKeyPressEvent(QKeyEvent
*);
64 void forwardKeyReleaseEvent(QKeyEvent
*);
65 void edited(int, int);
68 void sortByColumn_alpha(int index
);
69 void sortByColumn_index(int index
);
70 void slotSelectionChanged();
73 void menuTriggerTimeout();
74 void headerReleaseEvent(int sec
);
75 void headerPressEvent(int sec
);
79 QWidget
* beginEdit(int row
, int col
, bool replace
);
80 void endEdit(int row
, int col
, bool accept
, bool replace
);
81 void paintCell(QPainter
*p
, int row
, int col
, const QRect
&cr
, bool selected
, const QColorGroup
&cg
);
82 void setItem(int row
, int col
, QTableItem
* item
);
83 QTableItem
* item (int row
, int col
) const;
84 void keyPressEvent(QKeyEvent
*e
);
85 void keyReleaseEvent(QKeyEvent
*e
);
86 void contentsMousePressEvent(QMouseEvent
*e
);
87 void contentsMouseDoubleClickEvent(QMouseEvent
*e
);
88 void activateNextCell();
92 void sortByColumn(int, bool);
94 //const GradeCols *gradecols;
95 KVocTrainTableItem
*defaultItem
;
98 QPixmap m_pixInactive
;