CRegistryConsistInfoComp.h
Go to the documentation of this file.
1 #ifndef icmpstr_CRegistryConsistInfoComp_included
2 #define icmpstr_CRegistryConsistInfoComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QHash>
7 #include <QtGui/QIcon>
8 
10 #include <icomp/CComponentBase.h>
11 
14 
15 
16 namespace icmpstr
17 {
18 
19 
21  public QObject,
22  public icomp::CComponentBase,
23  virtual public IRegistryConsistInfo
24 {
25  Q_OBJECT
26 
27 public:
29 
30  enum MessageId
31  {
40  };
41 
42  I_BEGIN_COMPONENT(CRegistryConsistInfoComp);
43  I_REGISTER_INTERFACE(IRegistryConsistInfo);
44  I_ASSIGN(m_envManagerCompPtr, "EnvironmentManager", "Allows access to component environment information", true, "EnvironmentManager");
45  I_ASSIGN_TO(m_externalMetaInfoManagerCompPtr, m_envManagerCompPtr, false);
46  I_END_COMPONENT;
47 
48  // reimplemented (icmpstr::IRegistryConsistInfo)
49  virtual icomp::IRegistry::Ids GetCompatibleElements(
50  const icomp::IElementStaticInfo::Ids& interfaceNames,
51  const icomp::IRegistry& registry,
52  int queryFlags) const;
53  virtual bool IsRegistryValid(
54  const icomp::IRegistry& registry,
55  bool ignoreUndef,
56  bool allReasons,
57  ilog::IMessageConsumer* reasonConsumerPtr) const;
58  virtual bool IsElementValid(
59  const QByteArray& elementName,
60  const icomp::IRegistry& registry,
61  bool ignoreUndef,
62  bool allReasons,
63  ilog::IMessageConsumer* reasonConsumerPtr) const;
64  virtual bool IsElementWithInfoValid(
65  const QByteArray& elementName,
66  const icomp::IRegistry::ElementInfo& elementInfo,
67  const icomp::IComponentStaticInfo* metaInfoPtr,
68  const icomp::IRegistry& registry,
69  bool ignoreUndef,
70  bool allReasons,
71  ilog::IMessageConsumer* reasonConsumerPtr) const;
72  virtual bool IsAttributeValid(
73  const QByteArray& attributeName,
74  const QByteArray& elementName,
75  const icomp::IRegistry& registry,
76  bool ignoreUndef,
77  bool allReasons,
78  ilog::IMessageConsumer* reasonConsumerPtr,
79  const icomp::IComponentStaticInfo* componentMetaInfoPtr = NULL) const;
80  virtual bool IsAttributeValueValid(
81  int attributeFlags,
82  const QByteArray& attributeText,
83  const icomp::IElementStaticInfo::Ids& interfaceNames,
84  const icomp::IElementStaticInfo::Ids& optionalInterfaceNames,
85  const icomp::IRegistry& registry,
86  bool ignoreUndef,
87  ilog::IMessageConsumer* reasonConsumerPtr) const;
88  virtual QIcon GetComponentIcon(const icomp::CComponentAddress& address) const;
89 
90  static bool AreTypesCompatible(const QByteArray& metaTypeId, const QByteArray& typeId);
91 
92 protected:
99  icomp::IRegistry::Ids GetCompatibleIds(
100  const QByteArray& elementId,
101  const icomp::IElementStaticInfo& elementStaticInfo,
102  const icomp::IElementStaticInfo::Ids& interfaceNames,
103  int queryFlags) const;
105  const iser::IObject& attribute,
106  const icomp::IAttributeStaticInfo& attributeMetaInfo,
107  const QByteArray& attributeName,
108  const QByteArray& elementName,
109  const icomp::IRegistry& registry,
110  bool ignoreUndef,
111  bool allReasons,
112  ilog::IMessageConsumer* reasonConsumerPtr) const;
114  int attributeFlags,
115  const QByteArray& pointedElementName,
116  const icomp::IElementStaticInfo::Ids& interfaceNames,
117  const icomp::IElementStaticInfo::Ids& optionalInterfaceNames,
118  const icomp::IRegistry& registry,
119  bool ignoreUndef,
120  const QString& messagePrefix,
121  ilog::IMessageConsumer* reasonConsumerPtr) const;
123  const QByteArray& pointedElementName,
124  const icomp::IElementStaticInfo* pointedMetaInfoPtr,
125  const icomp::IElementStaticInfo::Ids& interfaceNames,
126  const icomp::IElementStaticInfo::Ids& optionalInterfaceNames,
127  bool ignoreUndef,
128  const QString& messagePrefix,
129  ilog::IMessageConsumer* reasonConsumerPtr) const;
130 
131 private:
132  I_REF(icomp::IComponentEnvironmentManager, m_envManagerCompPtr);
133  I_REF(IExternalMetaInfoManager, m_externalMetaInfoManagerCompPtr);
134 
135  typedef QMap<icomp::CComponentAddress, QIcon> IconCache;
136  mutable IconCache m_iconCache;
137 };
138 
139 
140 } // namespace icmpstr
141 
142 
143 #endif // !icmpstr_CRegistryConsistInfoComp_included
144 
145 
virtual QIcon GetComponentIcon(const icomp::CComponentAddress &address) const
Get icon of component.
icomp::IRegistry::Ids GetCompatibleIds(const QByteArray &elementId, const icomp::IElementStaticInfo &elementStaticInfo, const icomp::IElementStaticInfo::Ids &interfaceNames, int queryFlags) const
Get list of compatible element ID's.
bool CheckAttributeCompatibility(const iser::IObject &attribute, const icomp::IAttributeStaticInfo &attributeMetaInfo, const QByteArray &attributeName, const QByteArray &elementName, const icomp::IRegistry &registry, bool ignoreUndef, bool allReasons, ilog::IMessageConsumer *reasonConsumerPtr) const
static bool AreTypesCompatible(const QByteArray &metaTypeId, const QByteArray &typeId)
virtual bool IsElementValid(const QByteArray &elementName, const icomp::IRegistry &registry, bool ignoreUndef, bool allReasons, ilog::IMessageConsumer *reasonConsumerPtr) const
Check if element is valid.
virtual bool IsAttributeValid(const QByteArray &attributeName, const QByteArray &elementName, const icomp::IRegistry &registry, bool ignoreUndef, bool allReasons, ilog::IMessageConsumer *reasonConsumerPtr, const icomp::IComponentStaticInfo *componentMetaInfoPtr=NULL) const
Check if attribute is valid.
bool CheckPointedElementInfoCompatibility(const QByteArray &pointedElementName, const icomp::IElementStaticInfo *pointedMetaInfoPtr, const icomp::IElementStaticInfo::Ids &interfaceNames, const icomp::IElementStaticInfo::Ids &optionalInterfaceNames, bool ignoreUndef, const QString &messagePrefix, ilog::IMessageConsumer *reasonConsumerPtr) const
virtual bool IsRegistryValid(const icomp::IRegistry &registry, bool ignoreUndef, bool allReasons, ilog::IMessageConsumer *reasonConsumerPtr) const
Check if registry is valid.
virtual bool IsAttributeValueValid(int attributeFlags, const QByteArray &attributeText, const icomp::IElementStaticInfo::Ids &interfaceNames, const icomp::IElementStaticInfo::Ids &optionalInterfaceNames, const icomp::IRegistry &registry, bool ignoreUndef, ilog::IMessageConsumer *reasonConsumerPtr) const
Check if attribute is valid.
virtual bool IsElementWithInfoValid(const QByteArray &elementName, const icomp::IRegistry::ElementInfo &elementInfo, const icomp::IComponentStaticInfo *metaInfoPtr, const icomp::IRegistry &registry, bool ignoreUndef, bool allReasons, ilog::IMessageConsumer *reasonConsumerPtr) const
virtual icomp::IRegistry::Ids GetCompatibleElements(const icomp::IElementStaticInfo::Ids &interfaceNames, const icomp::IRegistry &registry, int queryFlags) const
Get list of compatible element names.
bool CheckPointedElementCompatibility(int attributeFlags, const QByteArray &pointedElementName, const icomp::IElementStaticInfo::Ids &interfaceNames, const icomp::IElementStaticInfo::Ids &optionalInterfaceNames, const icomp::IRegistry &registry, bool ignoreUndef, const QString &messagePrefix, ilog::IMessageConsumer *reasonConsumerPtr) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy