Warning, file /graphics/gwenview/app/viewmainpage.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002 Gwenview: an image viewer
0003 Copyright 2007 Aurélien Gâteau <agateau@kde.org>
0004 
0005 This program is free software; you can redistribute it and/or
0006 modify it under the terms of the GNU General Public License
0007 as published by the Free Software Foundation; either version 2
0008 of the License, or (at your option) any later version.
0009 
0010 This program is distributed in the hope that it will be useful,
0011 but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 GNU General Public License for more details.
0014 
0015 You should have received a copy of the GNU General Public License
0016 along with this program; if not, write to the Free Software
0017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0018 
0019 */
0020 #ifndef VIEWMAINPAGE_H
0021 #define VIEWMAINPAGE_H
0022 
0023 // Local
0024 #include <lib/document/document.h>
0025 
0026 // KF
0027 
0028 // Qt
0029 #include <QToolButton>
0030 #include <QUrl>
0031 #include <QWidget>
0032 
0033 class QGraphicsWidget;
0034 
0035 class KActionCollection;
0036 
0037 namespace Gwenview
0038 {
0039 class AbstractRasterImageViewTool;
0040 class DocumentView;
0041 class GvCore;
0042 class RasterImageView;
0043 class SlideShow;
0044 class ThumbnailBarView;
0045 
0046 struct ViewMainPagePrivate;
0047 
0048 /**
0049  * Holds the active document view and associated widgetry.
0050  */
0051 class ViewMainPage : public QWidget
0052 {
0053     Q_OBJECT
0054 public:
0055     static const int MaxViewCount;
0056 
0057     ViewMainPage(QWidget *parent, SlideShow *, KActionCollection *, GvCore *);
0058     ~ViewMainPage() override;
0059 
0060     ThumbnailBarView *thumbnailBar() const;
0061 
0062     void loadConfig();
0063 
0064     void saveConfig();
0065 
0066     /**
0067      * Reset the view
0068      */
0069     void reset();
0070 
0071     void setFullScreenMode(bool fullScreen);
0072 
0073     int statusBarHeight() const;
0074 
0075     QSize sizeHint() const override;
0076     QSize minimumSizeHint() const override;
0077 
0078     /**
0079      * Returns the url of the current document, or an invalid url if unknown
0080      */
0081     QUrl url() const;
0082 
0083     void openUrl(const QUrl &url);
0084 
0085     /**
0086      * Opens up to MaxViewCount urls, and set currentUrl as the current one
0087      */
0088     void openUrls(const QList<QUrl> &urls, const QUrl &currentUrl);
0089 
0090     void reload();
0091 
0092     Document::Ptr currentDocument() const;
0093 
0094     bool isEmpty() const;
0095 
0096     /**
0097      * Returns the image view, if the current adapter has one.
0098      */
0099     RasterImageView *imageView() const;
0100 
0101     /**
0102      * Returns the document view
0103      */
0104     DocumentView *documentView() const;
0105 
0106     QToolButton *toggleSideBarButton() const;
0107 
0108     void showMessageWidget(QGraphicsWidget *, Qt::Alignment align = Qt::AlignHCenter | Qt::AlignTop);
0109 
0110 Q_SIGNALS:
0111 
0112     /**
0113      * Emitted when the part has finished loading
0114      */
0115     void completed();
0116 
0117     void previousImageRequested();
0118 
0119     void nextImageRequested();
0120 
0121     void openUrlRequested(const QUrl &);
0122 
0123     void openDirUrlRequested(const QUrl &);
0124 
0125     void toggleFullScreenRequested();
0126 
0127     void goToBrowseModeRequested();
0128 
0129     void captionUpdateRequested(const QString &);
0130 
0131 public Q_SLOTS:
0132     void setStatusBarVisible(bool);
0133 
0134 private Q_SLOTS:
0135     void setThumbnailBarVisibility(bool visible);
0136 
0137     void showContextMenu();
0138 
0139     void slotViewFocused(DocumentView *);
0140 
0141     void slotEnterPressed();
0142 
0143     void trashView(DocumentView *);
0144     void deselectView(DocumentView *);
0145 
0146     void slotDirModelItemsAddedOrRemoved();
0147 
0148 protected:
0149     bool eventFilter(QObject *watched, QEvent *event) override;
0150 
0151 private:
0152     friend struct ViewMainPagePrivate;
0153     ViewMainPagePrivate *const d;
0154 
0155     void updateFocus(const AbstractRasterImageViewTool *tool);
0156 };
0157 
0158 } // namespace
0159 
0160 #endif /* VIEWMAINPAGE_H */