00001 // This may look like C code, but it's really -*- C++ -*- 00002 /* 00003 * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium 00004 * 00005 * See the LICENSE file for terms of use. 00006 */ 00007 00008 #ifndef HANGMAN_WIDGET_H_ 00009 #define HANGMAN_WIDGET_H_ 00010 00011 #include <vector> 00012 00013 #include <Wt/WContainerWidget> 00014 00015 #include "Dictionary.h" 00016 00017 namespace Wt { 00018 class WText; 00019 class WPushButton; 00020 } 00021 00022 class Session; 00023 class WordWidget; 00024 class ImagesWidget; 00025 class LettersWidget; 00026 00027 class HangmanWidget: public Wt::WContainerWidget 00028 { 00029 public: 00030 HangmanWidget(const std::string &name, 00031 Dictionary dictionary, 00032 Wt::WContainerWidget *parent = 0); 00033 00034 Wt::Signal<int>& updateScore() { return updateScore_; } 00035 00036 private: 00037 Wt::WText *title_; 00038 00039 WordWidget *word_; 00040 ImagesWidget *images_; 00041 LettersWidget *letters_; 00042 00043 Wt::WText *statusText_; 00044 Wt::WPushButton *newGameButton_; 00045 00046 Wt::Signal<int> updateScore_; 00047 00048 std::string name_; 00049 Dictionary dictionary_; 00050 00051 void registerGuess(char c); 00052 00053 void newGame(); 00054 }; 00055 00056 #endif //HANGMAN_WIDGET_H_
1.7.2