File indexing completed on 2024-05-12 05:12:43
0001 /* 0002 This file is part of Akonadi. 0003 0004 SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include "ui_agentwidget.h" 0012 0013 #include <Akonadi/AgentInstance> 0014 0015 class KJob; 0016 class QMenu; 0017 class QPoint; 0018 class QResizeEvent; 0019 class QEvent; 0020 0021 class AgentWidget : public QWidget 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 explicit AgentWidget(QWidget *parent = nullptr); 0027 Akonadi::AgentInstanceWidget *widget() const 0028 { 0029 return ui.instanceWidget; 0030 } 0031 0032 protected: 0033 void resizeEvent(QResizeEvent *event) override; 0034 0035 bool eventFilter(QObject *obj, QEvent *event) override; 0036 private Q_SLOTS: 0037 void addAgent(); 0038 void removeAgent(); 0039 void configureAgent(); 0040 void configureAgentRemote(); 0041 void synchronizeAgent(); 0042 void synchronizeTree(); 0043 void toggleOnline(); 0044 void showChangeNotifications(); 0045 void showTaskList(); 0046 void abortAgent(); 0047 void restartAgent(); 0048 void slotCloneAgent(); 0049 void cloneAgent(KJob *job); 0050 0051 void currentChanged(); 0052 void showContextMenu(const QPoint &pos); 0053 0054 void selectionChanged(); 0055 void slotDataChanged(const QModelIndex &, const QModelIndex &); 0056 0057 private: 0058 void slotSearchAgentType(const QString &str); 0059 Ui::AgentWidget ui; 0060 QMenu *mSyncMenu = nullptr; 0061 QMenu *mConfigMenu = nullptr; 0062 Akonadi::AgentInstance mCloneSource; 0063 };