#pragma once #include #include class QShowEvent; class RsGxsIfaceHelper; class RsGxsUpdateBroadcast; class RsGxsUpdateBroadcastBase : public QObject { friend class RsGxsUpdateBroadcastPage; friend class RsGxsUpdateBroadcastWidget; Q_OBJECT public: RsGxsUpdateBroadcastBase(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL); virtual ~RsGxsUpdateBroadcastBase(); const std::list &getGrpIds() { return mGrpIds; } const std::list &getGrpIdsMeta() { return mGrpIdsMeta; } void getAllGrpIds(std::list &grpIds); const std::map > &getMsgIds() { return mMsgIds; } const std::map > &getMsgIdsMeta() { return mMsgIdsMeta; } void getAllMsgIds(std::map > &msgIds); protected: void fillComplete(); void setUpdateWhenInvisible(bool update) { mUpdateWhenInvisible = update; } void showEvent(QShowEvent *e); signals: void fillDisplay(bool complete); private slots: void updateBroadcastChanged(); void updateBroadcastGrpsChanged(const std::list& grpIds, const std::list &grpIdsMeta); void updateBroadcastMsgsChanged(const std::map >& msgIds, const std::map >& msgIdsMeta); void securedUpdateDisplay(); private: RsGxsUpdateBroadcast *mUpdateBroadcast; bool mFillComplete; bool mUpdateWhenInvisible; // Update also when not visible std::list mGrpIds; std::list mGrpIdsMeta; std::map > mMsgIds; std::map > mMsgIdsMeta; };