File indexing completed on 2024-05-05 04:19:16

0001 // vim: set tabstop=4 shiftwidth=4 expandtab:
0002 /*
0003 Gwenview: an image viewer
0004 Copyright 2008 Aurélien Gâteau <agateau@kde.org>
0005 
0006 This program is free software; you can redistribute it and/or
0007 modify it under the terms of the GNU General Public License
0008 as published by the Free Software Foundation; either version 2
0009 of the License, or (at your option) any later version.
0010 
0011 This program is distributed in the hope that it will be useful,
0012 but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 GNU General Public License for more details.
0015 
0016 You should have received a copy of the GNU General Public License
0017 along with this program; if not, write to the Free Software
0018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
0019 
0020 */
0021 #ifndef FULLSCREENCONTENT_H
0022 #define FULLSCREENCONTENT_H
0023 
0024 // Qt
0025 #include <QPointer>
0026 #include <QStringList>
0027 #include <QWidget>
0028 
0029 // KF
0030 
0031 // Local
0032 #include "imagemetainfodialog.h"
0033 #include "ui_fullscreenconfigwidget.h"
0034 #include <lib/document/document.h>
0035 
0036 class KActionCollection;
0037 class QUrl;
0038 
0039 namespace Gwenview
0040 {
0041 class FullScreenBar;
0042 class FullScreenToolBar;
0043 class ShadowFilter;
0044 class SlideShow;
0045 class GvCore;
0046 class ThumbnailBarView;
0047 
0048 class FullScreenConfigWidget : public QWidget, public Ui_FullScreenConfigWidget
0049 {
0050 public:
0051     explicit FullScreenConfigWidget(QWidget *parent = nullptr)
0052         : QWidget(parent)
0053     {
0054         setupUi(this);
0055     }
0056 };
0057 
0058 /**
0059  * The content of the fullscreen bar
0060  */
0061 class FullScreenContent : public QObject
0062 {
0063     Q_OBJECT
0064 public:
0065     FullScreenContent(QObject *parent, GvCore *gvCore);
0066 
0067     void init(KActionCollection *, QWidget *autoHideParentWidget, SlideShow *);
0068 
0069     ThumbnailBarView *thumbnailBar() const;
0070 
0071     void setDistractionFreeMode(bool);
0072 
0073     void setFullScreenMode(bool);
0074 
0075 public Q_SLOTS:
0076     void setCurrentUrl(const QUrl &);
0077 
0078 private Q_SLOTS:
0079     void updateCurrentUrlWidgets();
0080     void updateInformationLabel();
0081     void updateMetaInfoDialog();
0082     void showImageMetaInfoDialog();
0083     void slotImageMetaInfoDialogClosed();
0084     void slotPreferredMetaInfoKeyListChanged(const QStringList &list);
0085     void showOptionsMenu();
0086     void updateSlideShowIntervalLabel();
0087     void setFullScreenBarHeight(int value);
0088     void slotShowThumbnailsToggled(bool value);
0089     void slotViewModeActionToggled(bool value);
0090     void adjustSize();
0091     void updateDocumentCountLabel();
0092 
0093 private:
0094     KActionCollection *mActionCollection;
0095     FullScreenBar *mAutoHideContainer;
0096     SlideShow *mSlideShow;
0097     QWidget *mContent;
0098     FullScreenToolBar *mToolBar;
0099     FullScreenToolBar *mRightToolBar;
0100     ThumbnailBarView *mThumbnailBar;
0101     QLabel *mInformationLabel;
0102     QLabel *mDocumentCountLabel;
0103     QWidget *mInformationContainer;
0104     ShadowFilter *mToolBarShadow;
0105     ShadowFilter *mRightToolBarShadow;
0106     ShadowFilter *mInformationContainerShadow;
0107     Document::Ptr mCurrentDocument;
0108     QPointer<ImageMetaInfoDialog> mImageMetaInfoDialog;
0109     QPointer<FullScreenConfigWidget> mConfigWidget;
0110     QAction *mOptionsAction;
0111     GvCore *mGvCore;
0112     int mMinimumThumbnailBarHeight;
0113 
0114     bool mViewPageVisible;
0115 
0116     void createOptionsAction();
0117     void updateContainerAppearance();
0118     void updateLayout();
0119     void setupThumbnailBarStyleSheet();
0120 };
0121 
0122 } // namespace
0123 
0124 #endif /* FULLSCREENCONTENT_H */