File indexing completed on 2025-01-05 03:57:53

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2021-08-27
0007  * Description : a tool bar for Showfoto folder view
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef SHOWFOTO_FOLDER_VIEW_BAR_H
0016 #define SHOWFOTO_FOLDER_VIEW_BAR_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 #include <QList>
0022 #include <QAction>
0023 
0024 // Local includes
0025 
0026 #include "dlayoutbox.h"
0027 #include "dpluginaction.h"
0028 
0029 using namespace Digikam;
0030 
0031 namespace ShowFoto
0032 {
0033 
0034 class ShowfotoFolderViewList;
0035 class ShowfotoFolderViewSideBar;
0036 
0037 class ShowfotoFolderViewBar : public DVBox
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042 
0043     enum FolderViewTypeMime
0044     {
0045         TYPE_MIME_JPEG = 0,
0046         TYPE_MIME_TIFF,
0047         TYPE_MIME_PNG,
0048         TYPE_MIME_PGF,
0049         TYPE_MIME_HEIF,
0050         TYPE_MIME_AVIF,
0051         TYPE_MIME_JXL,
0052         TYPE_MIME_WEBP,
0053         TYPE_MIME_DNG,
0054         TYPE_MIME_RAW,
0055         TYPE_MIME_NORAW,
0056         TYPE_MIME_ALL
0057     };
0058 
0059 public:
0060 
0061     explicit ShowfotoFolderViewBar(ShowfotoFolderViewSideBar* const parent);
0062     ~ShowfotoFolderViewBar()                          override;
0063 
0064     void setIconSize(int size);
0065     int  iconSize()                             const;
0066 
0067     void setFolderViewMode(int mode);
0068     int  folderViewMode()                       const;
0069 
0070     void setFolderViewTypeMime(int mime);
0071     int  folderViewTypeMime()                   const;
0072 
0073     void setBookmarksVisible(bool b);
0074     bool bookmarksVisible()                     const;
0075 
0076     void setCurrentPath(const QString& path);
0077     QString currentPath()                       const;
0078 
0079     QAction* toolBarAction(const QString& name) const;
0080     QList<QAction*> pluginActions()             const;
0081 
0082     void registerPluginActions(const QList<DPluginAction*>& actions);
0083 
0084 public Q_SLOTS:
0085 
0086     void slotPreviousEnabled(bool);
0087     void slotNextEnabled(bool);
0088 
0089 Q_SIGNALS:
0090 
0091     void signalTypeMimesChanged(const QString&);
0092     void signalViewModeChanged(int);
0093     void signalShowBookmarks(bool);
0094     void signalSetup();
0095     void signalIconSizeChanged(int);
0096     void signalGoHome();
0097     void signalGoUp();
0098     void signalGoPrevious();
0099     void signalGoNext();
0100     void signalCustomPathChanged(const QString&);
0101     void signalLoadContents();
0102     void signalAppendContents();
0103     void signalPluginActionTriggered(QAction*);
0104 
0105 private Q_SLOTS:
0106 
0107     void slotCustomPathChanged();
0108     void slotIconSizeChanged(int);
0109     void slotOptionsChanged(QAction*);
0110     void slotTypeMimesChanged(int index);
0111 
0112 private:
0113 
0114     class Private;
0115     Private* const d;
0116 };
0117 
0118 } // namespace ShowFoto
0119 
0120 #endif // SHOWFOTO_FOLDER_VIEW_BAR_H