Warning, file /education/marble/src/apps/marble-kde/marble_part.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe@kde.org> 0004 // SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se> 0005 // SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <jensmh@gmx.de> 0006 // SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com> 0007 // 0008 0009 #ifndef MARBLE_MARBLEPART_H 0010 #define MARBLE_MARBLEPART_H 0011 0012 #include <kparts/readonlypart.h> 0013 #include <QHash> 0014 #include "MarbleGlobal.h" 0015 #include <KRecentFilesAction> 0016 #include <QDomNode> 0017 0018 #include "ui_MarbleCloudSyncSettingsWidget.h" 0019 0020 class KAboutData; 0021 class QAction; 0022 class KToggleAction; 0023 class KConfigDialog; 0024 class KToolBar; 0025 0026 class QLabel; 0027 class QProgressBar; 0028 0029 namespace KParts 0030 { 0031 class StatusBarExtension; 0032 } 0033 0034 namespace Marble 0035 { 0036 0037 class MovieCaptureDialog; 0038 class ControlView; 0039 class DownloadRegionDialog; 0040 class SunControlWidget; 0041 class TimeControlWidget; 0042 class GeoDataFolder; 0043 0044 class MarblePart: public KParts::ReadOnlyPart 0045 { 0046 Q_OBJECT 0047 0048 public: 0049 MarblePart( QWidget *parentWidget, QObject *parent, const QVariantList& ); 0050 ~MarblePart() override; 0051 0052 ControlView *controlView() const; 0053 0054 static KAboutData* createAboutData(); 0055 void createInfoBoxesMenu(); 0056 void createOnlineServicesMenu(); 0057 void createRenderPluginActions(); 0058 0059 void readTrackingSettings(); 0060 0061 void initializeCustomTimezone(); 0062 0063 public Q_SLOTS: 0064 bool openUrl( const QUrl &url ) override; 0065 bool openFile() override; 0066 void showPosition( const QString& position); 0067 void showZoomLevel( const int ); 0068 void showDateTime(); 0069 void mapThemeChanged( const QString& newMapTheme ); 0070 void createPluginMenus(); 0071 void createFolderList(); 0072 void fallBackToDefaultTheme(); 0073 0074 private Q_SLOTS: 0075 void exportMapScreenShot(); 0076 void printMapScreenShot(); 0077 void copyMap(); 0078 void copyCoordinates(); 0079 void setShowClouds( bool ); 0080 void setShowBookmarks( bool isChecked ); 0081 void showFullScreen( bool ); 0082 void showStatusBar( bool ); 0083 void changeRecordingState(); 0084 0085 /** 0086 * @brief Show the dateTime label in the status bar. 0087 * This slot is connected with the "triggered" signal of 0088 * m_showDateTimeAction. 0089 */ 0090 void showDateTimeLabel( bool isChecked ); 0091 0092 /** 0093 * @brief Show the position label in the status bar. 0094 * This slot is connected with the "triggered" signal of 0095 * m_showPositionAction. 0096 */ 0097 void showPositionLabel( bool isChecked ); 0098 0099 /** 0100 * @brief Show the altitude label in the status bar. 0101 * This slot is connected with the "triggered" signal of 0102 * m_showAltitudeAction. 0103 */ 0104 void showAltitudeLabel( bool isChecked ); 0105 0106 /** 0107 * @brief Show the tile zoom level label in the status bar. 0108 * This slot is connected with the "triggered" signal of 0109 * m_showTileZoomLevelAction. 0110 */ 0111 void showTileZoomLevelLabel( bool isChecked ); 0112 0113 /** 0114 * @brief Show the download progress bar in the status bar. 0115 * This slot is connected with the "triggered" signal of 0116 * m_showDownloadProgressAction. 0117 */ 0118 void showDownloadProgressBar( bool isChecked ); 0119 0120 void handleProgress( int active, int queued); 0121 void removeProgressItem(); 0122 0123 void lockFloatItemPosition( bool ); 0124 void controlSun(); 0125 void controlTime(); 0126 void showSun( bool ); 0127 void lockToSubSolarPoint( bool ); 0128 void setSubSolarPointIconVisible( bool ); 0129 void workOffline( bool ); 0130 0131 void setupStatusBar(); 0132 void showNewStuffDialog(); 0133 void showDownloadRegionDialog(); 0134 void downloadRegion(); 0135 void showStatusBarContextMenu( const QPoint& pos ); 0136 void showMapWizard(); 0137 0138 void editSettings(); 0139 0140 void enableApplyButton(); 0141 void applyPluginState(); 0142 0143 void updateSettings(); 0144 0145 void updateStatusBar(); 0146 0147 void updateCloudSyncStatus(const QString &status); 0148 0149 /** 0150 * Saves the settings of all plugins. 0151 */ 0152 void writePluginSettings(); 0153 0154 /** 0155 * Reads the settings of all plugins. 0156 */ 0157 void readPluginSettings(); 0158 0159 //Bookmark Menu 0160 void openEditBookmarkDialog(); 0161 void setHome(); 0162 void openManageBookmarksDialog(); 0163 void createBookmarksListMenu( QMenu *, const GeoDataFolder& ); 0164 void lookAtBookmark( QAction * ); 0165 // void createBookmarkMenu(); 0166 0167 void updateMapEditButtonVisibility( const QString &mapTheme ); 0168 void showMovieCaptureDialog(); 0169 void stopRecording(); 0170 void updateCloudSyncCredentials(); 0171 0172 private: 0173 void setupActions(); 0174 void setupDownloadProgressBar(); 0175 void setupStatusBarActions(); 0176 QLabel * setupStatusBarLabel( const QString& templateString ); 0177 0178 void readSettings(); 0179 void readStatusBarSettings(); 0180 void writeSettings(); 0181 void writeStatusBarSettings(); 0182 0183 /** Only updates member variable m_tileZoomLevel, does not trigger screen 0184 update. */ 0185 void updateTileZoomLevel(); 0186 static void migrateNewstuffConfigFiles(); 0187 static void repairNode( QDomNode node, const QString &child ); 0188 0189 private: 0190 // All the functionality is provided by this widget. 0191 ControlView *m_controlView; 0192 SunControlWidget *m_sunControlDialog; 0193 TimeControlWidget *m_timeControlDialog; 0194 DownloadRegionDialog *m_downloadRegionDialog; 0195 MovieCaptureDialog *m_movieCaptureDialog; 0196 0197 // Actions for the GUI. 0198 QAction *m_exportMapAction; 0199 QAction *m_printMapAction; 0200 QAction *m_printPreviewAction; 0201 QAction *m_workOfflineAction; 0202 QAction *m_copyMapAction; 0203 QAction *m_copyCoordinatesAction; 0204 QAction *m_showCloudsAction; 0205 QAction *m_fullScreenAct; 0206 QAction *m_openAct; 0207 QAction *m_newStuffAction; 0208 QAction *m_downloadRegionAction; 0209 QAction *m_controlSunAction; 0210 QAction *m_controlTimeAction; 0211 QAction *m_lockFloatItemsAct; 0212 QAction *m_mapWizardAct; 0213 QAction *m_externalMapEditorAction; 0214 QAction *m_recordMovieAction; 0215 QAction *m_stopRecordingAction; 0216 KRecentFilesAction *m_recentFilesAction; 0217 0218 //Bookmark Menu 0219 QAction *m_addBookmarkAction; 0220 QAction *m_toggleBookmarkDisplayAction; 0221 QAction *m_setHomeAction; 0222 QAction *m_manageBookmarksAction; 0223 // Actions for the status bar 0224 QAction *m_showPositionAction; 0225 QAction *m_showDateTimeAction; 0226 QAction *m_showAltitudeAction; 0227 QAction *m_showTileZoomLevelAction; 0228 QAction *m_showDownloadProgressAction; 0229 0230 // Action for the tool bar 0231 KToggleAction *m_showShadow; 0232 KToggleAction *m_lockToSubSolarPoint; 0233 KToggleAction *m_setSubSolarPointIconVisible; 0234 0235 KConfigDialog *m_configDialog; 0236 0237 QHash<QString, int> m_pluginEnabled; 0238 0239 QString m_position; 0240 QString m_clock; 0241 QString m_tileZoomLevel; 0242 QString m_lastFileOpenPath; 0243 0244 // Items for the statusbar. 0245 QLabel *m_positionLabel; 0246 QLabel *m_clockLabel; 0247 QLabel *m_distanceLabel; 0248 QLabel *m_tileZoomLevelLabel; 0249 QProgressBar *m_downloadProgressBar; 0250 0251 KParts::StatusBarExtension *m_statusBarExtension; 0252 0253 QHash< int, int > m_timezone; 0254 QMap<int, QString> m_externalEditorMapping; 0255 Ui_MarbleCloudSyncSettingsWidget m_ui_cloudSyncSettings; 0256 }; 0257 0258 } 0259 0260 #endif