digiKam
yfphoto.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 : 2010-11-18
7  * Description : a tool to export items to YandexFotki web service
8  *
9  * Copyright (C) 2010 by Roman Tsisyk <roman at tsisyk dot com>
10  * Copyright (C) 2010-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_YF_PHOTO_H
25 #define DIGIKAM_YF_PHOTO_H
26 
27 // Qt includes
28 
29 #include <QDebug>
30 #include <QString>
31 #include <QDateTime>
32 #include <QStringList>
33 
34 namespace DigikamGenericYFPlugin
35 {
36 
37 class YFPhoto
38 {
39 public:
40 
41  enum Access
42  {
46  };
47 
48 public:
49 
50  explicit YFPhoto();
51  ~YFPhoto() = default;
52 
53  YFPhoto(const YFPhoto& other);
54 
55 public:
56 
57  const QString& urn() const
58  {
59  return m_urn;
60  }
61 
62  const QString& author() const
63  {
64  return m_author;
65  }
66 
67  const QString& title() const
68  {
69  return m_title;
70  }
71 
72  void setTitle(const QString& title)
73  {
74  m_title = title;
75  }
76 
77  const QString& summary() const
78  {
79  return m_summary;
80  }
81 
82  void setSummary(const QString& summary)
83  {
85  }
86 
87  const QDateTime& publishedDate() const
88  {
89  return m_publishedDate;
90  }
91 
92  const QDateTime& editedDate() const
93  {
94  return m_editedDate;
95  }
96 
97  const QDateTime& updatedDate() const
98  {
99  return m_updatedDate;
100  }
101 
102  const QDateTime& createdDate() const
103  {
104  return m_createdDate;
105  }
106 
107  Access access() const
108  {
109  return m_access;
110  }
111 
113  {
114  m_access = access;
115  }
116 
117  bool isHideOriginal() const
118  {
119  return m_hideOriginal;
120  }
121 
122  void setHideOriginal(bool hideOriginal)
123  {
124  m_hideOriginal = hideOriginal;
125  }
126 
127  bool isDisableComments() const
128  {
129  return m_disableComments;
130  }
131 
132  void setDisableComments(bool disableComments)
133  {
134  m_disableComments = disableComments;
135  }
136 
137  bool isAdult() const
138  {
139  return m_adult;
140  }
141 
142  void setAdult(bool adult)
143  {
144  m_adult = adult;
145  }
146 
147  QString localUrl() const
148  {
149  return m_localUrl;
150  }
151 
152  void setLocalUrl(const QString& localUrl)
153  {
155  }
156 
157  QString originalUrl() const
158  {
159  return m_originalUrl;
160  }
161 
162  void setOriginalUrl(const QString& originalUrl)
163  {
165  }
166 
167  QString remoteUrl() const
168  {
169  return m_remoteUrl;
170  }
171 
172  QString toString() const
173  {
174  return m_title;
175  }
176 
177 public:
178 
179  QStringList tags;
180 
181 protected:
182 
183  friend class YFTalker;
184 
185  YFPhoto(const QString& urn,
186  const QString& author,
187  const QString& title,
188  const QString& summary,
189  const QString& apiEditUrl,
190  const QString& apiSelfUrl,
191  const QString& apiMediaUrl,
192  const QString& apiAlbumUrl,
193  const QDateTime& publishedDate,
194  const QDateTime& editedDate,
195  const QDateTime& updatedDate,
196  const QDateTime& createdDate,
197  Access access,
198  bool hideOriginal,
199  bool disableComments,
200  bool adult,
201  const QString& remoteUrl);
202 
203  QString m_urn;
204  QString m_author;
205  QString m_title;
206  QString m_summary;
207 
208  QString m_apiEditUrl;
209  QString m_apiSelfUrl;
210  QString m_apiMediaUrl;
211  QString m_apiAlbumUrl;
212 
213  QDateTime m_publishedDate;
214  QDateTime m_editedDate;
215  QDateTime m_updatedDate;
216  QDateTime m_createdDate;
217 
221  bool m_adult;
222 
223  QString m_remoteUrl;
224  QString m_localUrl;
225  QString m_originalUrl;
226 
227  friend QDebug operator<<(QDebug d, const YFPhoto& p);
228 };
229 
230 QDebug operator<<(QDebug d, const YFPhoto& p);
231 
232 } // namespace DigikamGenericYFPlugin
233 
234 #endif // DIGIKAM_YF_PHOTO_H
Definition: yfphoto.h:38
void setOriginalUrl(const QString &originalUrl)
Definition: yfphoto.h:162
bool isDisableComments() const
Definition: yfphoto.h:127
bool m_hideOriginal
Definition: yfphoto.h:219
QString m_urn
Definition: yfphoto.h:203
void setSummary(const QString &summary)
Definition: yfphoto.h:82
void setTitle(const QString &title)
Definition: yfphoto.h:72
QString m_remoteUrl
Definition: yfphoto.h:223
QStringList tags
Definition: yfphoto.h:179
const QString & summary() const
Definition: yfphoto.h:77
YFPhoto()
Definition: yfphoto.cpp:29
QString m_title
Definition: yfphoto.h:205
QDateTime m_editedDate
Definition: yfphoto.h:214
QString toString() const
Definition: yfphoto.h:172
QDateTime m_createdDate
Definition: yfphoto.h:216
Access m_access
Definition: yfphoto.h:218
const QDateTime & updatedDate() const
Definition: yfphoto.h:97
QDateTime m_publishedDate
Definition: yfphoto.h:213
void setDisableComments(bool disableComments)
Definition: yfphoto.h:132
bool isHideOriginal() const
Definition: yfphoto.h:117
QDateTime m_updatedDate
Definition: yfphoto.h:215
QString m_apiAlbumUrl
Definition: yfphoto.h:211
QString originalUrl() const
Definition: yfphoto.h:157
bool m_disableComments
Definition: yfphoto.h:220
Access access() const
Definition: yfphoto.h:107
const QDateTime & editedDate() const
Definition: yfphoto.h:92
QString m_author
Definition: yfphoto.h:204
QString m_originalUrl
Definition: yfphoto.h:225
QString remoteUrl() const
Definition: yfphoto.h:167
Access
Definition: yfphoto.h:42
@ ACCESS_PRIVATE
Definition: yfphoto.h:45
@ ACCESS_FRIENDS
Definition: yfphoto.h:44
@ ACCESS_PUBLIC
Definition: yfphoto.h:43
void setHideOriginal(bool hideOriginal)
Definition: yfphoto.h:122
QString m_apiSelfUrl
Definition: yfphoto.h:209
void setAccess(Access access)
Definition: yfphoto.h:112
void setLocalUrl(const QString &localUrl)
Definition: yfphoto.h:152
friend QDebug operator<<(QDebug d, const YFPhoto &p)
Definition: yfphoto.cpp:99
QString m_summary
Definition: yfphoto.h:206
QString localUrl() const
Definition: yfphoto.h:147
const QDateTime & createdDate() const
Definition: yfphoto.h:102
void setAdult(bool adult)
Definition: yfphoto.h:142
const QString & author() const
Definition: yfphoto.h:62
QString m_apiEditUrl
Definition: yfphoto.h:208
const QString & urn() const
Definition: yfphoto.h:57
bool m_adult
Definition: yfphoto.h:221
bool isAdult() const
Definition: yfphoto.h:137
const QString & title() const
Definition: yfphoto.h:67
QString m_localUrl
Definition: yfphoto.h:224
QString m_apiMediaUrl
Definition: yfphoto.h:210
const QDateTime & publishedDate() const
Definition: yfphoto.h:87
Definition: yftalker.h:44
Definition: yfalbum.cpp:27
QDebug operator<<(QDebug d, const YandexFotkiAlbum &a)
Definition: yfalbum.cpp:88