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

0001 /* This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2001, 2002 Joseph Wenninger <jowenn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "konqsidebarplugin.h"
0008 #include "browserarguments.h"
0009 
0010 class KonqSidebarModulePrivate
0011 {
0012 public:
0013     KonqSidebarModulePrivate()
0014         : m_copy(false), m_cut(false), m_paste(false) {}
0015     bool m_copy;
0016     bool m_cut;
0017     bool m_paste;
0018 };
0019 
0020 KonqSidebarModule::KonqSidebarModule(QObject *parent,
0021                                      const KConfigGroup &configGroup_)
0022     : QObject(parent),
0023       m_configGroup(configGroup_),
0024       d(new KonqSidebarModulePrivate)
0025 {
0026 }
0027 
0028 KonqSidebarModule::~KonqSidebarModule()
0029 {
0030     delete d;
0031 }
0032 
0033 void KonqSidebarModule::openUrl(const QUrl &url)
0034 {
0035     handleURL(url);
0036 }
0037 
0038 void KonqSidebarModule::openPreview(const KFileItemList &items)
0039 {
0040     handlePreview(items);
0041 }
0042 
0043 void KonqSidebarModule::openPreviewOnMouseOver(const KFileItem &item)
0044 {
0045     handlePreviewOnMouseOver(item);
0046 }
0047 
0048 void KonqSidebarModule::handlePreview(const KFileItemList & /*items*/) {}
0049 
0050 void KonqSidebarModule::handlePreviewOnMouseOver(const KFileItem & /*items*/) {}
0051 
0052 KConfigGroup KonqSidebarModule::configGroup()
0053 {
0054     return m_configGroup;
0055 }
0056 
0057 void KonqSidebarModule::enableCopy(bool enabled)
0058 {
0059     d->m_copy = enabled;
0060     emit enableAction(this, "copy", enabled);
0061 }
0062 
0063 void KonqSidebarModule::enableCut(bool enabled)
0064 {
0065     d->m_cut = enabled;
0066     emit enableAction(this, "cut", enabled);
0067 }
0068 
0069 void KonqSidebarModule::enablePaste(bool enabled)
0070 {
0071     d->m_paste = enabled;
0072     emit enableAction(this, "paste", enabled);
0073 }
0074 
0075 bool KonqSidebarModule::isCopyEnabled() const
0076 {
0077     return d->m_copy;
0078 }
0079 
0080 bool KonqSidebarModule::isCutEnabled() const
0081 {
0082     return d->m_cut;
0083 }
0084 
0085 bool KonqSidebarModule::isPasteEnabled() const
0086 {
0087     return d->m_paste;
0088 }
0089 
0090 void KonqSidebarModule::showPopupMenu(const QPoint &global, const KFileItemList &items,
0091                                       const KParts::OpenUrlArguments &args,
0092                                       const BrowserArguments &browserArgs,
0093                                       KParts::NavigationExtension::PopupFlags flags,
0094                                       const KParts::NavigationExtension::ActionGroupMap &actionGroups)
0095 {
0096     emit popupMenu(this, global, items, args, browserArgs, flags, actionGroups);
0097 }