Libkleo

nameandemailwidget.h
1/* -*- mode: c++; c-basic-offset:4 -*-
2 This file is part of libkleopatra, the KDE keymanagement library
3 SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
4 SPDX-FileCopyrightText: 2022 g10 Code GmbH
5 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#pragma once
11
12#include "kleo_export.h"
13
14#include <QWidget>
15
16#include <memory>
17
18namespace Kleo
19{
20
21/**
22 * @brief A widget containing a name and an email field.
23 */
24class KLEO_EXPORT NameAndEmailWidget : public QWidget
25{
26 Q_OBJECT
27public:
28 explicit NameAndEmailWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
29 ~NameAndEmailWidget() override;
30
31 void setName(const QString &name);
32 QString name() const;
33 void setNameIsRequired(bool required);
34 bool nameIsRequired() const;
35 void setNameLabel(const QString &label);
36 QString nameLabel() const;
37 void setNameHint(const QString &hint);
38 QString nameHint() const;
39 void setNamePattern(const QString &pattern);
40 QString nameError() const;
41
42 void setEmail(const QString &email);
43 QString email() const;
44 void setEmailIsRequired(bool required);
45 bool emailIsRequired() const;
46 void setEmailLabel(const QString &label);
47 QString emailLabel() const;
48 void setEmailHint(const QString &hint);
49 QString emailHint() const;
50 void setEmailPattern(const QString &pattern);
51 QString emailError() const;
52
53 /**
54 * Returns the user ID built from the entered name and/or email address.
55 */
56 QString userID() const;
57
58Q_SIGNALS:
59 void userIDChanged() const;
60
61private:
62 class Private;
63 const std::unique_ptr<Private> d;
64};
65
66} // namespace Kleo
A widget containing a name and an email field.
typedef WindowFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.