USGS

Isis 3.0 Developer's Reference (API)

Home

TableMainWindow.h

Go to the documentation of this file.
00001 #ifndef TableMainWindow_h
00002 #define TableMainWindow_h
00003 
00004 #include <QMenu>
00005 
00006 #include <QListWidgetItem>
00007 #include <QPointer>
00008 
00009 #include "MainWindow.h"
00010 
00011 
00012 namespace Isis {
00040   class TableMainWindow : public MainWindow {
00041       Q_OBJECT
00042     public:
00043       TableMainWindow(QString title, QWidget *parent = 0);
00044       ~TableMainWindow();
00045 
00046       void clear();
00047 
00053       QTableWidget *table() const {
00054         return p_table;
00055       };
00056 
00057 
00058       QList<QListWidgetItem *> itemList();
00059 
00060 
00067       QListWidget *listWidget() const {
00068         return p_listWidget;
00069       };
00070 
00077       int selectedRows() const {
00078         return  p_selectedRows;
00079       };
00080 
00087       int currentIndex() const {
00088         return  p_currentIndex;
00089       };
00090 
00097       int currentRow() const {
00098         return  p_currentRow;
00099       };
00100 
00101       void addToTable(bool setOn, const QString &heading,
00102                       const QString &menuText = "", int insertAt = -1,
00103                       Qt::Orientation o = Qt::Horizontal, QString toolTip = "");
00104       void deleteColumn(int item);
00105       void setStatusMessage(QString message);
00106       void closeEvent(QCloseEvent *event);
00107       void hideEvent(QHideEvent *event);
00108 
00109     public slots:
00110       void showTable();
00111       void syncColumns();
00112       void syncRows();
00113       void saveAsTable();
00114       void saveTable();
00115       void clearTable();
00116       void deleteRows();
00117       void clearRow(int row);
00118       void setCurrentRow(int row);
00119       void setCurrentIndex(int currentIndex);
00120       void setTrackListItems(bool track = false);
00121       bool trackListItems();
00122       void loadTable();
00123       void writeSettings();
00124 
00125     signals:
00130       void fileLoaded();
00131 
00132     protected:
00133       bool eventFilter(QObject *o, QEvent *e);
00134       void createTable();
00135       void readItemSettings(QString heading, QListWidgetItem *item,
00136                             bool defaultChecked);
00137 
00138     private:
00139       std::string p_appName; 
00140       QWidget *p_parent; 
00141       QString p_title; 
00142       QDockWidget *p_dock; 
00143 
00144       QAction *p_save; 
00145       QFile p_currentFile; 
00146 
00147       QTableWidget *p_table; 
00148       QPointer<QListWidget> p_listWidget; 
00149       int p_selectedRows; 
00150       int p_currentIndex; 
00151       int p_currentRow; 
00152 
00153       int p_visibleColumns; 
00154       QList<int>p_startColumn; 
00155       QList<int>p_endColumn; 
00156       bool p_trackItems; 
00157 
00158   };
00159 };
00160 
00161 #endif