Classified ads
profilecomment.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Jarvinen 2013.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Classified Ads. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef CLASSIFIED_PROFILE_COMMENT_H
21 #define CLASSIFIED_PROFILE_COMMENT_H
22 #include <QString>
23 #include "../util/hash.h" // for class Hash
24 #include <QPixmap>
25 #include <QVariant> // actually for qvariantmap
26 #include "../net/protocol.h" // for ProtocolItemType
27 #include "../mcontroller.h" // for KNullHash
28 
38 public:
46  ProfileComment(const Hash& aHash = KNullHash ) ;
47  ~ProfileComment() ;
49  QByteArray asJSon(const MController& aController) const ;
50  bool fromJSon(const QByteArray &aJSonBytes,
51  const MController& aController ) ;
55  QVariant asQVariant(const MController& aController) const ;
60  bool setFromQVariant(const QVariantMap& aJSonAsQVariant,
61  const MController& aController) ;
62 
63  // data is also public
67  QList<Hash> iAttachedFiles ;
68  QString iCommentText ;
69  QString iSubject ;
70  bool iIsPrivate ;
72  quint32 iTimeOfPublish ;
73  QByteArray iKeyOfCommentor ;
74  QString iCommentorNickName ;
80 } ;
81 #endif
Hash iCommentorHash
Definition: profilecomment.h:66
Carrier-class for comments of a profile.
Definition: profilecomment.h:37
ProtocolItemType iTypeOfObjectReferenced
Definition: profilecomment.h:77
Hash iFingerPrint
Definition: profilecomment.h:64
QString iCommentText
Definition: profilecomment.h:68
Hash is class that carries 160-bit digest.
Definition: hash.h:37
bool fromJSon(const QByteArray &aJSonBytes, const MController &aController)
ProtocolItemType
Definition: protocol.h:124
QByteArray iKeyOfCommentor
Definition: profilecomment.h:73
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:39
QList< Hash > iAttachedFiles
Definition: profilecomment.h:67
Hash KNullHash
bool iIsPrivate
Definition: profilecomment.h:70
QByteArray asJSon(const MController &aController) const
Hash iReferences
Definition: profilecomment.h:75
QString iCommentorNickName
Definition: profilecomment.h:74
Hash iProfileFingerPrint
Definition: profilecomment.h:65
ProfileComment(const Hash &aHash=KNullHash)
quint32 iTimeOfPublish
Definition: profilecomment.h:72
QString iSubject
Definition: profilecomment.h:69
bool setFromQVariant(const QVariantMap &aJSonAsQVariant, const MController &aController)
QVariant asQVariant(const MController &aController) const