CMessageBoxComp.h
Go to the documentation of this file.
1 #ifndef iloggui_CMessageBoxComp_included
2 #define iloggui_CMessageBoxComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QObject>
7 #include <QtCore/QMutex>
8 #include <QtCore/QVector>
9 #include <QtGui/QIcon>
10 #if QT_VERSION >= 0x050000
11 #include <QtWidgets/QMessageBox>
12 #else
13 #include <QtGui/QMessageBox>
14 #endif
15 
16 // ACF includes
17 #include <icomp/CComponentBase.h>
18 #include <ilog/IMessageConsumer.h>
19 #include <ilog/CMessage.h>
20 
21 
22 namespace iloggui
23 {
24 
25 
30  public QObject,
31  public icomp::CComponentBase,
32  virtual public ilog::IMessageConsumer
33 {
34  Q_OBJECT
35 
36 public:
38 
39  I_BEGIN_COMPONENT(CMessageBoxComp);
40  I_REGISTER_INTERFACE(ilog::IMessageConsumer);
41  I_END_COMPONENT;
42 
44 
45  // reimplemented (ilog::IMessageConsumer)
46  virtual bool IsMessageSupported(
47  int messageCategory = -1,
48  int messageId = -1,
49  const istd::IInformationProvider* messagePtr = NULL) const;
50  virtual void AddMessage(const MessagePtr& messagePtr);
51 
52 protected:
56  QIcon GetCategoryIcon(int category) const;
57 
58  // reimplemented (icomp::CComponentBase)
59  virtual void OnComponentCreated();
60 
61 private:
62  void CreateMessageText(QString& messageText, QString& detailedText, QIcon& statusIcon) const;
63 
64 protected Q_SLOTS:
65  virtual void OnAddMessage();
66 
67 Q_SIGNALS:
68  void EmitAddMessage();
69 
70 private:
71  QMessageBox m_messageBox;
72  QMutex m_messageQueueMutex;
73 
74  QVector<ilog::CMessage> m_messageQueue;
75 };
76 
77 
78 } // namespace iloggui
79 
80 
81 #endif // !iloggui_CMessageBoxComp_included
82 
83 
Base class for component implementation.
virtual void AddMessage(const MessagePtr &messagePtr)
Adds a message item to the container.
virtual void OnComponentCreated()
Implementation of a smart pointer.
Definition: TSmartPtr.h:24
virtual void OnAddMessage()
#define NULL
Definition: istd.h:64
Common interface for a message container consuming information objects (messages).
Common interface for class providing some basic information object.
virtual bool IsMessageSupported(int messageCategory=-1, int messageId=-1, const istd::IInformationProvider *messagePtr=NULL) const
Check if some messge is supported.
icomp::CComponentBase BaseClass
QIcon GetCategoryIcon(int category) const
Get icons corresponding to specified information category.
Message container displaying messages as log list.

© 2007-2017 Witold Gantzke and Kirill Lepskiy