1 /*************************************************************************** 2 * Copyright (C) 2004-2007 by Albert Astals Cid * 3 * aacid@kde.org * 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 11 #ifndef KGEOGRAPHY_H 12 #define KGEOGRAPHY_H 13 14 #include <kxmlguiwindow.h> 15 16 class KToggleAction; 17 18 class QLabel; 19 class QPushButton; 20 class QVBoxLayout; 21 22 class KGmap; 23 class askWidget; 24 25 class kgeography : public KXmlGuiWindow 26 { 27 Q_OBJECT 28 public: 29 kgeography(); 30 ~kgeography(); 31 32 protected: 33 void showEvent(QShowEvent *e) override; 34 35 private slots: 36 void openMap(); 37 38 void consult(); 39 void askCapitalDivisions(); 40 void askDivisionCapitals(); 41 void askMap(); 42 void askPlaceMap(); 43 void askFlagDivisions(); 44 void askDivisionFlags(); 45 void disclaimer(); 46 void showMapAuthor(); 47 void resizeMainWindow(); 48 void questionsEnded(); 49 50 void setAutomaticZoom(bool b); 51 void setMoveActionEnabled(bool b); 52 53 void showPreferencesDialog(); 54 void updateConfiguration(); 55 56 private: 57 QSize getPreferredSize(); 58 void showResultsDialog(); 59 60 void putAskWidget(); 61 void removeOldAskWidget(); 62 void setMap(KGmap *m); 63 64 int askQuestionNumber(int upto, bool *rOK); 65 66 67 QWidget *p_bigWidget; 68 QWidget *p_underLeftWidget; 69 70 QPushButton *p_consult; 71 QPushButton *p_askCapitalDivisions; 72 QPushButton *p_askDivisionCapitals; 73 QPushButton *p_askMap; 74 QPushButton *p_askPlaceMap; 75 QPushButton *p_askFlagDivisions; 76 QPushButton *p_askDivisionFlags; 77 KToggleAction *p_zoom; 78 KToggleAction *p_move; 79 KToggleAction *p_zoomAutomatic; 80 QAction *p_zoomOriginal; 81 QAction *p_showAuthor; 82 QLabel *p_currentMap; 83 84 KGmap *p_map; 85 askWidget *p_askWidget; 86 bool p_firstShow, p_mustShowResultsDialog; 87 88 QVBoxLayout *m_underLeftWidgetLayout; 89 }; 90 91 #endif 92