Libkleo

validation.h
1/* -*- mode: c++; c-basic-offset:4 -*-
2 utils/validation.h
3
4 This file is part of libkleo.
5 SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
6 SPDX-FileCopyrightText: 2022 g10 Code GmbH
7 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#pragma once
13
14#include "kleo_export.h"
15
16#include <memory>
17
18class QString;
19class QValidator;
20
21namespace Kleo
22{
23namespace Validation
24{
25
26enum Flags {
27 Optional,
28 Required,
29};
30
31/**
32 * Creates a validator for the email part of an OpenPGP key.
33 */
34KLEO_EXPORT std::shared_ptr<QValidator> email(Flags flags = Required);
35/**
36 * Creates a validator for the name part of the user ID of an OpenPGP key with
37 * restrictions that are necessary for usage with the edit-key interface.
38 */
39KLEO_EXPORT std::shared_ptr<QValidator> pgpName(Flags flags = Required);
40/**
41 * Creates a validator for the name part of the user ID of an OpenPGP key with
42 * less restrictions than \ref pgpName.
43 */
44KLEO_EXPORT std::shared_ptr<QValidator> simpleName(Flags flags = Required);
45
46KLEO_EXPORT std::shared_ptr<QValidator> email(const QString &additionalRegExp, Flags flags = Required);
47/**
48 * Creates a validator for the name part of the user ID of an OpenPGP key with
49 * restrictions that are necessary for usage with the edit-key interface, and
50 * with additional restrictions imposed by \p additionalRegExp.
51 */
52KLEO_EXPORT std::shared_ptr<QValidator> pgpName(const QString &additionalRegExp, Flags flags = Required);
53/**
54 * Creates a validator for the name part of the user ID of an OpenPGP key with
55 * less restrictions than \ref pgpName, but with additional restrictions imposed
56 * by \p additionalRegExp.
57 */
58KLEO_EXPORT std::shared_ptr<QValidator> simpleName(const QString &additionalRegExp, Flags flags = Required);
59
60}
61}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.