KIdentityManagement

identityeditorbackend.h
1// SPDX-FileCopyrightText: 2023 Claudio Cambra <claudio.cambra@kde.org>
2// SPDX-License-Identifier: LGPL-2.0-or-later
3
4#pragma once
5
6#include <QObject>
7
8#include "identity.h"
9#include "identitymanager.h"
10
11namespace KIdentityManagementQuick
12{
13class IdentityEditorBackend : public QObject
14{
16
17 Q_PROPERTY(Mode mode READ mode WRITE setMode NOTIFY modeChanged)
18 Q_PROPERTY(KIdentityManagementCore::Identity identity READ identity WRITE setIdentity NOTIFY identityChanged NOTIFY modeChanged)
19 Q_PROPERTY(uint identityUoid READ identityUoid WRITE setIdentityUoid NOTIFY identityChanged)
20
21public:
22 enum Mode {
23 CreateMode,
24 EditMode
25 };
26 Q_ENUM(Mode);
27
28 explicit IdentityEditorBackend() = default;
29
30 [[nodiscard]] Mode mode() const;
31 void setMode(Mode mode);
32
33 [[nodiscard]] KIdentityManagementCore::Identity identity() const;
34 void setIdentity(const KIdentityManagementCore::Identity &identity);
35
36 [[nodiscard]] uint identityUoid() const;
37 void setIdentityUoid(uint identityUoid);
38
39 Q_INVOKABLE void saveIdentity(const KIdentityManagementCore::Identity &modifiedIdentity);
40
41 Q_INVOKABLE void addEmailAlias(const QString &alias);
42 Q_INVOKABLE void modifyEmailAlias(const QString &originalAlias, const QString &modifiedAlias);
43 Q_INVOKABLE void removeEmailAlias(const QString &alias);
44
46 void modeChanged();
47 void identityChanged();
48
49private:
52 Mode mMode = CreateMode;
53};
54}
Manages the list of identities.
static IdentityManager * self()
Creates or reuses the identity manager instance for this process.
User identity information.
Definition identity.h:74
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.