Show webfinger if displayName is unknown for an author.
[larjonas-pumpa.git] / src / qasobjectlist.h
blob5fd4f2061239b29e0690c86300a818a4268c5627
1 /*
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/>.
20 #ifndef _QASOBJECTLIST_H_
21 #define _QASOBJECTLIST_H_
23 #include "qasabstractobject.h"
24 #include "qasabstractobjectlist.h"
25 #include "qasobject.h"
27 //------------------------------------------------------------------------------
29 class QASObjectList : public QASAbstractObjectList {
30 Q_OBJECT
32 protected:
33 QASObjectList(QString url, QObject* parent);
35 public:
36 virtual void update(QVariantMap json, bool older, bool updateOnly=false);
38 static void clearCache();
40 static QASObjectList* initObjectList(QString url, QObject* parent);
42 static QASObjectList* getObjectList(QVariantMap json, QObject* parent,
43 int id=0);
44 static QASObjectList* getObjectList(QVariantList json, QObject* parent,
45 int id=0);
47 QASObject* at(size_t i) const {
48 return qobject_cast<QASObject*>(QASAbstractObjectList::at(i));
51 bool containsYou() const;
53 void isReplies(bool b) { m_isReplies = b; }
55 RecipientList toRecipientList() const;
57 protected:
58 virtual QASAbstractObject* getAbstractObject(QVariantMap json,
59 QObject* parent);
61 private:
62 static QMap<QString, QASObjectList*> s_objectLists;
63 bool m_isReplies;
66 #endif /* _QASOBJECTLIST_H_ */