File indexing completed on 2025-01-05 03:58:36

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-12-01
0007  * Description : world map widget library - Private container
0008  *
0009  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2009-2011 by Michael G. Hansen <mike at mghansen dot de>
0011  * SPDX-FileCopyrightText:      2014 by Justus Schwartz <justus at gmx dot li>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #include "mapwidget.h"
0018 
0019 // C++ includes
0020 
0021 #include <cmath>
0022 
0023 // Qt includes
0024 
0025 #include <QDragEnterEvent>
0026 #include <QDropEvent>
0027 #include <QItemSelectionModel>
0028 #include <QMenu>
0029 #include <QPainter>
0030 #include <QPointer>
0031 #include <QStackedLayout>
0032 #include <QTimer>
0033 #include <QPushButton>
0034 #include <QToolButton>
0035 #include <QHBoxLayout>
0036 #include <QAction>
0037 #include <QActionGroup>
0038 #include <QFrame>
0039 
0040 // KDE includes
0041 
0042 #include <klocalizedstring.h>
0043 #include <kconfiggroup.h>
0044 
0045 // Marble includes
0046 
0047 #ifdef HAVE_GEOLOCATION
0048 
0049 #   include "GeoDataLineString.h"
0050 #   include "GeoDataLatLonBox.h"
0051 #   include "MarbleGlobal.h"
0052 
0053 #endif
0054 
0055 // local includes
0056 
0057 #include "geoifacecommon.h"
0058 #include "geodragdrophandler.h"
0059 #include "geomodelhelper.h"
0060 #include "trackmanager.h"
0061 #include "placeholderwidget.h"
0062 #include "tilegrouper.h"
0063 #include "digikam_debug.h"
0064 #include "abstractmarkertiler.h"
0065 #include "backendgooglemaps.h"
0066 #include "geolocationsettings.h"
0067 
0068 #ifdef HAVE_GEOLOCATION
0069 
0070 #   include "backendmarble.h"
0071 
0072 #endif
0073 
0074 namespace Digikam
0075 {
0076 
0077 class Q_DECL_HIDDEN MapWidget::Private
0078 {
0079 public:
0080 
0081     explicit Private();
0082 
0083     QList<MapBackend*>      loadedBackends;
0084     MapBackend*             currentBackend;
0085     QString                 currentBackendName;
0086     QStackedLayout*         stackedLayout;
0087 
0088     /// NOTE: these values are cached in case the backend is not ready:
0089     GeoCoordinates          cacheCenterCoordinate;
0090     QString                 cacheZoom;
0091 
0092     /// actions for controlling the widget
0093     QMenu*                  configurationMenu;
0094     QActionGroup*           actionGroupBackendSelection;
0095     QAction*                actionZoomIn;
0096     QAction*                actionZoomOut;
0097     QAction*                actionShowThumbnails;
0098     QWidget*                mouseModesHolder;
0099     QPointer<QWidget>       controlWidget;
0100     QAction*                actionPreviewSingleItems;
0101     QAction*                actionPreviewGroupedItems;
0102     QAction*                actionShowNumbersOnItems;
0103 
0104     bool                    lazyReclusteringRequested;
0105 
0106     GeoDragDropHandler*     dragDropHandler;
0107 
0108     QMenu*                  sortMenu;
0109     QAction*                actionIncreaseThumbnailSize;
0110     QAction*                actionDecreaseThumbnailSize;
0111     QWidget*                hBoxForAdditionalControlWidgetItems;
0112 
0113     QActionGroup*           mouseModeActionGroup;
0114     QAction*                actionRemoveCurrentRegionSelection;
0115     QAction*                actionSetRegionSelectionMode;
0116     QAction*                actionSetPanMode;
0117     QAction*                actionSetZoomIntoGroupMode;
0118     QAction*                actionSetRegionSelectionFromIconMode;
0119     QAction*                actionSetFilterMode;
0120     QAction*                actionRemoveFilter;
0121     QAction*                actionSetSelectThumbnailMode;
0122     QAction*                actionLoadTracksFromAlbums;
0123     QToolButton*            setPanModeButton;
0124     QToolButton*            setSelectionModeButton;
0125     QToolButton*            removeCurrentSelectionButton;
0126     QToolButton*            setZoomModeButton;
0127     QToolButton*            setRegionSelectionFromIconModeButton;
0128     QToolButton*            setFilterModeButton;
0129     QToolButton*            removeFilterModeButton;
0130     QToolButton*            setSelectThumbnailMode;
0131     QToolButton*            loadTracksFromAlbums;
0132 
0133     QTimer*                 thumbnailTimer;
0134     int                     thumbnailTimerCount;
0135     bool                    thumbnailsHaveBeenLoaded;
0136 
0137     GeoExtraActions         availableExtraActions;
0138     GeoExtraActions         visibleExtraActions;
0139     QAction*                actionStickyMode;
0140     QToolButton*            buttonStickyMode;
0141 
0142     /// NOTE: to be sorted later
0143     PlaceholderWidget*      placeholderWidget;
0144 };
0145 
0146 } // namespace Digikam