/pitchscene.h

http://cutefootball.googlecode.com/ · C Header · 52 lines · 25 code · 8 blank · 19 comment · 0 complexity · 79282b62aea95923ab226185651798f5 MD5 · raw file

  1. /*
  2. * Copyright 2010,2011 Timothy Rochford
  3. *
  4. * This file is part of CuteFootball.
  5. *
  6. * CuteFootball is free software: you can redistribute it and/or modify
  7. * it under the terms of the Lesser GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * CuteFootball is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * Lesser GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the Lesser GNU General Public License
  17. * along with CuteFootball. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef PITCHSCENE_H
  21. #define PITCHSCENE_H
  22. #include <QGraphicsScene>
  23. #include "settingsFrame.h"
  24. class QTimer;
  25. class Pitch;
  26. class PitchScene : public QGraphicsScene
  27. {
  28. Q_OBJECT;
  29. public:
  30. explicit PitchScene(const QRectF& footballGroundRect,
  31. Pitch* pitch,
  32. QObject *parent = 0);
  33. virtual ~PitchScene();
  34. public slots:
  35. void setInputMethod(settingsFrame::InputMethod method) { m_inputMethod = method; }
  36. private:
  37. void mousePressEvent(QGraphicsSceneMouseEvent *e);
  38. private:
  39. Pitch* m_pitch;
  40. settingsFrame::InputMethod m_inputMethod;
  41. QTimer* m_doubleTapTimer;
  42. QPointF m_lastTapPoint;
  43. };
  44. #endif // PITCHSCENE_H