LeechCraft Azoth  0.6.70-15082-g543737046d
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  {
24  SOffline,
25  SOnline,
26  SAway,
27  SXA,
28  SDND,
29  SChat,
30  SInvisible,
31  SProbe,
32  SError,
33  SInvalid,
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 
69  enum AuthStatus
70  {
74  ASNone = 0x00,
75 
78  ASFrom = 0x01,
79 
82  ASTo = 0x02,
83 
86  ASBoth = 0x03,
87 
91  };
92 
97  enum ChatPartState
98  {
101  CPSNone,
102 
105  CPSActive,
106 
110  CPSInactive,
111 
115  CPSGone,
116 
119  CPSComposing,
120 
123  CPSPaused
124  };
125 
128  struct CustomStatus
129  {
132  QString Name_;
133 
136  State State_;
137 
140  QString Text_;
141  };
142 }
143 }
144 
145 Q_DECLARE_METATYPE (LC::Azoth::State)
146 Q_DECLARE_METATYPE (LC::Azoth::ChatPartState)
LC::Azoth::ASNone
@ ASNone
Definition: azothcommon.h:86
LC::Azoth::ASFrom
@ ASFrom
Definition: azothcommon.h:90
LC::Azoth::SOffline
@ SOffline
Definition: azothcommon.h:42
LC::Azoth::ASContactRequested
@ ASContactRequested
Definition: azothcommon.h:102
LC::Azoth::SDND
@ SDND
Definition: azothcommon.h:46
LC::Azoth::ASBoth
@ ASBoth
Definition: azothcommon.h:98
LC::Azoth::CPSGone
@ CPSGone
Definition: azothcommon.h:127
LC::Azoth::CustomStatus::Text_
QString Text_
The status text associated with this status.
Definition: azothcommon.h:152
LC::Azoth::SOnline
@ SOnline
Definition: azothcommon.h:43
LC::Azoth::CPSInactive
@ CPSInactive
Definition: azothcommon.h:122
LC::Azoth::CPSNone
@ CPSNone
Definition: azothcommon.h:113
LC::Azoth::ChatPartState
ChatPartState
Definition: azothcommon.h:109
LC::Azoth::SInvisible
@ SInvisible
Definition: azothcommon.h:48
LC::Azoth::SInvalid
@ SInvalid
Definition: azothcommon.h:51
LC::Azoth::SAway
@ SAway
Definition: azothcommon.h:44
LC::Azoth::IsLess
bool IsLess(State s1, State s2)
Compares two states according to the implied desire to have a conversation.
Definition: azothcommon.h:70
LC::Azoth::SChat
@ SChat
Definition: azothcommon.h:47
LC::Azoth::SProbe
@ SProbe
Definition: azothcommon.h:49
LC::Azoth::AuthStatus
AuthStatus
Definition: azothcommon.h:81
LC
Definition: activityinfo.h:13
LC::Azoth::SXA
@ SXA
Definition: azothcommon.h:45
LC::Azoth::State
State
Describes possible presence states of an account or a contact.
Definition: azothcommon.h:34
LC::Azoth::CPSPaused
@ CPSPaused
Definition: azothcommon.h:135
LC::Azoth::ASTo
@ ASTo
Definition: azothcommon.h:94
LC::Azoth::SConnecting
@ SConnecting
Definition: azothcommon.h:57
LC::Azoth::CPSActive
@ CPSActive
Definition: azothcommon.h:117
imessage.h
LC::Azoth::CustomStatus::State_
State State_
The state associated with this status.
Definition: azothcommon.h:148
LC::Azoth::CustomStatus::Name_
QString Name_
The name of this status.
Definition: azothcommon.h:144
LC::Azoth::SError
@ SError
Definition: azothcommon.h:50
LC::Azoth::CPSComposing
@ CPSComposing
Definition: azothcommon.h:131