File indexing completed on 2025-01-05 03:57:58
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2021-09-27 0007 * Description : Side Bar Widget for the Showfoto stack 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_STACK_VIEW_SIDEBAR_H 0016 #define SHOWFOTO_STACK_VIEW_SIDEBAR_H 0017 0018 // QT includes 0019 0020 #include <QList> 0021 #include <QUrl> 0022 #include <QListView> 0023 #include <QPixmap> 0024 #include <QWidget> 0025 #include <QEvent> 0026 #include <QAction> 0027 #include <QStringList> 0028 #include <QModelIndex> 0029 0030 // Local includes 0031 0032 #include "statesavingobject.h" 0033 #include "showfotoitemsortsettings.h" 0034 #include "dpluginaction.h" 0035 0036 using namespace Digikam; 0037 0038 namespace ShowFoto 0039 { 0040 0041 class ShowfotoThumbnailBar; 0042 class Showfoto; 0043 0044 class ShowfotoStackViewSideBar : public QWidget, 0045 public StateSavingObject 0046 { 0047 Q_OBJECT 0048 0049 public: 0050 0051 explicit ShowfotoStackViewSideBar(Showfoto* const parent); 0052 ~ShowfotoStackViewSideBar() override; 0053 0054 void setThumbbar(ShowfotoThumbnailBar* const thumbbar); 0055 0056 void doLoadState() override; 0057 void doSaveState() override; 0058 const QIcon getIcon(); 0059 const QString getCaption(); 0060 0061 void setSortOrder(int order); 0062 int sortOrder() const; 0063 0064 void setSortRole(int role); 0065 int sortRole() const; 0066 0067 void registerPluginActions(const QList<DPluginAction*>& actions); 0068 QList<QAction*> pluginActions() const; 0069 0070 QList<QUrl> urls() const; 0071 QUrl currentUrl() const; 0072 0073 int iconSize() const; 0074 0075 private Q_SLOTS: 0076 0077 void slotPluginActionTriggered(); 0078 0079 Q_SIGNALS: 0080 0081 void signalShowfotoItemInfoActivated(const ShowfotoItemInfo& info); 0082 void signalLoadContentsFromFiles(const QStringList& files, const QString& current); 0083 void signalAddFavorite(); 0084 void signalClearItemsList(); 0085 void signalRemoveItemInfos(const QList<ShowfotoItemInfo>& infos); 0086 0087 private: 0088 0089 ShowfotoStackViewSideBar(QWidget*); 0090 0091 private: 0092 0093 class Private; 0094 Private* const d; 0095 }; 0096 0097 } // namespace ShowFoto 0098 0099 #endif // SHOWFOTO_STACK_VIEW_SIDEBAR_H