mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-09 22:49:41 -05:00
a25f974473
previously declared as a class In file included from ../../../trunk/retroshare-gui/src/main.cpp:66: In file included from ../../../trunk/libretroshare/src/retroshare/ rsidentity.h:31: ../../../trunk/libretroshare/src/retroshare/rsgxsifacehelper.h:43:1: warning: 'RsGxsIfaceHelper' defined as a struct here but previously declared as a class [-Wmismatched-tags] struct RsGxsIfaceHelper ^ ../../../trunk/retroshare-gui/src/util/RsGxsUpdateBroadcast.h:28:1: note: did you mean struct here? class RsGxsIfaceHelper; ^~~~~ struct
71 lines
3.1 KiB
C++
71 lines
3.1 KiB
C++
/*******************************************************************************
|
|
* 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/>. *
|
|
* *
|
|
*******************************************************************************/
|
|
|
|
#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.
|
|
//
|
|
|
|
struct RsGxsIfaceHelper;
|
|
class RsGxsUpdateBroadcastBase;
|
|
typedef uint32_t TurtleRequestId;
|
|
|
|
class RsGxsUpdateBroadcastWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = 0);
|
|
virtual ~RsGxsUpdateBroadcastWidget();
|
|
|
|
void fillComplete();
|
|
void setUpdateWhenInvisible(bool update);
|
|
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);
|
|
const std::set<TurtleRequestId>& getSearchResults() ;
|
|
|
|
RsGxsIfaceHelper *interfaceHelper() { return mInterfaceHelper; }
|
|
|
|
protected:
|
|
virtual void showEvent(QShowEvent *event);
|
|
|
|
// This is overloaded in subclasses.
|
|
virtual void updateDisplay(bool complete) = 0;
|
|
|
|
private slots:
|
|
void fillDisplay(bool complete);
|
|
|
|
private:
|
|
RsGxsUpdateBroadcastBase *mBase;
|
|
RsGxsIfaceHelper *mInterfaceHelper;
|
|
};
|