206 const auto& thisData = f (data);
207 return std::any_of (existing.begin (), existing.end (),
208 [&thisData, &f] (
const QByteArray& other) { return thisData == f (other); });
212Q_DECLARE_INTERFACE (
IRecoverableTab,
"org.Deviant.LeechCraft.IRecoverableTab/1.0")
Interface for plugins that can recover tabs after restart.
virtual bool HasSimilarTab(const QByteArray &data, const QList< QByteArray > &existing) const =0
Checks if there is a tab similar to the one defined by data.
virtual void RecoverTabs(const QList< LC::TabRecoverInfo > &infos)=0
Recovers the tabs according to the infos list.
virtual ~IHaveRecoverableTabs()
static bool StandardSimilarImpl(const QByteArray &data, const QList< QByteArray > &existing, const T &f)
A standard implementation of the HasSimilarTab() function.
Interface for a single tab that may be recovered.
virtual std::optional< LC::TabSaveInfo > GetTabSaveInfo() const =0
Returns the tab's save information.
virtual ~IRecoverableTab()=default
virtual void tabRecoverDataChanged()=0
Notifies that tab state's changed.
QList< QPair< QByteArray, QVariant > > DynPropertiesList_t
Keeps the tab state between runs.
DynPropertiesList_t DynProperties_
Dynamic properties list from other plugins.
QByteArray Data_
The tab-specific restore data.
QIcon Icon_
Returns the icon of this tab.
QString Name_
The user-readable name of the tab.
QByteArray Data_
The serialized state of a tab.