#pragma once #include #include // 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. // class RsGxsIfaceHelper; class RsGxsUpdateBroadcastBase; 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::list &getGrpIds(); const std::list &getGrpIdsMeta(); void getAllGrpIds(std::list &grpIds); const std::map > &getMsgIds(); const std::map > &getMsgIdsMeta(); void getAllMsgIds(std::map > &msgIds); 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; };