Top100
Your Personal Movie List (C++17 CLI + library)
Loading...
Searching...
No Matches
window.h
1// SPDX-License-Identifier: Apache-2.0
2//-------------------------------------------------------------------------------
3// Top100 — Your Personal Movie List
4//
5// File: ui/qt/window.h
6// Purpose: Declaration of the Qt Widgets main window and its components.
7//-------------------------------------------------------------------------------
8#pragma once
9
10#include <QMainWindow>
11#include <QString>
12
13class QListView;
14class QComboBox;
15class QLabel;
16class QTextBrowser;
17class QNetworkAccessManager;
18class QToolBar;
19class QAction;
20class QWidget;
21
22class Top100ListModel;
23class QObject;
24
25class Top100QtWindow : public QMainWindow {
26 Q_OBJECT
27public:
28 explicit Top100QtWindow(QWidget* parent = nullptr);
29
30private:
31 // Layout widgets
32 QWidget* central_ = nullptr;
33 QListView* listView_ = nullptr;
34 Top100ListModel* model_ = nullptr;
35 QComboBox* sortCombo_ = nullptr;
36 QLabel* titleLabel_ = nullptr;
37 QLabel* directorValue_ = nullptr;
38 QLabel* actorsValue_ = nullptr;
39 QLabel* genresValue_ = nullptr;
40 QLabel* runtimeValue_ = nullptr;
41 QLabel* imdbLink_ = nullptr;
42 QLabel* posterLabel_ = nullptr;
43 QWidget* detailsContainer_ = nullptr; // for width-based elide
44 QWidget* posterContainer_ = nullptr; // for poster scaling
45 QTextBrowser* plotView_ = nullptr;
46 QToolBar* toolbar_ = nullptr;
47 QStatusBar* statusBar_ = nullptr;
48 QLabel* statusCountLabel_ = nullptr;
49
50 // Actions
51 QAction* addAct_ = nullptr;
52 QAction* delAct_ = nullptr;
53 QAction* refreshTbAct_ = nullptr;
54 QAction* postBskyAct_ = nullptr;
55 QAction* postMastoAct_ = nullptr;
56 QAction* updateAct_ = nullptr;
57
58 // Helpers
59 QNetworkAccessManager* nam_ = nullptr;
60 QObject* posterResizer_ = nullptr;
61 QObject* detailsResizer_ = nullptr;
62
63 // Construction helpers
64 void buildLayout();
65 void buildMenuBar();
66 void buildToolbar();
67 void connectSignals();
68 void updateStatusMovieCount();
69
70 // Handlers (implemented in handlers.cpp)
71 void onAddMovie();
72 void onDeleteCurrent();
73 void onRefresh();
74 void onPostBlueSky();
75 void onPostMastodon();
76 void onUpdateFromOmdb();
77 void onOpenRankDialog();
78 void onSortChanged();
79 void updateDetails();
80
81 // Poster (implemented in poster.cpp)
82 void fetchPosterByUrl(const QString& url);
83 void fetchPosterViaOmdb(const QString& imdb);
84};
Definition Top100ListModel.h:43
Definition window.h:25