File indexing completed on 2024-04-28 07:29:12
0001 /*************************************************************************** 0002 * Copyright (C) 2004-2007 by Albert Astals Cid * 0003 * aacid@kde.org * 0004 * Copyright (C) 2006 by Isaac Clerencia * 0005 * isaac@warp.es * 0006 * * 0007 * This program is free software; you can redistribute it and/or modify * 0008 * it under the terms of the GNU General Public License as published by * 0009 * the Free Software Foundation; either version 2 of the License, or * 0010 * (at your option) any later version. * 0011 ***************************************************************************/ 0012 0013 #ifndef PLACEASKER_H 0014 #define PLACEASKER_H 0015 0016 #include "askwidget.h" 0017 #include "popupmanager.h" 0018 0019 class QLabel; 0020 class QSize; 0021 0022 class infoWidget; 0023 class placeMapWidget; 0024 0025 class placeAsker : public askWidget 0026 { 0027 Q_OBJECT 0028 public: 0029 placeAsker(QWidget *parent, KGmap *m, QWidget *w, uint count = 0); 0030 ~placeAsker(); 0031 0032 QSize mapSize() const; 0033 bool isAsker() const; 0034 0035 protected: 0036 void nextQuestionHook(const division *div) override; 0037 void mousePressEvent(QMouseEvent *e) override; 0038 QString getQuestionHook() const override; 0039 division::askMode askMode() const override { return division::eClick; } 0040 0041 public Q_SLOTS: 0042 void setMovement(bool b) override; 0043 void setZoom(bool b) override; 0044 void setOriginalZoom() override; 0045 void setAutomaticZoom(bool b) override; 0046 0047 private Q_SLOTS: 0048 void handleMapClick(QRgb c, const QPoint &, const QPointF &mapPoint); 0049 0050 private: 0051 void setCurrentDivision(const division *div); 0052 0053 QLabel *p_next; 0054 QWidget *p_fill; 0055 0056 infoWidget *p_infoWidget; 0057 placeMapWidget *p_mapWidget; 0058 0059 QImage *p_currentDivisionImage; 0060 QImage *p_mapImage; 0061 QRect p_currentDivisionRect; 0062 QRgb p_currentRgb; 0063 QVector<uchar> p_placedPixelIndices; 0064 }; 0065 0066 #endif