2018-11-14 21:14:40 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h *
|
|
|
|
* *
|
|
|
|
* Copyright 2014 Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2013-07-14 18:48:40 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <retroshare/rsgxsifacetypes.h>
|
|
|
|
|
|
|
|
// This class implement a basic RS functionality which is that widgets displaying info
|
|
|
|
// should update regularly. They also should update only when visible, to save CPU time.
|
|
|
|
//
|
|
|
|
// Using this class simply needs to derive your widget from RsGxsUpdateBroadcastWidget
|
|
|
|
// and oveload the updateDisplay() function with the actual code that updates the
|
|
|
|
// widget.
|
|
|
|
//
|
|
|
|
|
2019-02-14 22:48:33 +01:00
|
|
|
struct RsGxsIfaceHelper;
|
2013-07-14 18:48:40 +00:00
|
|
|
class RsGxsUpdateBroadcastBase;
|
2018-06-23 22:25:36 +02:00
|
|
|
typedef uint32_t TurtleRequestId;
|
2013-07-14 18:48:40 +00:00
|
|
|
|
|
|
|
class RsGxsUpdateBroadcastWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = 0);
|
|
|
|
virtual ~RsGxsUpdateBroadcastWidget();
|
|
|
|
|
2014-05-05 21:53:47 +00:00
|
|
|
void fillComplete();
|
2013-07-14 18:48:40 +00:00
|
|
|
void setUpdateWhenInvisible(bool update);
|
2018-06-21 15:46:59 +02:00
|
|
|
const std::set<RsGxsGroupId> &getGrpIds();
|
|
|
|
const std::set<RsGxsGroupId> &getGrpIdsMeta();
|
|
|
|
void getAllGrpIds(std::set<RsGxsGroupId> &grpIds);
|
|
|
|
const std::map<RsGxsGroupId, std::set<RsGxsMessageId> > &getMsgIds();
|
|
|
|
const std::map<RsGxsGroupId, std::set<RsGxsMessageId> > &getMsgIdsMeta();
|
|
|
|
void getAllMsgIds(std::map<RsGxsGroupId, std::set<RsGxsMessageId> > &msgIds);
|
2020-02-06 19:57:23 +01:00
|
|
|
const std::set<TurtleRequestId>& getSearchquests() ;
|
2013-07-14 18:48:40 +00:00
|
|
|
|
2014-07-23 18:51:56 +00:00
|
|
|
RsGxsIfaceHelper *interfaceHelper() { return mInterfaceHelper; }
|
|
|
|
|
2013-07-14 18:48:40 +00:00
|
|
|
protected:
|
|
|
|
virtual void showEvent(QShowEvent *event);
|
|
|
|
|
|
|
|
// This is overloaded in subclasses.
|
2013-07-19 09:48:51 +00:00
|
|
|
virtual void updateDisplay(bool complete) = 0;
|
2013-07-14 18:48:40 +00:00
|
|
|
|
|
|
|
private slots:
|
2013-07-19 09:48:51 +00:00
|
|
|
void fillDisplay(bool complete);
|
2013-07-14 18:48:40 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
RsGxsUpdateBroadcastBase *mBase;
|
2014-07-23 18:51:56 +00:00
|
|
|
RsGxsIfaceHelper *mInterfaceHelper;
|
2013-07-14 18:48:40 +00:00
|
|
|
};
|