CBitmapLoaderComp.h
Go to the documentation of this file.
1 #ifndef iimg_CBitmapLoaderComp_included
2 #define iimg_CBitmapLoaderComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QDir>
7 #include <QtCore/QStringList>
8 
9 // ACF includes
10 #include <ifile/IFilePersistence.h>
11 #include <icomp/CComponentBase.h>
12 #include <ilog/TLoggerCompWrap.h>
13 #include <iimg/iimg.h>
14 
15 
16 namespace iimg
17 {
18 
19 
24  public QObject,
26  virtual public ifile::IFilePersistence
27 {
28  Q_OBJECT
29 
30 public:
32 
33  enum MessageId
34  {
35  MI_BAD_FORMAT = 0xe1a7d0
36  };
37 
38  I_BEGIN_COMPONENT(CBitmapLoaderComp);
39  I_REGISTER_INTERFACE(ifile::IFileTypeInfo);
40  I_REGISTER_INTERFACE(ifile::IFilePersistence);
41  I_ASSIGN_MULTI_0(m_extensionFilterAttrPtr, "ExtensionFilter", "Optional filter of extensions, lowercase as returned by Qt", false)
42  I_END_COMPONENT;
43 
44  // reimplemented (ifile::IFilePersistence)
45  virtual bool IsOperationSupported(
46  const istd::IChangeable* dataObjectPtr,
47  const QString* filePathPtr = NULL,
48  int flags = -1,
49  bool beQuiet = true) const;
50  virtual int LoadFromFile(
51  istd::IChangeable& data,
52  const QString& filePath = QString(),
53  ibase::IProgressManager* progressManagerPtr = NULL) const;
54  virtual int SaveToFile(
55  const istd::IChangeable& data,
56  const QString& filePath = QString(),
57  ibase::IProgressManager* progressManagerPtr = NULL) const;
58 
59  // reimplemented (ifile::IFileTypeInfo)
60  virtual bool GetFileExtensions(QStringList& result, const istd::IChangeable* dataObjectPtr = NULL, int flags = -1, bool doAppend = false) const;
61  virtual QString GetTypeDescription(const QString* extensionPtr = NULL) const;
62 
63 protected:
65  const istd::IChangeable* dataObjectPtr,
66  const QString* filePathPtr,
67  bool forLoading,
68  bool forSaving,
69  bool useLog) const;
70 
71 private:
72  I_MULTIATTR(QByteArray, m_extensionFilterAttrPtr);
73 };
74 
75 
76 } // namespace iimg
77 
78 
79 #endif // !iimg_CBitmapLoaderComp_included
80 
81 
Provide loading and saving of objects.
Definition: IFileTypeInfo.h:22
bool IsOperationSupportedIntern(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr, bool forLoading, bool forSaving, bool useLog) const
virtual bool GetFileExtensions(QStringList &result, const istd::IChangeable *dataObjectPtr=NULL, int flags=-1, bool doAppend=false) const
Get file extensions supported by this loader.
virtual int SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const
This function saves data data to file filePath.
Wrapper provider of log-functionality for component based implementations.
virtual int LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const
This function loads data data from file filePath.
virtual bool IsOperationSupported(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=NULL, int flags=-1, bool beQuiet=true) const
Returns true if object dataObject can be loaded/saved.
Bitmap loader component implementing interfaces ifile::IFilePersistence.
#define NULL
Definition: istd.h:64
MessageId
List of possible message IDs used in context of this interface.
Interface providing loading and saving of data objects.
ilog::CLoggerComponentBase BaseClass
virtual QString GetTypeDescription(const QString *extensionPtr=NULL) const
Get description of object type associated with single extension.

© 2007-2017 Witold Gantzke and Kirill Lepskiy