sieveeditorbookmarks.h 1.72 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   Copyright (C) 2015-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
23
*/

#ifndef SIEVEEDITORBOOKMARKS_H
#define SIEVEEDITORBOOKMARKS_H

#include <QObject>
24
#include <KBookmarkOwner>
Laurent Montel's avatar
Laurent Montel committed
25
26
27
class KBookmarkMenu;
class QMenu;
class KActionCollection;
Laurent Montel's avatar
Laurent Montel committed
28
class SieveEditorMainWindow;
Laurent Montel's avatar
Laurent Montel committed
29
class SieveEditorBookmarks : public QObject, public KBookmarkOwner
Laurent Montel's avatar
Laurent Montel committed
30
31
32
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
33
    explicit SieveEditorBookmarks(SieveEditorMainWindow *mainWindow, KActionCollection *collection, QMenu *menu, QObject *parent = nullptr);
Laurent Montel's avatar
Laurent Montel committed
34
    ~SieveEditorBookmarks() override;
Laurent Montel's avatar
Laurent Montel committed
35
36
37

    QMenu *menu() const;

38
    void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) override;
Laurent Montel's avatar
Laurent Montel committed
39

Laurent Montel's avatar
Laurent Montel committed
40
41
    Q_REQUIRED_RESULT QString currentTitle() const override;
    Q_REQUIRED_RESULT QUrl currentUrl() const override;
Laurent Montel's avatar
Laurent Montel committed
42
43

Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
44
    void openUrl(const QUrl &url);
Laurent Montel's avatar
Laurent Montel committed
45

Laurent Montel's avatar
Laurent Montel committed
46
private:
Laurent Montel's avatar
Laurent Montel committed
47
    Q_DISABLE_COPY(SieveEditorBookmarks)
Laurent Montel's avatar
Laurent Montel committed
48
    KBookmarkMenu *mBookmarkMenu = nullptr;
Laurent Montel's avatar
Laurent Montel committed
49
50
    QMenu *const mMenu;
    SieveEditorMainWindow *const mMainWindow;
Laurent Montel's avatar
Laurent Montel committed
51
52
53
};

#endif // SIEVEEDITORBOOKMARKS_H