digiKam
showfotostackviewfavoriteitemdlg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2021-09-27
7  * Description : Showfoto stack view favorite item edit dialog
8  *
9  * Copyright (C) 2021-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef SHOWFOTO_STACK_VIEW_FAVORITE_ITEM_DLG_H
25 #define SHOWFOTO_STACK_VIEW_FAVORITE_ITEM_DLG_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QDate>
31 #include <QDialog>
32 #include <QList>
33 #include <QUrl>
34 
35 // Local includes
36 
37 #include "digikam_config.h"
38 #include "ditemslist.h"
39 
40 using namespace Digikam;
41 
42 namespace ShowFoto
43 {
44 
45 class ShowfotoStackViewFavoriteList;
46 class ShowfotoStackViewFavoriteItem;
47 
48 class ShowfotoStackViewFavoriteItemDlg : public QDialog
49 {
50  Q_OBJECT
51 
52 public:
53 
55  bool create = false);
57 
58  void setName(const QString& name);
59  QString name() const;
60 
61  void setFavoriteType(int favoriteType);
62  int favoriteType() const;
63 
64  void setDescription(const QString& desc);
65  QString description() const;
66 
67  void setDate(const QDate& name);
68  QDate date() const;
69 
70  void setIcon(const QString& icon);
71  QString icon() const;
72 
73  void setUrls(const QList<QUrl>& urls);
74  QList<QUrl> urls() const;
75 
76  void setCurrentUrl(const QUrl& url);
77  QUrl currentUrl() const;
78 
79  void setIconSize(int size);
80  void setSortOrder(int order);
81  void setSortRole(int role);
82  void setParentItem(ShowfotoStackViewFavoriteItem* const pitem);
83 
84 public:
85 
86  static bool favoriteItemDialog(ShowfotoStackViewFavoriteList* const list,
87  QString& name,
88  int& favoriteType,
89  QString& desc,
90  QDate& date,
91  QString& icon,
92  QList<QUrl>& urls,
93  QUrl& current,
94  int iconSize,
95  int sortOrder,
96  int sortRole,
97  ShowfotoStackViewFavoriteItem* const pitem,
98  bool create = false);
99 
100 private:
101 
102  QList<QDate> getItemDates() const;
103 
104  static bool itemIsLessThanHandler(const QTreeWidgetItem* current,
105  const QTreeWidgetItem& other);
106 
107 private Q_SLOTS:
108 
109  void slotIconChanged();
110  void slotIconResetClicked();
111  void slotModified();
112  void slotUpdateMetadata();
113  void slotTypeActivated();
114  void slotDateLowButtonClicked();
115  void slotDateAverageButtonClicked();
116  void slotDateHighButtonClicked();
117 
118 private:
119 
120  bool canAccept() const;
121 
122 private:
123 
124  class Private;
125  Private* const d;
126 };
127 
128 } // namespace ShowFoto
129 
130 #endif // SHOWFOTO_STACK_VIEW_FAVORITE_ITEM_DLG_H
Definition: showfotostackviewfavoriteitemdlg.h:49
Definition: showfotostackviewfavoriteitem.h:41
Definition: showfotostackviewfavoritelist.h:50
Definition: datefolderview.cpp:43
Definition: showfotofolderviewbar.cpp:52