SVN_SILENT made messages (.desktop file)
[kdegames.git] / kmahjongg / Editor.h
blobfc0f0a3166e693bed89bb7b8e70ca925946a93e4
1 /*
2 Copyright (C) 1997 Mathias Mueller <in5y158@public.uni-hamburg.de>
3 Copyright (C) 2006 Mauricio Piacentini <mauricio@tabuleiro.com>
5 Kmahjongg 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.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef _EditorLoadBase_H
21 #define _EditorLoadBase_H
23 #include <kdialog.h>
24 #include <qframe.h>
25 #include <ktoolbar.h>
26 #include <kstatusbar.h>
27 #include <kfiledialog.h>
29 #include "kmahjonggtileset.h"
30 #include "kmahjonggbackground.h"
31 #include "BoardLayout.h"
33 #include "FrameImage.h"
36 class QLabel;
37 class KActionCollection;
38 class QLabel;
40 /**
41 * @short This class implements
43 * longer description
45 * @author Mauricio Piacentini <mauricio@tabuleiro.com>
47 class Editor: public KDialog
49 Q_OBJECT
51 public:
52 /**
53 * Constructor Description @param parent */
54 explicit Editor ( QWidget* parent = 0);
55 /**
56 * Default Destructor */
57 virtual ~Editor();
59 protected slots:
60 /**
61 * Slot Description */
62 void drawFrameMousePressEvent ( QMouseEvent* );
63 /**
64 * Slot Description */
65 void drawFrameMouseMovedEvent ( QMouseEvent *);
66 /**
67 * Slot Description */
68 void loadBoard();
69 /**
70 * Slot Description
71 * @return @c true if ...
72 * @return @c false if ...
74 bool saveBoard();
75 /**
76 * Slot Description */
77 void newBoard();
78 /**
79 * Slot Description */
80 void slotShiftLeft();
81 /**
82 * Slot Description */
83 void slotShiftRight();
84 /**
85 * Slot Description */
86 void slotShiftUp();
87 /**
88 * Slot Description */
89 void slotShiftDown();
90 /**
91 * Slot Description */
92 void slotModeChanged(QAction*);
93 /**
94 * Slot Description */
95 protected:
96 /** @short Describe enum
98 enum {
99 remove=98, /**< describe*/
100 insert=99, /**< describe*/
101 move=100 /**< describe*/
104 * Method Description */
105 void resizeEvent ( QResizeEvent * event );
107 * Method Description */
108 void paintEvent( QPaintEvent* pa );
110 * Method Description */
111 void setupToolbar();
113 * Method Description */
114 void drawBackground(QPixmap *to);
116 * Method Description @param to destination QPixmap to draw to */
117 void drawTiles(QPixmap *to);
119 * Method Description
121 * @return @c true if
122 * @return @c false if
124 bool testSave();
126 * Method Description */
127 void transformPointToPosition(const QPoint &, POSITION &, bool align);
129 * Method Description
130 @param p @ref pos
131 @param visible
133 void drawCursor(POSITION &p, bool visible);
135 * Method Description
137 * @param p @ref pos
138 * @return @c true if
139 * @return @c false if
141 bool canInsert(POSITION &p);
143 * Method Description */
144 void statusChanged();
146 * Method Description @return status description */
147 QString statusText();
148 private:
149 int mode;
150 int numTiles;
151 KToolBar *topToolbar;
152 KActionCollection* actionCollection;
153 FrameImage * drawFrame;
154 KMahjonggTileset tiles;
155 BoardLayout theBoard;
156 bool clean;
157 POSITION currPos;
158 QLabel *theLabel;
161 #endif