2020-04-03 22:28:15 +00:00
|
|
|
/*
|
|
|
|
* Squawk messenger.
|
|
|
|
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-11-06 23:57:08 +00:00
|
|
|
#pragma once
|
2020-04-03 22:28:15 +00:00
|
|
|
|
|
|
|
#include <deque>
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace Shared {
|
|
|
|
Q_NAMESPACE
|
|
|
|
|
|
|
|
enum class ConnectionState {
|
|
|
|
disconnected,
|
2022-12-26 22:01:01 +00:00
|
|
|
scheduled,
|
2020-04-03 22:28:15 +00:00
|
|
|
connecting,
|
|
|
|
connected,
|
|
|
|
error
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(ConnectionState)
|
2022-12-26 22:01:01 +00:00
|
|
|
static const std::deque<QString> connectionStateThemeIcons = {"state-offline", "state-sync", "state-sync", "state-ok", "state-error"};
|
2020-04-04 16:40:32 +00:00
|
|
|
static const ConnectionState ConnectionStateHighest = ConnectionState::error;
|
|
|
|
static const ConnectionState ConnectionStateLowest = ConnectionState::disconnected;
|
2020-04-03 22:28:15 +00:00
|
|
|
|
|
|
|
enum class Availability {
|
|
|
|
online,
|
|
|
|
away,
|
|
|
|
extendedAway,
|
|
|
|
busy,
|
|
|
|
chatty,
|
|
|
|
invisible,
|
|
|
|
offline
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(Availability)
|
2020-04-04 16:40:32 +00:00
|
|
|
static const Availability AvailabilityHighest = Availability::offline;
|
|
|
|
static const Availability AvailabilityLowest = Availability::online;
|
2020-04-03 22:28:15 +00:00
|
|
|
static const std::deque<QString> availabilityThemeIcons = {
|
|
|
|
"user-online",
|
|
|
|
"user-away",
|
|
|
|
"user-away-extended",
|
|
|
|
"user-busy",
|
|
|
|
"chatty",
|
|
|
|
"user-invisible",
|
|
|
|
"user-offline"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class SubscriptionState {
|
|
|
|
none,
|
|
|
|
from,
|
|
|
|
to,
|
|
|
|
both,
|
|
|
|
unknown
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(SubscriptionState)
|
2020-04-04 16:40:32 +00:00
|
|
|
static const SubscriptionState SubscriptionStateHighest = SubscriptionState::unknown;
|
|
|
|
static const SubscriptionState SubscriptionStateLowest = SubscriptionState::none;
|
2020-04-03 22:28:15 +00:00
|
|
|
static const std::deque<QString> subscriptionStateThemeIcons = {"edit-none", "arrow-down-double", "arrow-up-double", "dialog-ok", "question"};
|
|
|
|
|
|
|
|
enum class Affiliation {
|
|
|
|
unspecified,
|
|
|
|
outcast,
|
|
|
|
nobody,
|
|
|
|
member,
|
|
|
|
admin,
|
|
|
|
owner
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(Affiliation)
|
2020-04-04 16:40:32 +00:00
|
|
|
static const Affiliation AffiliationHighest = Affiliation::owner;
|
|
|
|
static const Affiliation AffiliationLowest = Affiliation::unspecified;
|
2020-04-03 22:28:15 +00:00
|
|
|
|
|
|
|
enum class Role {
|
|
|
|
unspecified,
|
|
|
|
nobody,
|
|
|
|
visitor,
|
|
|
|
participant,
|
|
|
|
moderator
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(Role)
|
2020-04-04 16:40:32 +00:00
|
|
|
static const Role RoleHighest = Role::moderator;
|
|
|
|
static const Role RoleLowest = Role::unspecified;
|
2020-04-03 22:28:15 +00:00
|
|
|
|
|
|
|
enum class Avatar {
|
|
|
|
empty,
|
|
|
|
autocreated,
|
|
|
|
valid
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(Avatar)
|
2020-04-04 16:40:32 +00:00
|
|
|
static const Avatar AvatarHighest = Avatar::valid;
|
|
|
|
static const Avatar AvatarLowest = Avatar::empty;
|
2020-04-03 22:28:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
static const std::deque<QString> messageStateThemeIcons = {"state-offline", "state-sync", "state-ok", "state-error"};
|
|
|
|
|
2020-04-04 16:40:32 +00:00
|
|
|
enum class AccountPassword {
|
|
|
|
plain,
|
|
|
|
jammed,
|
2020-04-07 20:33:03 +00:00
|
|
|
alwaysAsk,
|
|
|
|
kwallet
|
2020-04-04 16:40:32 +00:00
|
|
|
};
|
|
|
|
Q_ENUM_NS(AccountPassword)
|
2020-04-07 20:33:03 +00:00
|
|
|
static const AccountPassword AccountPasswordHighest = AccountPassword::kwallet;
|
2020-04-04 16:40:32 +00:00
|
|
|
static const AccountPassword AccountPasswordLowest = AccountPassword::plain;
|
|
|
|
|
2023-02-02 18:39:38 +00:00
|
|
|
enum class EntryType {
|
2023-02-21 20:27:28 +00:00
|
|
|
none,
|
|
|
|
ownAccount,
|
2023-02-02 18:39:38 +00:00
|
|
|
contact,
|
|
|
|
conference,
|
|
|
|
presence,
|
|
|
|
participant
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(EntryType)
|
|
|
|
static const EntryType EntryTypeHighest = EntryType::participant;
|
2023-02-21 20:27:28 +00:00
|
|
|
static const EntryType EntryTypeLowest = EntryType::none;
|
2023-02-02 18:39:38 +00:00
|
|
|
|
2022-08-25 22:49:49 +00:00
|
|
|
enum class Support {
|
|
|
|
unknown,
|
|
|
|
supported,
|
|
|
|
unsupported
|
|
|
|
};
|
|
|
|
Q_ENUM_NS(Support)
|
|
|
|
|
2022-12-19 15:43:24 +00:00
|
|
|
enum class TrustLevel {
|
|
|
|
/// The key's trust is not decided.
|
2023-01-01 17:25:51 +00:00
|
|
|
undecided,
|
2022-12-19 15:43:24 +00:00
|
|
|
/// The key is automatically distrusted (e.g., by the security policy TOAKAFA).
|
|
|
|
/// \see SecurityPolicy
|
2023-01-01 17:25:51 +00:00
|
|
|
automaticallyDistrusted,
|
2022-12-19 15:43:24 +00:00
|
|
|
/// The key is manually distrusted (e.g., by clicking a button or \xep{0450, Automatic Trust
|
|
|
|
/// Management (ATM)}).
|
2023-01-01 17:25:51 +00:00
|
|
|
manuallyDistrusted,
|
2022-12-19 15:43:24 +00:00
|
|
|
/// The key is automatically trusted (e.g., by the client for all keys of a bare JID until one
|
|
|
|
/// of it is authenticated).
|
2023-01-01 17:25:51 +00:00
|
|
|
automaticallyTrusted,
|
2022-12-19 15:43:24 +00:00
|
|
|
/// The key is manually trusted (e.g., by clicking a button).
|
2023-01-01 17:25:51 +00:00
|
|
|
manuallyTrusted,
|
2022-12-19 15:43:24 +00:00
|
|
|
/// The key is authenticated (e.g., by QR code scanning or \xep{0450, Automatic Trust
|
|
|
|
/// Management (ATM)}).
|
2023-01-01 17:25:51 +00:00
|
|
|
authenticated
|
2022-12-19 15:43:24 +00:00
|
|
|
};
|
|
|
|
Q_ENUM_NS(TrustLevel)
|
2023-01-14 15:34:14 +00:00
|
|
|
static const TrustLevel TrustLevelHighest = TrustLevel::undecided;
|
|
|
|
static const TrustLevel TrustLevelLowest = TrustLevel::authenticated;
|
2022-12-19 15:43:24 +00:00
|
|
|
|
2023-01-01 17:25:51 +00:00
|
|
|
enum class EncryptionProtocol {
|
2023-03-27 18:45:29 +00:00
|
|
|
none,
|
2023-03-02 18:17:06 +00:00
|
|
|
omemo,
|
|
|
|
omemo1,
|
|
|
|
omemo2
|
2023-01-01 17:25:51 +00:00
|
|
|
};
|
|
|
|
Q_ENUM_NS(EncryptionProtocol)
|
2023-03-27 18:45:29 +00:00
|
|
|
static const EncryptionProtocol EncryptionProtocolHighest = EncryptionProtocol::none;
|
|
|
|
static const EncryptionProtocol EncryptionProtocolLowest = EncryptionProtocol::omemo2;
|
2023-01-01 17:25:51 +00:00
|
|
|
|
2020-04-03 22:28:15 +00:00
|
|
|
}
|