HangmanWidget.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // This may look like C code, but it's really -*- C++ -*-
  2. /*
  3. * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium
  4. *
  5. * See the LICENSE file for terms of use.
  6. */
  7. #ifndef HANGMAN_WIDGET_H_
  8. #define HANGMAN_WIDGET_H_
  9. #include <vector>
  10. #include <Wt/WContainerWidget>
  11. class Session;
  12. class WordWidget;
  13. class ImagesWidget;
  14. class LettersWidget;
  15. class HangmanWidget: public Wt::WContainerWidget
  16. {
  17. public:
  18. HangmanWidget(const std::string &name, Wt::WContainerWidget *parent = 0);
  19. Wt::Signal<int>& scoreUpdated() { return scoreUpdated_; }
  20. private:
  21. Wt::WText *title_;
  22. WordWidget *word_;
  23. ImagesWidget *images_;
  24. LettersWidget *letters_;
  25. Wt::WText *statusText_;
  26. Wt::WComboBox *language_;
  27. Wt::WPushButton *newGameButton_;
  28. Wt::Signal<int> scoreUpdated_;
  29. std::string name_;
  30. int badGuesses_;
  31. void registerGuess(char c);
  32. void newGame();
  33. };
  34. #endif //HANGMAN_WIDGET_H_