digiKam
flickrlist.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 : 2009-05-22
7  * Description : Flickr file list view and items.
8  *
9  * Copyright (C) 2009 by Pieter Edelman <pieter dot edelman at gmx dot net>
10  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) 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 DIGIKAM_FLICKR_LIST_H
25 #define DIGIKAM_FLICKR_LIST_H
26 
27 // Qt includes
28 
29 #include <QUrl>
30 #include <QList>
31 #include <QLineEdit>
32 
33 // Local includes
34 
35 #include "ditemslist.h"
36 
37 using namespace Digikam;
38 
40 {
41 
42 class FlickrList : public DItemsList
43 {
44  Q_OBJECT
45 
46 public:
47 
51  enum FieldType
52  {
53  SAFETYLEVEL = DItemsListView::User1,
54  CONTENTTYPE = DItemsListView::User2,
58  FRIENDS = DItemsListView::User6
59  };
60 
65  {
66  SAFE = 1,
67  MODERATE = 2,
68  RESTRICTED = 3,
69  MIXEDLEVELS = -1
70  };
71 
76  {
77  PHOTO = 1,
78  SCREENSHOT = 2,
79  OTHER = 3,
80  MIXEDTYPES = -1
81  };
82 
83 public:
84 
85  explicit FlickrList(QWidget* const parent = nullptr);
86  ~FlickrList() override;
87 
88  void setPublic(Qt::CheckState);
89  void setFamily(Qt::CheckState);
90  void setFriends(Qt::CheckState);
91  void setSafetyLevels(SafetyLevel);
92  void setContentTypes(ContentType);
93 
94 Q_SIGNALS:
95 
102 
105 
106 public Q_SLOTS:
107 
108  void slotAddImages(const QList<QUrl>& list) override;
109 
110 private:
111 
112  void setPermissionState(FieldType, Qt::CheckState);
113  void singlePermissionChanged(QTreeWidgetItem*, int);
114  void singleComboBoxChanged(QTreeWidgetItem*, int);
115 
116 
117 private Q_SLOTS:
118 
119  void slotItemChanged(QTreeWidgetItem*, int);
120  void slotItemClicked(QTreeWidgetItem*, int);
121 
122 private:
123 
124  class Private;
125  Private* const d;
126 };
127 
128 // -------------------------------------------------------------------------
129 
131 {
132 
133 public:
134 
135  explicit FlickrListViewItem(DItemsListView* const view,
136  const QUrl& url,
137  bool, bool, bool,
140  ~FlickrListViewItem() override;
141 
142  void setPublic(bool);
143  void setFamily(bool);
144  void setFriends(bool);
145  void setSafetyLevel(FlickrList::SafetyLevel);
146  void setContentType(FlickrList::ContentType);
147  bool isPublic() const;
148  bool isFamily() const;
149  bool isFriends() const;
150  FlickrList::SafetyLevel safetyLevel() const;
151  FlickrList::ContentType contentType() const;
152 
156  QStringList extraTags() const;
157 
161  void toggled();
162 
163  void updateItemWidgets() override;
164 
165 private:
166 
167  class Private;
168  Private* const d;
169 };
170 
171 } // namespace DigikamGenericFlickrPlugin
172 
173 #endif // DIGIKAM_FLICKR_LIST_H
Definition: flickrlist.h:43
ContentType
Definition: flickrlist.h:76
FieldType
Definition: flickrlist.h:52
void signalSafetyLevelChanged(FlickrList::SafetyLevel)
void signalPermissionChanged(FlickrList::FieldType, Qt::CheckState)
void signalContentTypeChanged(FlickrList::ContentType)
SafetyLevel
Definition: flickrlist.h:65
Definition: ditemslist.h:59
Definition: ditemslist.h:128
@ User6
Definition: ditemslist.h:142
@ User3
Definition: ditemslist.h:139
@ User5
Definition: ditemslist.h:141
@ User1
Definition: ditemslist.h:137
@ User4
Definition: ditemslist.h:140
@ User2
Definition: ditemslist.h:138
Definition: ditemslist.h:196
Definition: flickritem.h:37
Definition: datefolderview.cpp:43
@ TAGS
Definition: filtersidebarwidget.h:50