vmainwindow.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef VMAINWINDOW_H
  2. #define VMAINWINDOW_H
  3. #include <QMainWindow>
  4. class QLabel;
  5. class QComboBox;
  6. class VDirectoryTree;
  7. class QSplitter;
  8. class QListWidget;
  9. class QTabWidget;
  10. class QToolBar;
  11. class VNote;
  12. class VFileList;
  13. class VTabWidget;
  14. class QAction;
  15. class QPushButton;
  16. class VNotebook;
  17. class VMainWindow : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public:
  21. VMainWindow(QWidget *parent = 0);
  22. ~VMainWindow();
  23. private slots:
  24. // Change current notebook index and update the directory tree
  25. void setCurNotebookIndex(int index);
  26. // Create a notebook
  27. void onNewNotebookBtnClicked();
  28. void onDeleteNotebookBtnClicked();
  29. void updateNotebookComboBox(const QVector<VNotebook> &notebooks);
  30. void importNoteFromFile();
  31. signals:
  32. void curNotebookIndexChanged(const QString &path);
  33. private:
  34. void setupUI();
  35. void initActions();
  36. void initToolBar();
  37. void initMenuBar();
  38. bool isConflictWithExistingNotebooks(const QString &name, const QString &path);
  39. QLabel *notebookLabel;
  40. QLabel *directoryLabel;
  41. QComboBox *notebookComboBox;
  42. QPushButton *newNotebookBtn;
  43. QPushButton *deleteNotebookBtn;
  44. QPushButton *notebookInfoBtn;
  45. VDirectoryTree *directoryTree;
  46. VFileList *fileList;
  47. VTabWidget *tabs;
  48. QSplitter *mainSplitter;
  49. VNote *vnote;
  50. // Actions
  51. QAction *editNoteAct;
  52. QAction *saveNoteAct;
  53. QAction *readNoteAct;
  54. QAction *importNoteAct;
  55. };
  56. #endif // VMAINWINDOW_H