Merge branch 'master' of ssh://pumpa.branchable.com
[larjonas-pumpa.git] / src / collectionwidget.h
blobc1d0c5e3bd22ea4fd51114d19dce2da11f472bc2
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 WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 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 _COLLECTIONWIDGET_H_
21 #define _COLLECTIONWIDGET_H_
23 #include "qactivitystreams.h"
24 #include "activitywidget.h"
25 #include "aswidget.h"
27 //------------------------------------------------------------------------------
29 class CollectionWidget : public ASWidget {
30 Q_OBJECT
32 public:
33 CollectionWidget(QWidget* parent, int widgetLimit=-1, int purgeWait=10);
35 virtual bool hasObject(QASAbstractObject* obj);
37 protected slots:
38 virtual void update();
39 void onLoadOlderClicked();
41 protected:
42 void updateLoadOlderButton(bool wait=false);
43 virtual QASAbstractObjectList* initList(QString endpoint, QObject* parent);
44 virtual ObjectWidgetWithSignals* createWidget(QASAbstractObject* aObj);
45 virtual void changeWidgetObject(ObjectWidgetWithSignals*, QASAbstractObject*);
46 virtual bool countAsNew(QASAbstractObject* aObj);
47 virtual void clear();
49 bool isFullObject(QASActivity*);
51 private:
52 QPushButton* m_loadOlderButton;
53 QSet<QASObject*> m_objects_shown;
56 #endif /* _COLLECTIONWIDGET_H_ */