CApplicationInfoComp.h
Go to the documentation of this file.
1 #ifndef ibase_CApplicationInfoComp_included
2 #define ibase_CApplicationInfoComp_included
3 
4 
5 #include <iser/IVersionInfo.h>
6 
7 #include <icomp/CComponentBase.h>
8 
10 
11 
12 namespace ibase
13 {
14 
15 
20  public icomp::CComponentBase,
21  virtual public ibase::IApplicationInfo,
22  virtual protected iser::IVersionInfo
23 {
24 public:
26 
27  I_BEGIN_COMPONENT(CApplicationInfoComp);
28  I_REGISTER_INTERFACE(ibase::IApplicationInfo);
29  I_ASSIGN(m_companyNameAttrPtr, "CompanyName", "Company name", false, "<my company>");
30  I_ASSIGN(m_productNameAttrPtr, "ProductName", "Product name, the same for all applications in one product", false, "<my product>");
31  I_ASSIGN(m_productEditionAttrPtr, "ProductEdition", "Product edition", false, "");
32  I_ASSIGN(m_applicationNameAttrPtr, "ApplicationName", "Application name", false, "ACF Application");
33  I_ASSIGN(m_applicationSubnameAttrPtr, "ApplicationSubname", "Sub-name of application", false, "");
34  I_ASSIGN(m_applicationTypeAttrPtr, "ApplicationType", "Application type", false, "Server");
35  I_ASSIGN(m_legalCopyrightAttrPtr, "LegalCopyright", "Legal copyright of this application", false, "\x00A9 xxxx <my company>");
36  I_ASSIGN(m_mainVersionIdAttrPtr, "MainVersionId", "ID of main module version as defined in version info", false, 0);
37  I_ASSIGN(m_versionInfoCompPtr, "VersionInfo", "Provide information about global application version and version of related packages", true, "VersionInfo");
38  I_END_COMPONENT;
39 
40  // reimplemented (ibase::IApplicationInfo)
41  virtual QString GetApplicationAttribute(int attributeId, bool allowTranslation = true) const;
42  virtual int GetMainVersionId() const;
43  virtual const iser::IVersionInfo& GetVersionInfo() const;
44 
45 protected:
46  // reimplemented (iser::IVersionInfo)
47  virtual bool GetVersionNumber(int versionId, quint32& result) const;
48  virtual QString GetVersionIdDescription(int versionId) const;
49  virtual VersionIds GetVersionIds() const;
50  virtual QString GetEncodedVersionName(int versionId, quint32 versionNumber) const;
51 
52 private:
53  I_TEXTATTR(m_companyNameAttrPtr);
54  I_TEXTATTR(m_productNameAttrPtr);
55  I_TEXTATTR(m_productEditionAttrPtr);
56  I_TEXTATTR(m_applicationNameAttrPtr);
57  I_TEXTATTR(m_applicationSubnameAttrPtr);
58  I_TEXTATTR(m_applicationTypeAttrPtr);
59  I_TEXTATTR(m_legalCopyrightAttrPtr);
60  I_ATTR(int, m_mainVersionIdAttrPtr);
61  I_REF(iser::IVersionInfo, m_versionInfoCompPtr);
62 };
63 
64 
65 } // namespace ibase
66 
67 
68 #endif // !ibase_CApplicationInfoComp_included
69 
70 
QSet< int > VersionIds
Definition: IVersionInfo.h:45
icomp::CComponentBase BaseClass
virtual const iser::IVersionInfo & GetVersionInfo() const
Get access to application version info.
Provides access to version information.
Definition: IVersionInfo.h:22
Base class for component implementation.
virtual QString GetVersionIdDescription(int versionId) const
Get description of version ID.
virtual int GetMainVersionId() const
Get ID of main module version ID for iser::IVersionInfo.
virtual QString GetApplicationAttribute(int attributeId, bool allowTranslation=true) const
Get value of application attribute.
This interface provides some information about the application.
Component for providing of application info such as program name, type, copyright text etc...
virtual QString GetEncodedVersionName(int versionId, quint32 versionNumber) const
Encode version number to human readable form.
virtual VersionIds GetVersionIds() const
Get list of version ID's.
virtual bool GetVersionNumber(int versionId, quint32 &result) const
Get version of archived stream for specific versioning type.

© 2007-2017 Witold Gantzke and Kirill Lepskiy