2 Copyright 2013-2015 Mats Sjöberg
4 This file is part of the Pumpa programme.
6 Pumpa is free software: you can redistribute it and/or modify it
7 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.
11 Pumpa is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Pumpa. If not, see <http://www.gnu.org/licenses/>.
23 #include "qasobject.h"
26 #include <QStringList>
28 //------------------------------------------------------------------------------
30 class QASActor
: public QASObject
{
34 QASActor(QString id
, QObject
* parent
);
37 static void clearCache();
39 static QASActor
* getActor(QVariantMap json
, QObject
* parent
);
40 virtual void update(QVariantMap json
);
42 QString
webFinger() const { return m_webFinger
; }
43 QString
displayNameOrWebFinger() const;
44 QString
preferredUsername() const { return m_preferredUsername
; }
46 QString
displayNameOrYou() const { return isYou() ? "You" : displayName(); }
47 void setDisplayName(QString s
) { m_displayName
= s
; }
49 bool isYou() const { return m_isYou
; }
52 bool followed() const;
53 void setFollowed(bool b
);
54 bool followedKnown() const { return s_followed_known
|| m_followed_set
; }
55 static void setFollowedKnown();
56 void followedIsKnown();
58 QString
summary() const { return m_summary
; }
59 void setSummary(QString s
) { m_summary
= s
; }
61 QString
location() const { return m_location
; }
62 void setLocation(QString l
) { m_location
= l
; }
64 bool isHidden() const;
65 void setHidden(bool b
);
67 static void setHiddenAuthors(QStringList sl
);
68 static QStringList
getHiddenAuthors() { return s_hiddenAuthors
.toList(); }
71 static bool s_followed_known
;
81 QString m_preferredUsername
;
83 static QMap
<QString
, QASActor
*> s_actors
;
84 static QSet
<QString
> s_hiddenAuthors
;
87 #endif /* _QASACTOR_H_ */