From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/main-view/DictionaryTabWidget.h | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/main-view/DictionaryTabWidget.h (limited to 'src/main-view/DictionaryTabWidget.h') diff --git a/src/main-view/DictionaryTabWidget.h b/src/main-view/DictionaryTabWidget.h new file mode 100644 index 0000000..b5bd3c7 --- /dev/null +++ b/src/main-view/DictionaryTabWidget.h @@ -0,0 +1,46 @@ +#ifndef DICTIONARYTABWIDGET_H +#define DICTIONARYTABWIDGET_H + +#include +#include + +class MainWindow; +class FilterBar; +class DictTableModel; +class DictTableView; +class Dictionary; + +class DictionaryTabWidget : public QTabWidget +{ + Q_OBJECT +public: + DictionaryTabWidget(MainWindow* aMainWin); + + int addDictTab( DictTableModel* aDictModel ); + void setCurrentIndex( int aTabIx ); + void goToDictionaryRecord( int aDictIx, int aRecordRow ); + void cleanUndoStack(); + void showContinueSearch(); + + const DictTableView* curDictView() const; + QUndoGroup* undoGroup() const { return m_undoGroup; } + bool undoStackIsClean() const; + bool isInEditingState() const { return createdEditorsNum > 0; } + +public slots: + void closeTab( int aIndex = -1 ); + +private slots: + void createEditor(); + void destroyEditor(); + +signals: + void editingStateChanged(); + +private: + MainWindow* m_mainWin; // parent, now own + QUndoGroup* m_undoGroup; + QLabel* m_continueLbl; // Continue search icon + int createdEditorsNum; +}; +#endif // DICTIONARYTABWIDGET_H -- cgit