15 #ifndef BORNAGAIN_GUI_SUPPORT_IO_ABSTRACTDATALOADER_H
16 #define BORNAGAIN_GUI_SUPPORT_IO_ABSTRACTDATALOADER_H
36 virtual QString
name()
const = 0;
QDataStream & operator>>(QDataStream &stream, AbstractDataLoader &s)
QDataStream & operator<<(QDataStream &stream, const AbstractDataLoader &s)
Base class for result tables of data loaders. Derive from this class and return an instance in YourDa...
Abstract base class for all data loaders (classes to import real data).
virtual QByteArray serialize() const
Returns every internal setting so it can be restored completely.
virtual void applyImportSettings()
Read all values from the properties UI into the internal variables.
~AbstractDataLoader() override=default
virtual void populateImportSettingsWidget(QWidget *parent)
Fills the widget on the import dialog pane. The implementation here in the base class does nothing (m...
virtual AbstractDataLoaderResultModel * createResultModel() const
Create a table model which contains the import information like original file content,...
virtual void guessSettings()
Guess appropriate settings (for example the separator in a CSV file). Is called only once,...
void contentsProcessed()
Emitted whenever contents have been processed.
void importSettingsChanged()
Emitted whenever an import setting changed.
virtual QString persistentClassName() const =0
A name which can be used for save/load purposes (which will not change ever more)
virtual QString name() const =0
The name shown in the format selection combo.
virtual void setFileContents(const QByteArray &fileContent)=0
Sets the file contents to be imported. If the file was a compressed file, then the decompressed conte...
virtual void deserialize(const QByteArray &data)
Initialize from serialization data. If any error occurred, then a DeserializationException has to be ...
virtual int numErrors() const
Number of errors found while processing the content. An error means that either a particular content ...
virtual void processContents()=0
Process the file contents. Can be called more than once, e.g. if the import settings have changed....
virtual void initWithDefaultImportSettings()
Set import settings to defaults.
virtual QByteArray fileContent() const
Returns the original file content. If not available any more (like for legacy project file import),...
virtual QStringList lineUnrelatedErrors() const
Errors not related to a particular line.
virtual AbstractDataLoader * clone() const =0
Create a complete clone, including all internal states.
RealDataItem * m_item
The real-data-item which owns this loader. Never delete this!
RealDataItem * realDataItem()
The real data item on which the import shall work.
virtual QByteArray defaultImportSettings() const
Return the default import settings.
void setRealDataItem(RealDataItem *item)
Define the real data item on which the import shall work.
virtual int numLineRelatedErrors() const
Number of errors related to a specific line. Such an error means that a particular content (line) can...
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.