CSelectableFileConverterComp.h
Go to the documentation of this file.
1 #ifndef ifileproc_CSelectableFileConverterComp_included
2 #define ifileproc_CSelectableFileConverterComp_included
3 
4 
5 // ACF includes
6 #include <icomp/CComponentBase.h>
7 
8 #include <iprm/ISelectionParam.h>
9 #include <iprm/IOptionsList.h>
10 
12 
13 
14 namespace ifileproc
15 {
16 
17 
19  public icomp::CComponentBase,
20  virtual public ifileproc::IFileConversion,
21  virtual public iprm::ISelectionParam,
22  virtual protected iprm::IOptionsList
23 {
24 public:
26 
27  I_BEGIN_COMPONENT(CSelectableFileConverterComp);
28  I_REGISTER_INTERFACE(ifileproc::IFileConversion);
29  I_REGISTER_INTERFACE(iprm::ISelectionParam);
30  I_REGISTER_INTERFACE(iser::ISerializable);
31  I_ASSIGN_MULTI_0(m_slaveConvertersCompPtr, "SlaveConverters", "List of the slave converters", true);
32  I_ASSIGN_MULTI_0(m_slaveConverterNamesAttrPtr, "SlaveConverterNames", "List of the converter names", true);
33  I_ASSIGN_MULTI_0(m_slaveConverterDescriptionsAttrPtr, "SlaveConverterDescriptions", "List of the converter's descriptions", true);
34  I_END_COMPONENT;
35 
37 
38  // reimplemented (ifileproc::IFileConversion)
39  virtual int ConvertFiles(
40  const QString& inputPath,
41  QString& outputPath,
42  const iprm::IParamsSet* paramsPtr = NULL,
43  ibase::IProgressManager* progressManagerPtr = NULL) const;
44 
45  // reimplemented (iprm::ISelectionParam)
46  virtual const IOptionsList* GetSelectionConstraints() const;
47  virtual int GetSelectedOptionIndex() const;
48  virtual bool SetSelectedOptionIndex(int index);
49  virtual ISelectionParam* GetSubselection(int index) const;
50 
51  // reimplemented (iser::ISerializable)
52  virtual bool Serialize(iser::IArchive& archive);
53 
54  // reimplemented (icomp::CComponentBase)
55  virtual void OnComponentCreated();
56 
57 protected:
58  // reimplemented (iprm::IOptionsList)
59  virtual int GetOptionsFlags() const;
60  virtual int GetOptionsCount() const;
61  virtual QString GetOptionName(int index) const;
62  virtual QString GetOptionDescription(int index) const;
63  virtual QByteArray GetOptionId(int index) const;
64  virtual bool IsOptionEnabled(int index) const;
65 
66 private:
67  I_MULTIREF(ifileproc::IFileConversion, m_slaveConvertersCompPtr);
68  I_MULTITEXTATTR(m_slaveConverterNamesAttrPtr);
69  I_MULTITEXTATTR(m_slaveConverterDescriptionsAttrPtr);
70 
71  int m_optionsCount;
72  int m_selectedOptionIndex;
73 };
74 
75 
76 } // namespace ifileproc
77 
78 
79 #endif // !ifileproc_CSelectableFileConverterComp_included
virtual const IOptionsList * GetSelectionConstraints() const
virtual int GetSelectedOptionIndex() const
virtual QString GetOptionName(int index) const
virtual QString GetOptionDescription(int index) const
virtual int ConvertFiles(const QString &inputPath, QString &outputPath, const iprm::IParamsSet *paramsPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) const
Copy a file or files from inputPath to destination outputPath.
virtual bool IsOptionEnabled(int index) const
virtual QByteArray GetOptionId(int index) const
virtual bool Serialize(iser::IArchive &archive)
virtual bool SetSelectedOptionIndex(int index)
virtual ISelectionParam * GetSubselection(int index) const
General interface for conversion of files.

© 2007-2017 Witold Gantzke and Kirill Lepskiy