PopupChatWidget.h 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // This may look like C code, but it's really -*- C++ -*-
  2. /*
  3. * Copyright (C) 2008 Emweb bvba, Heverlee, Belgium.
  4. *
  5. * See the LICENSE file for terms of use.
  6. */
  7. #ifndef POPUP_CHATWIDGET_H_
  8. #define POPUP_CHATWIDGET_H_
  9. #include "SimpleChatWidget.h"
  10. /**
  11. * \defgroup chatexample Chat example
  12. */
  13. /*@{*/
  14. /*! \brief A popup chat widget.
  15. */
  16. class PopupChatWidget : public SimpleChatWidget
  17. {
  18. public:
  19. PopupChatWidget(SimpleChatServer& server, const std::string& id);
  20. void setName(const Wt::WString& name);
  21. protected:
  22. virtual void createLayout(Wt::WWidget *messages, Wt::WWidget *userList,
  23. Wt::WWidget *messageEdit,
  24. Wt::WWidget *sendButton, Wt::WWidget *logoutButton);
  25. virtual void updateUsers();
  26. virtual void newMessage();
  27. private:
  28. Wt::WString name_;
  29. Wt::WText *title_;
  30. Wt::WWidget *bar_;
  31. bool online_, minimized_;
  32. int missedMessages_;
  33. void toggleSize();
  34. void goOnline();
  35. bool minimized() const;
  36. Wt::WContainerWidget *createBar();
  37. };
  38. /*@}*/
  39. #endif // POPUP_CHATWIDGET_H_