Pimcommon

completionorderwidget.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5
6*/
7
8#pragma once
9
10#include "pimcommonakonadi_private_export.h"
11#include <KConfig>
12#include <QDBusAbstractAdaptor>
13#include <QWidget>
14
15class QPushButton;
17class QModelIndex;
18class QTreeWidget;
19
20namespace KLDAPCore
21{
22class LdapClientSearch;
23class LdapActivitiesAbstract;
24}
25
26namespace PimCommon
27{
28class CompletionOrderEditorAdaptor : public QDBusAbstractAdaptor
29{
31 Q_CLASSINFO("D-Bus Interface", "org.kde.pim.CompletionOrder")
32public:
33 explicit CompletionOrderEditorAdaptor(QObject *parent);
35 void completionOrderChanged();
36};
37
38class CompletionOrderWidget;
39
40// Base class for items in the list
41class CompletionItem
42{
43public:
44 virtual ~CompletionItem() = default;
45
46 virtual QString label() const = 0;
47 virtual QIcon icon() const = 0;
48 virtual int completionWeight() const = 0;
49 virtual void setCompletionWeight(int weight) = 0;
50 virtual void save(CompletionOrderWidget *) = 0;
51 virtual bool hasEnableSupport() const = 0;
52 virtual bool isEnabled() const = 0;
53 virtual void setIsEnabled(bool b) = 0;
54};
55
56class PIMCOMMONAKONADI_TESTS_EXPORT CompletionOrderWidget : public QWidget
57{
58 Q_OBJECT
59public:
60 explicit CompletionOrderWidget(QWidget *parent = nullptr);
61 ~CompletionOrderWidget() override;
62 void save();
63
64 KConfig *configFile();
65 void loadCompletionItems();
66 void setLdapClientSearch(KLDAPCore::LdapClientSearch *ldapSearch);
67
68 void setLdapActivitiesAbstract(KLDAPCore::LdapActivitiesAbstract *ldapActivities);
69Q_SIGNALS:
70 void completionOrderChanged();
71
72private:
73 PIMCOMMONAKONADI_NO_EXPORT void rowsInserted(const QModelIndex &parent, int start, int end);
74 PIMCOMMONAKONADI_NO_EXPORT void slotSelectionChanged();
75 PIMCOMMONAKONADI_NO_EXPORT void slotMoveUp();
76 PIMCOMMONAKONADI_NO_EXPORT void slotMoveDown();
77 PIMCOMMONAKONADI_NO_EXPORT void addRecentAddressItem();
78 PIMCOMMONAKONADI_NO_EXPORT void addCompletionItemForCollection(const QModelIndex &);
79 PIMCOMMONAKONADI_NO_EXPORT void slotItemChanged();
80
81 KConfig mConfig;
82 QTreeWidget *mListView = nullptr;
83 QPushButton *mUpButton = nullptr;
84 QPushButton *mDownButton = nullptr;
85 QAbstractItemModel *mCollectionModel = nullptr;
86 KLDAPCore::LdapClientSearch *mLdapSearch = nullptr;
87 KLDAPCore::LdapActivitiesAbstract *mLdapActivities = nullptr;
88
89 int mDefaultValue = 60;
90 bool mDirty = false;
91};
92}
Q_SCRIPTABLE Q_NOREPLY void start()
QString label(StandardShortcut id)
const QList< QKeySequence > & save()
folderdialogacltab.h
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.