digiKam
vkontakte_messageinfo.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_MESSAGEINFO_H
25 #define DIGIKAM_VKONTAKTE_MESSAGEINFO_H
26 
27 // Qt includes
28 
29 #include <QDateTime>
30 
31 namespace Vkontakte
32 {
33 
37 class MessageInfo : public QObject
38 {
39  Q_OBJECT
40 
41  // date, uid, mid, title, body, read_state, out
42  Q_PROPERTY(QString date WRITE setDateString READ dateString)
43  Q_PROPERTY(int uid WRITE setUid READ uid)
44  Q_PROPERTY(int mid WRITE setMid READ mid)
45  Q_PROPERTY(QString title WRITE setTitle READ title)
46  Q_PROPERTY(QString body WRITE setBody READ body)
47  Q_PROPERTY(int read_state WRITE setReadState READ readState)
48  Q_PROPERTY(int out WRITE setOut READ out) // do non-discussion messages have this?
49 
50  // For chats: chat_id, chat_active
51  Q_PROPERTY(QString chat_id WRITE setChatId READ chatId)
52  Q_PROPERTY(QString chat_active WRITE setChatActive READ chatActive)
53 
54 public:
55 
56  MessageInfo();
57  ~MessageInfo();
58 
63  void setDateString(const QString& createdDate);
64 
68  QString dateString() const;
69 
73  QDateTime date() const;
74 
75  void setUid(int uid);
76  int uid() const;
77 
78  void setMid(int mid);
79  int mid() const;
80 
81  void setTitle(const QString& title);
82  QString title() const;
83 
87  QString coreTitle() const;
88 
89  void setBody(const QString& body);
90  QString body() const;
91 
92  void setReadState(int readState);
93  int readState() const;
94 
95  void setOut(int out);
96  int out() const;
97 
98  void setChatId(const QString& chatId);
99  QString chatId() const;
100 
101  void setChatActive(const QString& chatActive);
102  QString chatActive() const;
103 
104  QString remoteId() const;
105 
106 private:
107 
108  class Private;
109  Private* const d;
110 };
111 
115 class MessageInfoPtr : public QSharedPointer<MessageInfo>
116 {
117 public:
118 
119  explicit MessageInfoPtr(MessageInfo* const ptr);
120 
124  bool operator<(const MessageInfoPtr& o) const;
125 };
126 
127 } // namespace Vkontakte
128 
129 #endif // DIGIKAM_VKONTAKTE_MESSAGEINFO_H
bool operator<(const FbUser &first, const FbUser &second)
Definition: fbtalker.cpp:69