File indexing completed on 2024-05-12 03:48:30

0001 /*
0002     File                 : WorkbookView.h
0003     Project              : LabPlot
0004     Description          : View class for Workbook
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2015-2020 Alexander Semke <alexander.semke@web.de>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef WORKBOOKVIEW_H
0011 #define WORKBOOKVIEW_H
0012 
0013 #include <QWidget>
0014 
0015 class AbstractAspect;
0016 class Workbook;
0017 class QAction;
0018 class QMenu;
0019 class QTabWidget;
0020 class QToolBar;
0021 
0022 class WorkbookView : public QWidget {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit WorkbookView(Workbook*);
0027     ~WorkbookView() override;
0028 
0029     int currentIndex() const;
0030 
0031 private:
0032     QTabWidget* m_tabWidget;
0033     Workbook* m_workbook;
0034     int lastSelectedIndex{0};
0035     bool m_initializing;
0036 
0037     // actions
0038     QAction* action_add_spreadsheet;
0039     QAction* action_add_matrix;
0040 
0041 private Q_SLOTS:
0042     void createContextMenu(QMenu*) const;
0043     void showTabContextMenu(QPoint);
0044     void addSpreadsheet();
0045     void addMatrix();
0046     void itemSelected(int);
0047     void tabChanged(int);
0048     void tabMoved(int, int);
0049     void handleDescriptionChanged(const AbstractAspect*);
0050     void handleAspectAdded(const AbstractAspect*);
0051     void handleAspectAboutToBeRemoved(const AbstractAspect*);
0052 };
0053 
0054 #endif