9#ifndef INTERFACES_IHAVERECOVERABLETABS_H
10#define INTERFACES_IHAVERECOVERABLETABS_H
192 const auto& thisData = f (data);
193 return std::any_of (existing.begin (), existing.end (),
194 [&thisData, &f] (
const QByteArray& other) { return thisData == f (other); });
198Q_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 QByteArray GetTabRecoverData() const =0
Returns the serialized state of the tab.
virtual ~IRecoverableTab()
virtual QIcon GetTabRecoverIcon() const =0
Returns the icon of this tab.
virtual QString GetTabRecoverName() const =0
Returns the user-readable name of the tab.
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.