9#include <Akonadi/Collection>
12#include <Akonadi/Item>
13#include <Akonadi/Session>
14#include <KLDAPCore/LdapClientSearch>
29class AddresseeLineEdit;
31class AddresseeLineEditLdap;
32class AddresseeLineEditAkonadiSearch;
33class AddresseeLineEditManager
36 using CompletionItemsMap = QMap<QString, QPair<int, int>>;
38 AddresseeLineEditManager();
40 ~AddresseeLineEditManager();
42 static AddresseeLineEditManager *self();
44 void updateCollectionWeights();
46 void updateLDAPWeights();
47 void updateCompletionOrder();
49 [[nodiscard]]
int addCompletionSource(
const QString &source,
int weight);
50 void removeCompletionSource(
const QString &source);
52 CompletionItemsMap completionItemMap;
53 QStringList completionSources;
57 QMap<QString, int> completionSourceWeights;
60 struct collectionInfo {
65 collectionInfo(
int idx,
bool _enabled)
75 QMap<Akonadi::Collection::Id, collectionInfo> akonadiCollectionToCompletionSourceMap;
78 QList<QPointer<Akonadi::Job>> akonadiJobsInFlight;
81 void initializeLdap();
82 [[nodiscard]] QString ldapText()
const;
83 void setLdapText(
const QString &ldapText);
84 KLDAPCore::LdapClientSearch *ldapSearch()
const;
85 QTimer *ldapTimer()
const;
86 [[nodiscard]]
bool isLdapClientToCompletionSourceMapContains(
int value)
const;
87 [[nodiscard]]
int ldapClientToCompletionSourceValue(
int value)
const;
88 void stopLDAPLookup();
89 void startLoadingLDAPEntries();
90 void restartLdap(
const QString &searchString, AddresseeLineEdit *addressLine);
93 [[nodiscard]]
int balooCompletionSource()
const;
94 void setBalooCompletionSource(
int value);
97 [[nodiscard]] Akonadi::Session *akonadiSession()
const;
99 [[nodiscard]] KMailCompletion *completion()
const;
101 [[nodiscard]] AddresseeLineEdit *addressLineEdit()
const;
102 void setAddressLineEdit(AddresseeLineEdit *addressLineEdit);
103 [[nodiscard]]
bool isOnline()
const;
105 void loadBalooBlackList();
106 [[nodiscard]] QStringList cleanupEmailList(
const QStringList &inputList);
107 [[nodiscard]] QStringList balooBlackList()
const;
109 [[nodiscard]]
bool showOU()
const;
110 void setShowOU(
bool showOU);
112 [[nodiscard]]
bool autoGroupExpand()
const;
113 void setAutoGroupExpand(
bool checked);
115 [[nodiscard]] QColor alternateColor()
const;
117 [[nodiscard]] QStringList cleanupRecentAddressEmailList(
const QStringList &inputList);
119 void setLdapActivitiesAbstract(KLDAPCore::LdapActivitiesAbstract *ldapActivities);
122 QStringList mRecentAddressEmailList;
123 QStringList mRecentCleanupAddressEmailList;
124 mutable QColor mAlternateColor;
125 bool mShowOU =
false;
126 bool mAutoGroupExpand =
false;
127 KMailCompletion *
const mCompletion;
128 AddresseeLineEditAkonadi *
const mAddresseeLineEditAkonadi;
129 AddresseeLineEditLdap *
const mAddressessLineEditLdap;
130 AddresseeLineEditAkonadiSearch *
const mAddressessLineEditBaloo;
The AddresseeLineEditAkonadi class.
KMailCompletion allows lookup of email addresses by keyword.