YAPOG  0.0.1
Yet Another Pokemon Online Game
ChatWidget.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_CLIENT_CHATWIDGET_HPP
2 # define YAPOG_CLIENT_CHATWIDGET_HPP
3 
4 # include "YAPOG/Macros.hpp"
6 # include "YAPOG/System/String.hpp"
10 
18 
20 
21 namespace yap
22 {
23  class Chat;
24  class GameMessage;
25 }
26 
27 namespace ycl
28 {
30  class ChatWidget : public yap::BaseWidget
31  {
33 
34  public:
35  ChatWidget (const yap::String& userLogin);
36  virtual ~ChatWidget();
37 
38  void Init ();
39  virtual bool IsFocusable () const;
40 
41  void AddMessage (const yap::GameMessage& message);
42 
45 
46  protected:
47  virtual yap::Vector2 HandleGetSize () const;
48  virtual void HandleMove (const yap::Vector2& offset);
49  virtual void HandleScale (const yap::Vector2& factor);
50 
51  virtual void HandleDraw (yap::IDrawingContext& context);
52  virtual bool HandleOnEvent (const yap::GuiEvent& guiEvent);
53  virtual bool HandleOnPriorityEvent (const yap::GuiEvent& guiEvent);
54 
55  virtual void HandleShow (bool isVisible);
56  virtual void HandleChangeColor (const sf::Color& color);
57 
58  virtual void HandleUpdate (const yap::Time& dt);
59 
60  private:
61  void InitTab ();
62  void InitDial ();
63  void InitEntry ();
64  void DisplayResponse (yap::ResponseType response);
65  bool TestAddChan (const yap::GuiEvent& guiEvent);
66  bool TestSwitchTab (const yap::GuiEvent& guiEvent);
67  bool TabAndChanHandler (bool chan, bool add, int i);
68 
79  };
80 } // namespace ycl
81 
82 #endif // YAPOG_CLIENT_CHATWIDGET_HPP