File indexing completed on 2024-10-06 03:37:23

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1998, 1999 Torben Weis <weis@kde.org>
0004     SPDX-FileCopyrightText: 2006 Daniel Teske <teske@squorn.de>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef KBOOKMARKACTION_H
0010 #define KBOOKMARKACTION_H
0011 
0012 #include "kbookmarkactioninterface.h"
0013 
0014 #include <QAction>
0015 
0016 class KBookmark;
0017 class KBookmarkOwner;
0018 
0019 /**
0020  * @class KBookmarkAction kbookmarkaction.h KBookmarkAction
0021  *
0022  * This class is a QAction for bookmarks.
0023  * It provides a nice constructor.
0024  * And on triggered uses the owner to open the bookmark.
0025  */
0026 class KBOOKMARKS_EXPORT KBookmarkAction : public QAction, public KBookmarkActionInterface
0027 {
0028     Q_OBJECT
0029 public:
0030     KBookmarkAction(const KBookmark &bk, KBookmarkOwner *owner, QObject *parent);
0031     ~KBookmarkAction() override;
0032 
0033 public Q_SLOTS:
0034     void slotSelected(Qt::MouseButtons mb, Qt::KeyboardModifiers km);
0035 
0036 private Q_SLOTS:
0037     KBOOKMARKS_NO_EXPORT void slotTriggered();
0038 
0039 private:
0040     KBookmarkOwner *const m_pOwner;
0041 };
0042 
0043 #endif