libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
IKeychainService.h
1/*
2 * Copyright 2018-2025 Dmitry Ivanov
3 *
4 * This file is part of libquentier
5 *
6 * libquentier is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, version 3 of the License.
9 *
10 * libquentier is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <quentier/exception/IQuentierException.h>
22#include <quentier/types/ErrorString.h>
23
24#include <quentier/utility/Fwd.h>
25#include <quentier/utility/Linkage.h>
26
27#include <QFuture>
28
29class QDebug;
30
31namespace quentier::utility {
32
38{
39public:
40 virtual ~IKeychainService() noexcept;
41
45 enum class ErrorCode
46 {
50 NoError,
54 EntryNotFound,
58 CouldNotDeleteEntry,
62 AccessDeniedByUser,
66 AccessDenied,
70 NoBackendAvailable,
74 NotImplemented,
78 OtherError
79 };
80
82 QTextStream & strm, ErrorCode errorCode);
83
85 QDebug & dbg, ErrorCode errorCode);
86
92 {
93 public:
94 explicit Exception(ErrorCode errorCode) noexcept;
95
96 explicit Exception(
97 ErrorCode errorCode, ErrorString errorDescription) noexcept;
98
99 [[nodiscard]] ErrorCode errorCode() const noexcept;
100 [[nodiscard]] QString exceptionDisplayName() const override;
101
102 void raise() const override;
103 [[nodiscard]] Exception * clone() const override;
104
105 private:
106 const ErrorCode m_errorCode;
107 };
108
109public:
125
140 QString service, QString key) const = 0;
141
156};
157
158} // namespace quentier::utility
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:43
The IQuentierException class represents the interface for exceptions specific to libquentier and appl...
Definition IQuentierException.h:39
Definition Result.h:34
The IKeychainService::Exception class is the base class for exceptions returned inside QFutures from ...
Definition IKeychainService.h:92
The IKeychainService interface provides the ability to interact with the storage of sensitive data - ...
Definition IKeychainService.h:38
virtual QFuture< void > deletePassword(QString service, QString key)=0
ErrorCode
Definition IKeychainService.h:46
virtual QFuture< void > writePassword(QString service, QString key, QString password)=0
virtual QFuture< QString > readPassword(QString service, QString key) const =0