ICF 3.1.1.10
Technical documentation of ICF Libraries
CBitmapPersistenceComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QDir>
11#include <QtCore/QStringList>
12
13// ICF includes
17#include <iimg/iimg.h>
18
19
20namespace iimg
21{
22
23
28 public QObject,
30 virtual public ifile::IFilePersistence
31{
32 Q_OBJECT
33
34public:
36
38 {
39 MI_BAD_FORMAT = 0xe1a7d0
40 };
41
42 I_BEGIN_COMPONENT(CBitmapPersistenceComp);
43 I_REGISTER_INTERFACE(ifile::IFileTypeInfo);
44 I_REGISTER_INTERFACE(ifile::IFilePersistence);
45 I_ASSIGN_MULTI_0(m_extensionFilterAttrPtr, "ExtensionFilter", "Optional filter of extensions, lowercase as returned by Qt", false)
46 I_END_COMPONENT;
47
48 // reimplemented (ifile::IFilePersistence)
50 const istd::IChangeable* dataObjectPtr,
51 const QString* filePathPtr = nullptr,
52 int flags = -1,
53 bool beQuiet = true) const override;
54 virtual iproc::CTaskState LoadFromFile(
55 istd::IChangeable& data,
56 const QString& filePath = QString(),
57 iproc::IProgressManager* progressManagerPtr = nullptr) const override;
58 virtual iproc::CTaskState SaveToFile(
59 const istd::IChangeable& data,
60 const QString& filePath = QString(),
61 iproc::IProgressManager* progressManagerPtr = nullptr) const override;
62
63 // reimplemented (ifile::IFileTypeInfo)
64 bool GetFileExtensions(QStringList& result, const istd::IChangeable* dataObjectPtr = nullptr, int flags = -1, bool doAppend = false) const override;
65 QString GetTypeDescription(const QString* extensionPtr = nullptr) const override;
66
67private:
68 I_MULTIATTR(QByteArray, m_extensionFilterAttrPtr);
69};
70
71
72} // namespace iimg
73
74
Interface providing loading and saving of data objects.
Provide loading and saving of objects.
Bitmap loader component implementing interfaces ifile::IFilePersistence.
QString GetTypeDescription(const QString *extensionPtr=nullptr) const override
Get description of object type associated with single extension.
virtual iproc::CTaskState SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), iproc::IProgressManager *progressManagerPtr=nullptr) const override
This function saves data data to file filePath.
virtual bool IsOperationSupported(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=nullptr, int flags=-1, bool beQuiet=true) const override
Returns true if object dataObject can be loaded/saved.
ilog::CLoggerComponentBase BaseClass
bool GetFileExtensions(QStringList &result, const istd::IChangeable *dataObjectPtr=nullptr, int flags=-1, bool doAppend=false) const override
Get file extensions supported by this loader.
virtual iproc::CTaskState LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), iproc::IProgressManager *progressManagerPtr=nullptr) const override
This function loads data data from file filePath.
Wrapper provider of log-functionality for component based implementations.
Contains the system indenendent definitions of image and related themes.
Definition CBitmap.h:21
This namespace containes interfaces and implementation of data processing concepts.
Standard library.
Definition IComponent.h:17

© Witold Gantzke and Kirill Lepskiy