Debian Codegraph @

src/field.h

raw symbols SCIP
1 /***************************************************************************
2 * Copyright (C) 2002-2003 Andi Peredri *
3 * [email protected] *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21 #ifndef FIELD_H
22 #define FIELD_H
23
24 #include <QtWidgets>
25 #include <qpixmap.h>
26
27 #include "theme.h"
28
29
30 class Field : public QObject
31 {
32 Q_OBJECT
33
34 public:
35 Field(QObject*, int num);
36 ~Field();
37
38 //QSize sizeHint() const;
39 //void resizeEvent(QResizeEvent*);
40
41 const QString& label() const { return m_label; }
42 void setLabel(const QString&);
43 void showLabel(bool s, bool above);
44
45 void showFrame(bool);
46
47 void setTheme(Theme*);
48 void setPattern(int);
49 void set(int, bool);
50
51 int number() const { return m_number; }
52
53 int width() const {
54 const QPixmap& checker = m_theme->getMan1(true);
55 return checker.width();
56 }
57
58 int height() const {
59 const QPixmap& checker = m_theme->getMan1(true);
60 return checker.height();
61 }
62
63 void fontUpdate() { draw(); }
64
65 void beginSetup();
66 void endSetup();
67 void draw(QPainter&, QRect);
68 void invalidate();
69
70 const QRect& rect() const;
71
72 signals:
73 void click(int);
74
75 protected:
76
77 //void paintEvent(QPaintEvent*);
78 //void mousePressEvent(QMouseEvent*);
79
80 private:
81 void draw();
82 //void setPicture(QPixmap*);
83
84 int m_number;
85
86 // pixmap = pattern + label + picture + frame;
87
88 /*QPixmap* m_frame;
89 QPixmap* m_checker;
90 QPixmap* m_pattern;*/
91 int m_pattern_id;
92 int m_checker_id;
93 bool m_bottom_is_white;
94
95 QString m_label;
96 bool m_show_label;
97 bool m_show_above;
98
99 QPixmap* pixmap;
100 bool pixmap_valid;
101
102 bool show_frame;
103
104 bool setup_mode;
105 Theme* m_theme;
106 QRect m_rect;
107 };
108
109 #endif
110
111