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;
23}
24
25namespace PimCommon
26{
27class CompletionOrderEditorAdaptor : public QDBusAbstractAdaptor
28{
30 Q_CLASSINFO("D-Bus Interface", "org.kde.pim.CompletionOrder")
31public:
32 explicit CompletionOrderEditorAdaptor(QObject *parent);
34 void completionOrderChanged();
35};
36
37class CompletionOrderWidget;
38
39// Base class for items in the list
40class CompletionItem
41{
42public:
43 virtual ~CompletionItem() = default;
44
45 virtual QString label() const = 0;
46 virtual QIcon icon() const = 0;
47 virtual int completionWeight() const = 0;
48 virtual void setCompletionWeight(int weight) = 0;
49 virtual void save(CompletionOrderWidget *) = 0;
50 virtual bool hasEnableSupport() const = 0;
51 virtual bool isEnabled() const = 0;
52 virtual void setIsEnabled(bool b) = 0;
53};
54
55class PIMCOMMONAKONADI_TESTS_EXPORT CompletionOrderWidget : public QWidget
56{
57 Q_OBJECT
58public:
59 explicit CompletionOrderWidget(QWidget *parent = nullptr);
60 ~CompletionOrderWidget() override;
61 void save();
62
63 KConfig *configFile();
64 void loadCompletionItems();
65 void setLdapClientSearch(KLDAPCore::LdapClientSearch *ldapSearch);
66
67Q_SIGNALS:
68 void completionOrderChanged();
69
70private:
71 PIMCOMMONAKONADI_NO_EXPORT void rowsInserted(const QModelIndex &parent, int start, int end);
72 PIMCOMMONAKONADI_NO_EXPORT void slotSelectionChanged();
73 PIMCOMMONAKONADI_NO_EXPORT void slotMoveUp();
74 PIMCOMMONAKONADI_NO_EXPORT void slotMoveDown();
75 PIMCOMMONAKONADI_NO_EXPORT void addRecentAddressItem();
76 PIMCOMMONAKONADI_NO_EXPORT void addCompletionItemForCollection(const QModelIndex &);
77 PIMCOMMONAKONADI_NO_EXPORT void slotItemChanged();
78
79 KConfig mConfig;
80 QTreeWidget *mListView = nullptr;
81 QPushButton *mUpButton = nullptr;
82 QPushButton *mDownButton = nullptr;
83 QAbstractItemModel *mCollectionModel = nullptr;
84 KLDAPCore::LdapClientSearch *mLdapSearch = nullptr;
85
86 int mDefaultValue = 60;
87 bool mDirty = false;
88};
89}
Q_SCRIPTABLE Q_NOREPLY void start()
KGuiItem save()
QString label(StandardShortcut id)
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 Mon Nov 4 2024 16:39:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.