1 // vim: set tabstop=4 shiftwidth=4 expandtab:
2 /*
3 Gwenview: an image viewer
4 Copyright 2008 Aurélien Gâteau <agateau@kde.org>
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, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
19 
20 */
21 #ifndef FULLSCREENCONTENT_H
22 #define FULLSCREENCONTENT_H
23 
24 // Qt
25 #include <QPointer>
26 #include <QWidget>
27 
28 // KF
29 
30 // Local
31 #include "imagemetainfodialog.h"
32 #include "ui_fullscreenconfigwidget.h"
33 #include <lib/document/document.h>
34 
35 class QStringList;
36 
37 class KActionCollection;
38 class QUrl;
39 
40 namespace Gwenview
41 {
42 class FullScreenBar;
43 class FullScreenToolBar;
44 class ShadowFilter;
45 class SlideShow;
46 class GvCore;
47 class ThumbnailBarView;
48 
49 class FullScreenConfigWidget : public QWidget, public Ui_FullScreenConfigWidget
50 {
51 public:
52     explicit FullScreenConfigWidget(QWidget *parent = nullptr)
QWidget(parent)53         : QWidget(parent)
54     {
55         setupUi(this);
56     }
57 };
58 
59 /**
60  * The content of the fullscreen bar
61  */
62 class FullScreenContent : public QObject
63 {
64     Q_OBJECT
65 public:
66     FullScreenContent(QObject *parent, GvCore *gvCore);
67 
68     void init(KActionCollection *, QWidget *autoHideParentWidget, SlideShow *);
69 
70     ThumbnailBarView *thumbnailBar() const;
71 
72     void setDistractionFreeMode(bool);
73 
74     void setFullScreenMode(bool);
75 
76 public Q_SLOTS:
77     void setCurrentUrl(const QUrl &);
78 
79 private Q_SLOTS:
80     void updateCurrentUrlWidgets();
81     void updateInformationLabel();
82     void updateMetaInfoDialog();
83     void showImageMetaInfoDialog();
84     void slotImageMetaInfoDialogClosed();
85     void slotPreferredMetaInfoKeyListChanged(const QStringList &list);
86     void showOptionsMenu();
87     void updateSlideShowIntervalLabel();
88     void setFullScreenBarHeight(int value);
89     void slotShowThumbnailsToggled(bool value);
90     void slotViewModeActionToggled(bool value);
91     void adjustSize();
92     void updateDocumentCountLabel();
93 
94 private:
95     KActionCollection *mActionCollection;
96     FullScreenBar *mAutoHideContainer;
97     SlideShow *mSlideShow;
98     QWidget *mContent;
99     FullScreenToolBar *mToolBar;
100     FullScreenToolBar *mRightToolBar;
101     ThumbnailBarView *mThumbnailBar;
102     QLabel *mInformationLabel;
103     QLabel *mDocumentCountLabel;
104     QWidget *mInformationContainer;
105     ShadowFilter *mToolBarShadow;
106     ShadowFilter *mRightToolBarShadow;
107     ShadowFilter *mInformationContainerShadow;
108     Document::Ptr mCurrentDocument;
109     QPointer<ImageMetaInfoDialog> mImageMetaInfoDialog;
110     QPointer<FullScreenConfigWidget> mConfigWidget;
111     QAction *mOptionsAction;
112     GvCore *mGvCore;
113     int mMinimumThumbnailBarHeight;
114 
115     bool mViewPageVisible;
116 
117     void createOptionsAction();
118     void updateContainerAppearance();
119     void updateLayout();
120     void setupThumbnailBarStyleSheet();
121 };
122 
123 } // namespace
124 
125 #endif /* FULLSCREENCONTENT_H */
126