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
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (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 GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef CLASSIFIED_PROFILE_COMMENT_H
22 #define CLASSIFIED_PROFILE_COMMENT_H
23 #include <QString>
24 #include "../util/hash.h" // for class Hash
25 #include <QPixmap>
26 #include <QVariant> // actually for qvariantmap
27 #include "../net/protocol.h" // for ProtocolItemType
28 #include "../mcontroller.h" // for KNullHash
29 
39 public:
47  ProfileComment(const Hash& aHash = KNullHash ) ;
48  ~ProfileComment() ;
50  QByteArray asJSon(const MController& aController) const ;
51  bool fromJSon(const QByteArray &aJSonBytes,
52  const MController& aController ) ;
56  QVariant asQVariant(const MController& aController) const ;
61  bool setFromQVariant(const QVariantMap& aJSonAsQVariant,
62  const MController& aController) ;
63 
64  // data is also public
68  QList<Hash> iAttachedFiles ;
69  QString iCommentText ;
70  QString iSubject ;
71  bool iIsPrivate ;
73  quint32 iTimeOfPublish ;
74  QByteArray iKeyOfCommentor ;
75  QString iCommentorNickName ;
81 } ;
82 #endif
Hash iCommentorHash
Definition: profilecomment.h:67
Carrier-class for comments of a profile.
Definition: profilecomment.h:38
ProtocolItemType iTypeOfObjectReferenced
Definition: profilecomment.h:78
Hash iFingerPrint
Definition: profilecomment.h:65
QString iCommentText
Definition: profilecomment.h:69
Hash is class that carries 160-bit digest.
Definition: hash.h:38
bool fromJSon(const QByteArray &aJSonBytes, const MController &aController)
ProtocolItemType
Definition: protocol.h:157
QByteArray iKeyOfCommentor
Definition: profilecomment.h:74
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:48
QList< Hash > iAttachedFiles
Definition: profilecomment.h:68
Hash KNullHash
bool iIsPrivate
Definition: profilecomment.h:71
Hash iReferences
Definition: profilecomment.h:76
QVariant asQVariant(const MController &aController) const
QString iCommentorNickName
Definition: profilecomment.h:75
Hash iProfileFingerPrint
Definition: profilecomment.h:66
ProfileComment(const Hash &aHash=KNullHash)
quint32 iTimeOfPublish
Definition: profilecomment.h:73
QString iSubject
Definition: profilecomment.h:70
QByteArray asJSon(const MController &aController) const
bool setFromQVariant(const QVariantMap &aJSonAsQVariant, const MController &aController)