1 /*
2  dashboard_view.h     MindForger thinking notebook
3 
4  Copyright (C) 2016-2020 Martin Dvorak <martin.dvorak@mindforger.com>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef M8RUI_DASHBOARD_VIEW_H
20 #define M8RUI_DASHBOARD_VIEW_H
21 
22 #include <QtWidgets>
23 
24 #include "organizer_quadrant_view.h"
25 #include "recent_notes_table_view.h"
26 #include "navigator/navigator_view.h"
27 #include "tags_table_view.h"
28 #include "outlines_table_view.h"
29 
30 namespace m8r {
31 
32 /**
33  * @brief Dashboard
34  */
35 class DashboardView : public QSplitter
36 {
37     Q_OBJECT
38 
39 private:
40     // if view is width < threshold columns, then shows simplified view w/o Mind-related columns
41     static constexpr int SIMPLIFIED_VIEW_THRESHOLD_WIDTH = 75*2;
42 
43     bool isMindForgerRepository;
44 
45     QSplitter* left;
46     QSplitter* middle;
47     QSplitter* right;
48 
49     QTextBrowser* welcomeDashboardlet;
50     OrganizerQuadrantView* doFirstDashboardlet;
51     OrganizerQuadrantView* doSoonDashboardlet;
52     NavigatorView* navigatorDashboardlet;
53     RecentNotesTableView* recentDashboardlet;
54     TagsTableView* tagsDashboardlet;
55     OutlinesTableView* outlinesDashboardlet;
56 
57 public:
58     explicit DashboardView(QWidget* parent);
59     DashboardView(const DashboardView&) = delete;
60     DashboardView(const DashboardView&&) = delete;
61     DashboardView &operator=(const DashboardView&) = delete;
62     DashboardView &operator=(const DashboardView&&) = delete;
63     ~DashboardView();
64 
65     void setMindForgerMode(bool isMindForgerRepository);
66 
getWelcomeDashboardlet()67     QTextBrowser* getWelcomeDashboardlet() { return welcomeDashboardlet; }
getDoFirstDashboardlet()68     OrganizerQuadrantView* getDoFirstDashboardlet() { return doFirstDashboardlet; }
getOutlinesDashboardlet()69     OutlinesTableView* getOutlinesDashboardlet() { return outlinesDashboardlet; }
getNavigatorDashboardlet()70     NavigatorView* getNavigatorDashboardlet() { return navigatorDashboardlet; }
getRecentDashboardlet()71     RecentNotesTableView* getRecentDashboardlet() { return recentDashboardlet; }
getTagsDashboardlet()72     TagsTableView* getTagsDashboardlet() { return tagsDashboardlet; }
73 
74 protected:
75     void resizeEvent(QResizeEvent* event) override;
76 };
77 
78 }
79 #endif // M8RUI_DASHBOARD_VIEW_H
80