Libksieve

util.h
1/*
2 SPDX-FileCopyrightText: 2005 Till Adam <adam@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ksievecore_export.h"
10#include <KSieveCore/SieveImapAccountSettings>
11#include <KSieveCore/SieveImapInstance>
12#include <QUrl>
13#include <memory>
14class QString;
15#include <QStringList>
16namespace KSieveCore
17{
18/**
19 * The Util namespace contains a collection of helper functions use in
20 * various places.
21 */
22namespace Util
23{
24/**
25 * Returns whether the availability of a vacation sieve script shall
26 * be checked at the start up of an application.
27 */
28KSIEVECORE_EXPORT bool checkOutOfOfficeOnStartup();
29
30/**
31 * Returns whether the functionality of vacation sieve script editing shall
32 * be available at all.
33 */
34KSIEVECORE_EXPORT bool allowOutOfOfficeSettings();
35
36struct KSIEVECORE_EXPORT AccountInfo {
37 KSieveCore::SieveImapAccountSettings sieveImapAccountSettings;
38 QUrl sieveUrl;
39 bool operator==(const AccountInfo &other) const;
40};
41KSIEVECORE_EXPORT QDebug operator<<(QDebug d, const Util::AccountInfo &info);
42
43/**
44 * Returns the list of configured IMAP agent instances.
45 */
46[[nodiscard]] KSIEVECORE_EXPORT QList<KSieveCore::SieveImapInstance> sieveImapInstances();
47[[nodiscard]] KSIEVECORE_EXPORT QStringList sieveImapResourceNames();
48
49/**
50 * Checks if a server has KEP:14 support
51 */
52[[nodiscard]] KSIEVECORE_EXPORT bool hasKep14Support(const QStringList &sieveCapabilities, const QStringList &availableScripts, const QString &activeScript);
53
54[[nodiscard]] KSIEVECORE_EXPORT bool hasKep14CapabilitySupport(const QStringList &sieveCapabilities);
55
56/**
57 * Is the given scriptName a protected KEP:14 name, that a normal user should not touch directly.
58 * it tests against MASTER, USER and MANAGEMENT script
59 */
60[[nodiscard]] KSIEVECORE_EXPORT bool isKep14ProtectedName(const QString &scriptName);
61}
62}
63
64Q_DECLARE_METATYPE(KSieveCore::Util::AccountInfo)
The SieveImapAccountSettings class.
KSIEVECORE_EXPORT QList< KSieveCore::SieveImapInstance > sieveImapInstances()
Returns the list of configured IMAP agent instances.
Definition util.cpp:32
KSIEVECORE_EXPORT bool hasKep14Support(const QStringList &sieveCapabilities, const QStringList &availableScripts, const QString &activeScript)
Checks if a server has KEP:14 support.
Definition util.cpp:63
KSIEVECORE_EXPORT bool isKep14ProtectedName(const QString &scriptName)
Is the given scriptName a protected KEP:14 name, that a normal user should not touch directly.
Definition util.cpp:94
KSIEVECORE_EXPORT bool allowOutOfOfficeSettings()
Returns whether the functionality of vacation sieve script editing shall be available at all.
Definition util.cpp:52
KSIEVECORE_EXPORT bool checkOutOfOfficeOnStartup()
Returns whether the availability of a vacation sieve script shall be checked at the start up of an ap...
Definition util.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.