LeechCraft Azoth  0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
azothcommon.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <QMetaType>
12 #include <interfaces/iactionsexporter.h>
14 
15 namespace LC
16 {
17 namespace Azoth
18 {
22  enum State
23  {
27  SXA,
34 
40  };
41 
58  inline bool IsLess (State s1, State s2)
59  {
60  constexpr int order [] = { 7, 3, 4, 5, 6, 1, 2, 8, 9, 10 };
61  return order [s1] < order [s2];
62  }
63 
70  {
74  ASNone = 0x00,
75 
78  ASFrom = 0x01,
79 
82  ASTo = 0x02,
83 
86  ASBoth = 0x03,
87 
91  };
92 
97  enum ChatPartState : std::uint8_t
98  {
102 
106 
111 
116 
120 
124  };
125 
129  {
132  QString Name_;
133 
137 
140  QString Text_;
141  };
142 
151  struct EntryStatus
152  {
156 
159  QString StatusString_ {};
160 
161  bool operator== (const EntryStatus& es2) const = default;
162  };
163 }
164 }
165 
166 Q_DECLARE_METATYPE (LC::Azoth::ChatPartState)
167 Q_DECLARE_METATYPE (LC::Azoth::EntryStatus)
168 Q_DECLARE_METATYPE (LC::Azoth::State)
A custom saved named status.
Definition: azothcommon.h:128
bool operator==(const EntryStatus &es2) const =default
State State_
The general state of the entry.
Definition: azothcommon.h:155
State State_
The state associated with this status.
Definition: azothcommon.h:136
QString Text_
The status text associated with this status.
Definition: azothcommon.h:140
bool IsLess(State s1, State s2)
Compares two states according to the implied desire to have a conversation.
Definition: azothcommon.h:58
QString Name_
The name of this status.
Definition: azothcommon.h:132
Describes an entry&#39;s status.
Definition: azothcommon.h:151
State
Describes possible presence states of an account or a contact.
Definition: azothcommon.h:22
QString StatusString_
The string of the entry accompanying its state.
Definition: azothcommon.h:159