1/* Copyright (C) 1997 Mathias Mueller <in5y158@public.uni-hamburg.de>
2 * Copyright (C) 2006 Mauricio Piacentini <mauricio@tabuleiro.com>
3 *
4 * Kmahjongg is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
17
18#ifndef FRAMEIMAGE_H
19#define FRAMEIMAGE_H
20
21#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
22#include <libkdegamesprivate/kgamecanvas.h>
23
24#include "kmahjonggtileset.h"
25#include "kmahjonggbackground.h"
26#include "BoardLayout.h"
27
28#include <qframe.h>
29
30#include <kdialog.h>
31
32
33class QComboBox;
34class QPixmap;
35
36/**
37 * @short This class implements
38 *
39 * longer description
40 *
41 * @author Mauricio Piacentini <mauricio@tabuleiro.com> */
42class FrameImage: public KGameCanvasWidget
43{
44 Q_OBJECT
45
46public:
47 /**
48 * Constructor
49 *
50 * @param parent
51 * @param initialImageSize */
52 FrameImage(QWidget *parent, const QSize &initialImageSize);
53
54 /**
55 * Default Destructor */
56 ~FrameImage();
57
58 /**
59 * Method Description
60 *
61 * @return QPixmap */
62 QPixmap* getPreviewPixmap() {return thePixmap;}
63
64 /**
65 * Method Description
66 *
67 * @param x
68 * @param y
69 * @param w
70 * @param h
71 * @param ss
72 * @param type */
73 void setRect(int x, int y, int w, int h, int ss, int type);
74
75signals:
76 /**
77 * Signal Description */
78 void mousePressed(QMouseEvent *e);
79
80 /**
81 * Signal Description */
82 void mouseMoved(QMouseEvent *e);
83
84protected:
85 /**
86 * Event Description */
87 void mousePressEvent(QMouseEvent *e);
88
89 /**
90 * Event Description */
91 void mouseMoveEvent(QMouseEvent *e);
92
93 /**
94 * Event Description */
95 void resizeEvent(QResizeEvent *e);
96
97 /**
98 * Event Description */
99 void paintEvent( QPaintEvent* pa );
100
101private:
102 int rx;
103 int ry;
104 int rw;
105 int rh;
106 int rs;
107 int rt;
108
109 QPixmap *thePixmap;
110};
111
112
113#endif
114