kmahjongg
Editor.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 1997 Mathias Mueller <in5y158@public.uni-hamburg.de> 00003 Copyright (C) 2006 Mauricio Piacentini <mauricio@tabuleiro.com> 00004 00005 Kmahjongg is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _EditorLoadBase_H 00021 #define _EditorLoadBase_H 00022 00023 #include <kdialog.h> 00024 #include <qframe.h> 00025 #include <ktoolbar.h> 00026 #include <kstatusbar.h> 00027 #include <kfiledialog.h> 00028 00029 #include "kmahjonggtileset.h" 00030 #include "kmahjonggbackground.h" 00031 #include "BoardLayout.h" 00032 00033 #include "FrameImage.h" 00034 00035 00036 class QLabel; 00037 class KActionCollection; 00038 class QLabel; 00039 00047 class Editor: public KDialog 00048 { 00049 Q_OBJECT 00050 00051 public: 00054 explicit Editor ( QWidget* parent = 0); 00057 virtual ~Editor(); 00058 00059 protected slots: 00062 void drawFrameMousePressEvent ( QMouseEvent* ); 00065 void drawFrameMouseMovedEvent ( QMouseEvent *); 00068 void loadBoard(); 00074 bool saveBoard(); 00077 void newBoard(); 00080 void slotShiftLeft(); 00083 void slotShiftRight(); 00086 void slotShiftUp(); 00089 void slotShiftDown(); 00092 void slotModeChanged(QAction*); 00095 protected: 00098 enum { 00099 remove=98, 00100 insert=99, 00101 move=100 00102 }; 00105 void resizeEvent ( QResizeEvent * event ); 00108 void paintEvent( QPaintEvent* pa ); 00111 void setupToolbar(); 00114 void drawBackground(QPixmap *to); 00117 void drawTiles(QPixmap *to); 00124 bool testSave(); 00127 void transformPointToPosition(const QPoint &, POSITION &, bool align); 00133 void drawCursor(POSITION &p, bool visible); 00141 bool canInsert(POSITION &p); 00144 void statusChanged(); 00147 QString statusText(); 00148 private: 00149 int mode; 00150 int numTiles; 00151 KToolBar *topToolbar; 00152 KActionCollection* actionCollection; 00153 FrameImage * drawFrame; 00154 KMahjonggTileset tiles; 00155 BoardLayout theBoard; 00156 bool clean; 00157 POSITION currPos; 00158 QLabel *theLabel; 00159 }; 00160 00161 #endif
KDE 4.2 API Reference