File indexing completed on 2025-01-19 03:58:04

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-11-21
0007  * Description : Central object for managing bookmarks
0008  *
0009  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2009-2010 by Michael G. Hansen <mike at mghansen dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_GPS_BOOK_MARK_OWNER_H
0017 #define DIGIKAM_GPS_BOOK_MARK_OWNER_H
0018 
0019 // Qt includes
0020 
0021 #include <QMenu>
0022 #include <QUrl>
0023 
0024 // Local includes
0025 
0026 #include "gpsdatacontainer.h"
0027 #include "bookmarksmngr.h"
0028 #include "digikam_export.h"
0029 
0030 namespace Digikam
0031 {
0032 
0033 class GPSItemModel;
0034 class GPSBookmarkModelHelper;
0035 
0036 class DIGIKAM_EXPORT GPSBookmarkOwner : public QObject
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041 
0042     GPSBookmarkOwner(GPSItemModel* const gpsItemModel, QWidget* const parent);
0043     ~GPSBookmarkOwner() override;
0044 
0045     void changeAddBookmark(const bool state);
0046     void setPositionAndTitle(const GeoCoordinates& coordinates, const QString& title);
0047 
0048     QMenu*                  getMenu()             const;
0049     BookmarksManager*       bookmarkManager()     const;
0050     GPSBookmarkModelHelper* bookmarkModelHelper() const;
0051     QString                 currentTitle()        const;
0052     QString                 currentUrl()          const;
0053 
0054 Q_SIGNALS:
0055 
0056     void positionSelected(const GPSDataContainer& position);
0057 
0058 private Q_SLOTS:
0059 
0060     void slotOpenBookmark(const QUrl&);
0061     void slotShowBookmarksDialog();
0062     void slotAddBookmark();
0063 
0064 private:
0065 
0066     void createBookmarksMenu();
0067 
0068 private:
0069 
0070     class Private;
0071     Private* const d;
0072 };
0073 
0074 } // namespace Digikam
0075 
0076 #endif // DIGIKAM_GPS_BOOK_MARK_OWNER_H