digiKam
mediawiki_queryimageinfo.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 : 2011-03-22
7  * Description : a Iface C++ interface
8  *
9  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2011 by Ludovic Delfau <ludovicdelfau 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_MEDIAWIKI_QUERYIMAGEINFO_H
25 #define DIGIKAM_MEDIAWIKI_QUERYIMAGEINFO_H
26 
27 // Qt includes
28 
29 #include <QList>
30 
31 // Local includes
32 
33 #include "mediawiki_imageinfo.h"
34 #include "mediawiki_job.h"
35 
36 namespace MediaWiki
37 {
38 
39 class Iface;
40 class QueryImageinfoPrivate;
41 
47 class QueryImageinfo : public Job
48 {
49  Q_OBJECT
50  Q_DECLARE_PRIVATE(QueryImageinfo)
51 
52 public:
53 
57  enum Property
58  {
59  Timestamp = 0x01,
60  User = 0x02,
61  Comment = 0x04,
62  Url = 0x08,
63  Size = 0x10,
64  Sha1 = 0x20,
65  Mime = 0x40,
66  Metadata = 0x80
67  };
68  Q_DECLARE_FLAGS(Properties, Property)
69 
70 public:
71 
82  explicit QueryImageinfo(Iface& MediaWiki, QObject* const parent = nullptr);
83 
87  ~QueryImageinfo() override;
88 
93  void setTitle(const QString& title);
94 
99  void setProperties(Properties properties);
100 
105  void setLimit(unsigned int limit);
106 
111  void setOnlyOneSignal(bool onlyOneSignal);
112 
117  void setBeginTimestamp(const QDateTime& begin);
118 
123  void setEndTimestamp(const QDateTime& end);
124 
132  void setWidthScale(unsigned int width);
133 
141  void setHeightScale(unsigned int height);
142 
146  void start() override;
147 
148 Q_SIGNALS:
149 
154  void result(const QList<Imageinfo>& imageinfos);
155 
156 private Q_SLOTS:
157 
158  void doWorkSendRequest();
159  void doWorkProcessReply();
160 };
161 
162 Q_DECLARE_OPERATORS_FOR_FLAGS(QueryImageinfo::Properties)
163 
164 } // namespace MediaWiki
165 
166 #endif // DIGIKAM_MEDIAWIKI_QUERYIMAGEINFO_H
Definition: piwigotalker.h:48
@ Comment
Definition: coredbconstants.h:139