File indexing completed on 2024-04-21 04:50:10

0001 /* 
0002 
0003     SPDX-FileCopyrightText: 2003-2009 Sebastian Trueg <trueg@k3b.org>
0004     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 
0010 #ifndef K3BDIROPERATOR_H
0011 #define K3BDIROPERATOR_H
0012 
0013 #include <KBookmarkOwner>
0014 #include <KDirOperator>
0015 #include <QUrl>
0016 
0017 class KActionMenu;
0018 class KBookmarkMenu;
0019 
0020 
0021 /**
0022  *@author Sebastian Trueg
0023  */
0024 namespace K3b {
0025 class DirOperator : public KDirOperator, public KBookmarkOwner
0026 {
0027     Q_OBJECT
0028 
0029 public: 
0030     explicit DirOperator( const QUrl& urlName = QUrl(), QWidget* parent = 0 );
0031     ~DirOperator() override;
0032 
0033     /**
0034      * reimplemented from KDirOperator
0035      */
0036     void readConfig( const KConfigGroup& cfg ) override;
0037 
0038     /**
0039      * reimplemented from KDirOperator
0040      */
0041     void writeConfig( KConfigGroup& grp ) override;
0042 
0043     /**
0044      * reimplemented from KBookmarkOwner
0045      */
0046     void openBookmark(const KBookmark & bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) override;
0047 
0048     /**
0049      * reimplemented from KBookmarkOwner
0050      */
0051     QString currentTitle() const override;
0052 
0053     /**
0054      * reimplemented from KBookmarkOwner
0055      */
0056     QUrl currentUrl() const override;
0057 
0058     KActionMenu* bookmarkMenu() const { return m_bmPopup; }
0059 
0060 public Q_SLOTS:
0061     void slotAddFilesToProject();
0062 
0063 private Q_SLOTS:
0064     void extendContextMenu( const KFileItem&, QMenu* );
0065 
0066 private:
0067     KBookmarkMenu* m_bmMenu;
0068     KActionMenu* m_bmPopup;
0069     QAction* m_bmActionAddFileToProject;
0070 };
0071 }
0072 
0073 #endif