CFileNamingParamsComp.h
Go to the documentation of this file.
1 #ifndef ifileproc_CFileNamingParamsComp_included
2 #define ifileproc_CFileNamingParamsComp_included
3 
4 
5 // Qt includes
6 #include <QStringList>
7 
8 // ACF includes
9 #include "icomp/CComponentBase.h"
10 
11 // AcfSln includes
13 
14 
15 namespace ifileproc
16 {
17 
18 
20  public icomp::CComponentBase,
21  virtual public ifileproc::IFileNamingParams
22 {
23 public:
25 
27 
28  I_BEGIN_COMPONENT(ifileproc::CFileNamingParamsComp);
29  I_REGISTER_INTERFACE(iser::ISerializable);
30  I_REGISTER_INTERFACE(ifileproc::IFileNamingParams);
31  I_ASSIGN(m_prefixAttrPtr, "Prefix", "Prefix attached to the output file name", true, "");
32  I_ASSIGN(m_suffixAttrPtr, "Suffix", "Suffix attached to the output file name", true, "");
33  I_ASSIGN(m_overwriteStrategyAttrPtr, "OverwriteStrategy", "Strategy for overwriting of existing files.\n0 - Overwrite existing file\n1 - Add auto generated numbered suffix to the output file name", true, 0);
34  I_ASSIGN_MULTI_0(m_patternsToRemoveAttrPtr, "PatternsToRemove", "List of patterns that will be removed from the output file name", false);
35  I_END_COMPONENT;
36 
37  // reimplemented (ifileproc::IFileNamingParams)
39  virtual void SetOverwriteStrategy(OverwriteStrategy overwriteStrategy);
40  virtual QString GetPrefix() const;
41  virtual void SetPrefix(const QString& prefix);
42  virtual QString GetSuffix() const;
43  virtual void SetSuffix(const QString& suffix);
44  virtual QStringList GetPatternsToRemove() const;
45  virtual void SetPatternsToRemove(const QStringList& patternsToRemove);
46 
47  // reimplemented (iser::ISerializable)
48  virtual bool Serialize(iser::IArchive& archive);
49 
50 protected:
51  // reimplemented (icomp::CComponentBase)
52  virtual void OnComponentCreated();
53 
54 private:
55  OverwriteStrategy m_overwriteStrategy;
56  QString m_suffix;
57  QString m_prefix;
58  QStringList m_patternsToRemove;
59 
60  I_ATTR(QString, m_prefixAttrPtr);
61  I_ATTR(QString, m_suffixAttrPtr);
62  I_ATTR(int, m_overwriteStrategyAttrPtr);
63  I_MULTIATTR(QString, m_patternsToRemoveAttrPtr);
64 };
65 
66 
67 } // namespace ifileproc
68 
69 
70 #endif // !ifileproc_CFileNamingParamsComp_included
71 
72 
virtual bool Serialize(iser::IArchive &archive)
virtual void SetPrefix(const QString &prefix)
Set prefix of the file.
virtual QString GetSuffix() const
Set suffix of the file.
virtual QStringList GetPatternsToRemove() const
Get list of text patterns, that must be removed from the output file name.
virtual void SetPatternsToRemove(const QStringList &patternsToRemove)
Set list of text patterns, that must be removed from the output file name.
virtual QString GetPrefix() const
Get prefix of the file.
virtual OverwriteStrategy GetOverwriteStrategy() const
Get used strategy for possible overwriting of existing files.
virtual void SetOverwriteStrategy(OverwriteStrategy overwriteStrategy)
Interface for calculation parameters of the new file name for any file item.
virtual void SetSuffix(const QString &suffix)
Get suffix of the file.

© 2007-2011 Witold Gantzke and Kirill Lepskiy