summaryrefslogtreecommitdiffstats
path: root/lskat/lskat/lskatview.h
blob: 20fe80a7819339dc114b6c02cf3ed9f40f5c6e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/***************************************************************************
                          lskatview.h  -  description
                             -------------------
    begin                : Tue May  2 15:47:11 CEST 2000
    copyright            : (C) 2000 by Martin Heni
    email                : martin@heni-online.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef LSKATVIEW_H
#define LSKATVIEW_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif 

#include <tqwidget.h>
#include <tqrect.h>
#include "lskat.h"

class LSkatDoc;

/** The LSkatView class provides the view widget for the LSkatApp instance.
 * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. As LSkatView is part of the
 * docuement-view model, it needs a reference to the document object connected with it by the LSkatApp class to manipulate and display
 * the document structure provided by the LSkatDoc class.
 * 
 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
 * @version KDevelop version 0.4 code generation
 */
class LSkatView : public TQWidget
{
  Q_OBJECT
  TQ_OBJECT
  public:
  /** Constructor for the main view */
  LSkatView(TQWidget *parent = 0, const char *name=0);

  /** returns a pointer to the document connected to the view instance. Mind that this method requires a LSkatApp instance as a parent
   * widget to get to the window document pointer by calling the LSkatApp::getDocument() method.
   *
   * @see LSkatApp#getDocument
   */
  LSkatDoc *getDocument() const;

  void paintEvent( TQPaintEvent * p);
  void Paint(TQPainter *p);
  void InitMove(int player,int x,int y);
  void updatetqStatus();

  protected:
  void drawDeck(TQPainter *p);
  void drawIntro(TQPainter *p);
  void drawMove(TQPainter *p);
  void drawtqStatus(TQPainter *p);
  void drawFinal(TQPainter *p);
  void drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode);
  TQPoint calcCardPos(int x,int y);

  void mousePressEvent ( TQMouseEvent *m );

  protected slots:
  void moveTimerReady();
  void introTimerReady();
  void drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts);


  private:
  TQRect status_rect1;
  TQRect status_rect2;
  TQRect status_rect3;
  TQTimer *moveTimer;
  TQTimer *introTimer;
  int introcnt;
  int cardmovecnt;
  int cardmovex,cardmovey;
  int cardmoveunder;
  TQPoint cardorigin;
  TQPoint cardend;
  int introCards[NO_OF_CARDS];

};

#endif // LSKATVIEW_H