digiKam
vkontakte_noteinfo.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-02-19
7  * Description : a tool to export images to VKontakte web service
8  *
9  * Copyright (C) 2011-2015 by Alexander Potashev <aspotashev at gmail dot com>
10  * Copyright (C) 2011-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_VKONTAKTE_NOTEINFO_H
25 #define DIGIKAM_VKONTAKTE_NOTEINFO_H
26 
27 // Qt includes
28 
29 #include <QDateTime>
30 
31 namespace Vkontakte
32 {
33 
34 // https://vk.com/dev/notes.getById
35 class NoteInfo : public QObject
36 {
37  Q_OBJECT
38 
39  // nid, uid, title, text, text_wiki, date, ncom, read_ncom, privacy, comment_privacy, can_comment
40  Q_PROPERTY(int nid WRITE setNid READ nid)
41  Q_PROPERTY(int uid WRITE setUid READ uid)
42  Q_PROPERTY(QString title WRITE setTitle READ title)
43  Q_PROPERTY(QString text WRITE setText READ text)
44  Q_PROPERTY(QString text_wiki WRITE setTextWiki READ textWiki)
45  Q_PROPERTY(QString date WRITE setDateString READ dateString)
46  Q_PROPERTY(int ncom WRITE setNcom READ ncom)
47  Q_PROPERTY(int read_ncom WRITE setReadNcom READ readNcom)
48  Q_PROPERTY(int privacy WRITE setPrivacy READ privacy)
49  Q_PROPERTY(int comment_privacy WRITE setCommentPrivacy READ commentPrivacy)
50  Q_PROPERTY(bool can_comment WRITE setCanComment READ canComment)
51 
52 public:
53 
54  NoteInfo();
55  ~NoteInfo();
56 
57  void setNid(int nid);
58  int nid() const;
59 
60  void setUid(int uid);
61  int uid() const;
62 
67  void setTitle(const QString& title);
71  QString title() const;
72 
77  void setText( const QString& text);
78 
82  QString text() const;
83 
88  void setTextWiki( const QString& textWiki);
89 
93  QString textWiki() const;
94 
99  void setDateString(const QString& createdDate);
100 
104  QString dateString() const;
105 
109  QDateTime date() const;
110 
111  void setNcom(int ncom);
112  int ncom() const;
113 
114  void setReadNcom(int readNcom);
115  int readNcom() const;
116 
117  void setPrivacy(int privacy);
118  int privacy() const;
119 
120  void setCommentPrivacy(int commentPrivacy);
121  int commentPrivacy() const;
122 
123  void setCanComment(bool canComment);
124  bool canComment() const;
125 
126 private:
127 
128  class Private;
129  Private* const d;
130 };
131 
132 typedef QSharedPointer<NoteInfo> NoteInfoPtr;
133 
134 } // namespace Vkontakte
135 
136 #endif // DIGIKAM_VKONTAKTE_NOTEINFO_H