CSvgBitmapLoaderComp.h
Go to the documentation of this file.
1 #ifndef iqtmm_CSvgBitmapLoaderComp_included
2 #define iqtmm_CSvgBitmapLoaderComp_included
3 
4 
6 
7 #include "icomp/CComponentBase.h"
8 
9 #include "ilog/TLoggerCompWrap.h"
10 
11 #include "iimg/CBitmap.h"
12 
13 #include "iqtmm/iqtmm.h"
14 
15 
16 namespace iqtmm
17 {
18 
19 
24  public QObject,
26  virtual public ifile::IFilePersistence
27 {
28 public:
30 
31  I_BEGIN_COMPONENT(CSvgBitmapLoaderComp);
32  I_REGISTER_INTERFACE(ifile::IFileTypeInfo);
33  I_REGISTER_INTERFACE(ifile::IFilePersistence);
34  I_ASSIGN(m_bitmapWidthAttrPtr, "BitmapWidth", "Width of rendered bitmap in pixels", true, 100);
35  I_ASSIGN(m_bitmapHeightAttrPtr, "BitmapHeight", "Height of rendered bitmap in pixels", true, 100);
36  I_END_COMPONENT;
37 
38  enum MessageId
39  {
40  MI_BAD_EXTENSION = 0xa7e0,
44  };
45 
46  // reimplemented (ifile::IFilePersistence)
47  virtual bool IsOperationSupported(
48  const istd::IChangeable* dataObjectPtr,
49  const QString* filePathPtr = NULL,
50  int flags = -1,
51  bool beQuiet = true) const;
52  virtual int LoadFromFile(istd::IChangeable& data, const QString& filePath) const;
53  virtual int SaveToFile(const istd::IChangeable& data, const QString& filePath) const;
54 
55  // reimplemented (ifile::IFileTypeInfo)
56  virtual bool GetFileExtensions(QStringList& result, int flags = -1, bool doAppend = false) const;
57  virtual QString GetTypeDescription(const QString* extensionPtr = NULL) const;
58 
59 private:
60  I_ATTR(int, m_bitmapWidthAttrPtr);
61  I_ATTR(int, m_bitmapHeightAttrPtr);
62 
63  mutable QString m_lastFilePath;
64  mutable iimg::CBitmap m_lastBitmap;
65 };
66 
67 
68 } // namespace iqtmm
69 
70 
71 #endif // !iqtmm_CSvgBitmapLoaderComp_included
72 
73 
virtual bool GetFileExtensions(QStringList &result, int flags=-1, bool doAppend=false) const
virtual int LoadFromFile(istd::IChangeable &data, const QString &filePath) const
ilog::CLoggerComponentBase BaseClass
virtual bool IsOperationSupported(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=NULL, int flags=-1, bool beQuiet=true) const
virtual int SaveToFile(const istd::IChangeable &data, const QString &filePath) const
Load SVG files to bitmap.
virtual QString GetTypeDescription(const QString *extensionPtr=NULL) const

© 2007-2011 Witold Gantzke and Kirill Lepskiy