1/* Copyright 2011 Roeland Jago Douma <unix@rullzer.com>
2
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Library General Public License as published
5 by the Free Software Foundation; either version 2 of the License or
6 (at your option) version 3 or, at the discretion of KDE e.V.
7 (which shall act as a proxy as in section 14 of the GPLv3), any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KFBAPI_NOTEINFO_H
21#define KFBAPI_NOTEINFO_H
22
23#include "libkfbapi_export.h"
24
25#include <KMime/Message>
26#include <KDateTime>
27
28namespace KFbAPI {
29
30/**
31 * Class to represent a facebook note
32 */
33class LIBKFBAPI_EXPORT NoteInfo
34{
35public:
36 NoteInfo();
37 NoteInfo(const NoteInfo &other);
38 ~NoteInfo();
39
40 NoteInfo &operator=(const NoteInfo &other);
41
42 /**
43 * Set the facebook id of this note
44 * @param id the facebook id
45 */
46 void setId(const QString &id);
47 /**
48 * Returns the facebook id
49 */
50 QString id() const;
51
52 /**
53 * Set who wrote the note
54 * @param from the creator of the note
55 */
56 void setFrom(const QString &from);
57 /**
58 * Returns the creator of the note
59 */
60 QString from() const;
61
62 /**
63 * Set the subject of the note
64 * @param subject the subject
65 */
66 void setSubject(const QString &subject);
67 /**
68 * Returns the subject of the note.
69 */
70 QString subject() const;
71
72 /**
73 * Set the actual content of the note
74 * @param message The actual content of the note
75 */
76 void setMessage(const QString &message);
77 /**
78 * Returns the content of the note.
79 */
80 QString message() const;
81
82 /**
83 * Set the creation time of the note
84 * @param createdTime Time in "facebook format"
85 */
86 void setCreatedTimeString(const QString &createdTime);
87 /**
88 * Returns the creation time as a string in "facebook format"
89 */
90 QString createdTimeString() const;
91 /**
92 * Returns the creation time in KDateTime
93 */
94 KDateTime createdTime() const;
95
96 /**
97 * Set the time of the last update of the note
98 * @param updatedTime The time, in "facebook format", of the last update of
99 * the note.
100 */
101 void setUpdatedTimeString(const QString &updatedTime);
102 /**
103 * Returns the time of the last update of the note in "facebook format"
104 */
105 QString updatedTimeString() const;
106 /**
107 * Returns the time of the last update of the note as a KDateTime
108 */
109 KDateTime updatedTime() const;
110
111 /**
112 * Generates a KMime::Message from this note and return a
113 * KMime::Message::Ptr to it.
114 */
115 KMime::Message::Ptr asNote() const;
116
117private:
118 class NoteInfoPrivate;
119 QSharedDataPointer<NoteInfoPrivate> d;
120};
121
122}
123
124#endif
125