CSettingsSerializerComp.h
Go to the documentation of this file.
1 #ifndef iqt_CSettingsSerializerComp_included
2 #define iqt_CSettingsSerializerComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QSettings>
7 
8 // ACF includes
10 #include <icomp/CComponentBase.h>
11 #include <ibase/IApplicationInfo.h>
12 #include <ilog/TLoggerCompWrap.h>
13 #include <iqt/iqt.h>
14 
15 
16 namespace iqt
17 {
18 
19 
27  virtual public ifile::IFilePersistence
28 {
29 public:
31 
32  I_BEGIN_COMPONENT(CSettingsSerializerComp);
33  I_REGISTER_INTERFACE(ifile::IFilePersistence);
34  I_ASSIGN(m_applicationInfoCompPtr, "ApplicationInfo", "Application info", true, "ApplicationInfo");
35  I_ASSIGN(m_rootKeyAttrPtr, "RootKey", "The root key in the file/registry for the serialized object", true, "Data");
36  I_ASSIGN(m_scopeAttrPtr, "Scope", "The scope for the settingsin the registry. 0 - User scope.\n1 - System scope", false, QSettings::UserScope);
37  I_END_COMPONENT;
38 
39  // reimplemented (ifile::IFilePersistence)
40  virtual bool IsOperationSupported(
41  const istd::IChangeable* dataObjectPtr,
42  const QString* filePathPtr = NULL,
43  int flags = -1,
44  bool beQuiet = true) const;
45  virtual int LoadFromFile(
46  istd::IChangeable& data,
47  const QString& filePath = QString(),
48  ibase::IProgressManager* progressManagerPtr = NULL) const;
49  virtual int SaveToFile(
50  const istd::IChangeable& data,
51  const QString& filePath = QString(),
52  ibase::IProgressManager* progressManagerPtr = NULL) const;
53 
54  // reimplemented (ifile::IFileTypeInfo)
55  virtual bool GetFileExtensions(QStringList& result, const istd::IChangeable* dataObjectPtr = NULL, int flags = -1, bool doAppend = false) const;
56  virtual QString GetTypeDescription(const QString* extensionPtr = NULL) const;
57 
58 private:
59  I_REF(ibase::IApplicationInfo, m_applicationInfoCompPtr);
60  I_ATTR(QByteArray, m_rootKeyAttrPtr);
61  I_ATTR(int, m_scopeAttrPtr);
62 };
63 
64 
65 } // namespace iqt
66 
67 
68 #endif // !iqt_CSettingsSerializerComp_included
69 
70 
virtual int SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const
This function saves data data to file filePath.
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 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.
virtual QString GetTypeDescription(const QString *extensionPtr=NULL) const
Get description of object type associated with single extension.
Wrapper provider of log-functionality for component based implementations.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
ilog::CLoggerComponentBase BaseClass
Store and load parameter as global settings.
This interface provides some information about the application.
#define NULL
Definition: istd.h:64
Interface providing loading and saving of data objects.
virtual int LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const
This function loads data data from file filePath.
Consume information about progress of some process.

© 2007-2017 Witold Gantzke and Kirill Lepskiy