File indexing completed on 2024-05-05 16:27:55

0001 // SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <jesper.pedersen@kdab.com>
0002 // SPDX-FileCopyrightText: 2013-2023 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
0003 //
0004 // SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 #ifndef BROWSERPAGE_H
0007 #define BROWSERPAGE_H
0008 #include "Breadcrumb.h"
0009 
0010 #include <DB/Category.h>
0011 #include <DB/search/ImageSearchInfo.h>
0012 
0013 class QModelIndex;
0014 namespace Browser
0015 {
0016 class BrowserWidget;
0017 
0018 enum Viewer { ShowBrowser,
0019               ShowImageViewer,
0020               ShowGeoPositionViewer };
0021 
0022 /**
0023  * \brief Information about a single page in the browser
0024  *
0025  * See \ref Browser for a detailed description of how this fits in with the rest of the classes in this module
0026  *
0027  * This interface represent a single page in the browser (one that you can go
0028  * back/forward to using the back/forward buttons in the toolbar).
0029  */
0030 class BrowserPage : public QObject
0031 {
0032     Q_OBJECT
0033 public:
0034     BrowserPage(const DB::ImageSearchInfo &info, BrowserWidget *browser);
0035     ~BrowserPage() override { }
0036 
0037     /**
0038      * Construct the page. Result of activation may be to call \ref BrowserWidget::addAction.
0039      */
0040     virtual void activate() = 0;
0041     virtual void deactivate();
0042     virtual BrowserPage *activateChild(const QModelIndex &);
0043     virtual Viewer viewer();
0044     virtual DB::Category::ViewType viewType() const;
0045     virtual bool isSearchable() const;
0046     virtual bool isViewChangeable() const;
0047     virtual Breadcrumb breadcrumb() const;
0048     virtual bool showDuringMovement() const;
0049 
0050     DB::ImageSearchInfo searchInfo() const;
0051     BrowserWidget *browser() const;
0052 
0053 private:
0054     DB::ImageSearchInfo m_info;
0055     BrowserWidget *m_browser;
0056 };
0057 
0058 }
0059 
0060 #endif /* BROWSERPAGE_H */
0061 
0062 // vi:expandtab:tabstop=4 shiftwidth=4: