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