gloox
1.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
src
gloox.h
1
/*
2
Copyright (c) 2005-2009 by Jakob Schroeter <js@camaya.net>
3
This file is part of the gloox library. http://camaya.net/gloox
4
5
This software is distributed under a license. The full license
6
agreement can be found in the file LICENSE in this distribution.
7
This software may not be copied, modified, sold or distributed
8
other than expressed in the named license agreement.
9
10
This software is distributed without any warranty.
11
*/
12
345
#ifndef GLOOX_H__
346
#define GLOOX_H__
347
348
#include "macros.h"
349
350
#include <string>
351
#include <list>
352
#include <map>
353
360
namespace
gloox
361
{
363
GLOOX_API
extern
const
std::string
XMLNS_CLIENT
;
364
366
GLOOX_API
extern
const
std::string
XMLNS_COMPONENT_ACCEPT
;
367
369
GLOOX_API
extern
const
std::string
XMLNS_COMPONENT_CONNECT
;
370
372
GLOOX_API
extern
const
std::string
XMLNS_DISCO_INFO
;
373
375
GLOOX_API
extern
const
std::string
XMLNS_DISCO_ITEMS
;
376
378
GLOOX_API
extern
const
std::string
XMLNS_DISCO_PUBLISH
;
379
381
GLOOX_API
extern
const
std::string
XMLNS_ADHOC_COMMANDS
;
382
384
GLOOX_API
extern
const
std::string
XMLNS_COMPRESSION
;
385
387
GLOOX_API
extern
const
std::string
XMLNS_OFFLINE
;
388
390
GLOOX_API
extern
const
std::string
XMLNS_CHAT_STATES
;
391
393
GLOOX_API
extern
const
std::string
XMLNS_AMP
;
394
396
GLOOX_API
extern
const
std::string
XMLNS_IBB
;
397
399
GLOOX_API
extern
const
std::string
XMLNS_FEATURE_NEG
;
400
402
GLOOX_API
extern
const
std::string
XMLNS_CHATNEG
;
403
405
GLOOX_API
extern
const
std::string
XMLNS_XHTML_IM
;
406
408
GLOOX_API
extern
const
std::string
XMLNS_DELAY
;
409
411
GLOOX_API
extern
const
std::string
XMLNS_ROSTER
;
412
414
GLOOX_API
extern
const
std::string
XMLNS_VERSION
;
415
417
GLOOX_API
extern
const
std::string
XMLNS_REGISTER
;
418
420
GLOOX_API
extern
const
std::string
XMLNS_PRIVACY
;
421
423
GLOOX_API
extern
const
std::string
XMLNS_AUTH
;
424
426
GLOOX_API
extern
const
std::string
XMLNS_PRIVATE_XML
;
427
429
GLOOX_API
extern
const
std::string
XMLNS_LAST
;
430
432
GLOOX_API
extern
const
std::string
XMLNS_SEARCH
;
433
435
GLOOX_API
extern
const
std::string
XMLNS_IQ_OOB
;
436
438
GLOOX_API
extern
const
std::string
XMLNS_X_DATA
;
439
441
GLOOX_API
extern
const
std::string
XMLNS_X_EVENT
;
442
444
GLOOX_API
extern
const
std::string
XMLNS_X_OOB
;
445
447
GLOOX_API
extern
const
std::string
XMLNS_X_DELAY
;
448
450
GLOOX_API
extern
const
std::string
XMLNS_X_GPGSIGNED
;
451
453
GLOOX_API
extern
const
std::string
XMLNS_X_GPGENCRYPTED
;
454
456
GLOOX_API
extern
const
std::string
XMLNS_VCARD_TEMP
;
457
459
GLOOX_API
extern
const
std::string
XMLNS_X_VCARD_UPDATE
;
460
462
GLOOX_API
extern
const
std::string
XMLNS_BOOKMARKS
;
463
465
GLOOX_API
extern
const
std::string
XMLNS_ANNOTATIONS
;
466
468
GLOOX_API
extern
const
std::string
XMLNS_ROSTER_DELIMITER
;
469
471
GLOOX_API
extern
const
std::string
XMLNS_XMPP_PING
;
472
474
GLOOX_API
extern
const
std::string
XMLNS_SI
;
475
477
GLOOX_API
extern
const
std::string
XMLNS_SI_FT
;
478
480
GLOOX_API
extern
const
std::string
XMLNS_BYTESTREAMS
;
481
483
GLOOX_API
extern
const
std::string
XMLNS_MUC
;
484
486
GLOOX_API
extern
const
std::string
XMLNS_MUC_USER
;
487
489
GLOOX_API
extern
const
std::string
XMLNS_MUC_ADMIN
;
490
492
GLOOX_API
extern
const
std::string
XMLNS_MUC_UNIQUE
;
493
495
GLOOX_API
extern
const
std::string
XMLNS_MUC_OWNER
;
496
498
GLOOX_API
extern
const
std::string
XMLNS_MUC_ROOMINFO
;
499
501
GLOOX_API
extern
const
std::string
XMLNS_MUC_ROOMS
;
502
504
GLOOX_API
extern
const
std::string
XMLNS_MUC_REQUEST
;
505
507
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB
;
508
510
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_ERRORS
;
511
513
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_EVENT
;
514
516
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_OWNER
;
517
519
GLOOX_API
extern
const
std::string
XMLNS_CAPS
;
520
522
GLOOX_API
extern
const
std::string
XMLNS_FT_FASTMODE
;
523
525
GLOOX_API
extern
const
std::string
XMLNS_STREAM
;
526
528
GLOOX_API
extern
const
std::string
XMLNS_XMPP_STREAM
;
529
531
GLOOX_API
extern
const
std::string
XMLNS_XMPP_STANZAS
;
532
534
GLOOX_API
extern
const
std::string
XMLNS_STREAM_TLS
;
535
537
GLOOX_API
extern
const
std::string
XMLNS_STREAM_SASL
;
538
540
GLOOX_API
extern
const
std::string
XMLNS_STREAM_BIND
;
541
543
GLOOX_API
extern
const
std::string
XMLNS_STREAM_SESSION
;
544
546
GLOOX_API
extern
const
std::string
XMLNS_STREAM_IQAUTH
;
547
549
GLOOX_API
extern
const
std::string
XMLNS_STREAM_IQREGISTER
;
550
552
GLOOX_API
extern
const
std::string
XMLNS_STREAM_COMPRESS
;
553
555
GLOOX_API
extern
const
std::string
XMLNS_HTTPBIND
;
556
558
GLOOX_API
extern
const
std::string
XMLNS_XMPP_BOSH
;
559
561
GLOOX_API
extern
const
std::string
XMLNS_RECEIPTS
;
562
564
GLOOX_API
extern
const
std::string
XMLNS_NICKNAME
;
565
567
GLOOX_API
extern
const
std::string
XMLNS_JINGLE
;
568
570
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_AUDIO_RTP
;
571
573
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_ICE_UDP
;
574
576
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_RAW_UDP
;
577
579
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_VIDEO_RTP
;
580
582
GLOOX_API
extern
const
std::string
XMLNS_SHIM
;
583
585
GLOOX_API
extern
const
std::string
XMLNS_ATTENTION
;
586
587
589
GLOOX_API
extern
const
std::string
XMPP_STREAM_VERSION_MAJOR
;
590
592
GLOOX_API
extern
const
std::string
XMPP_STREAM_VERSION_MINOR
;
593
595
GLOOX_API
extern
const
std::string
GLOOX_VERSION
;
596
598
GLOOX_API
extern
const
std::string
GLOOX_CAPS_NODE
;
599
601
GLOOX_API
extern
const
std::string
XMLNS
;
602
604
GLOOX_API
extern
const
std::string
TYPE
;
605
607
GLOOX_API
extern
const
std::string
EmptyString
;
608
612
enum
ConnectionState
613
{
614
StateDisconnected
,
615
StateConnecting
,
616
StateConnected
618
};
619
624
enum
StreamEvent
625
{
626
StreamEventConnecting
,
627
StreamEventEncryption
,
628
StreamEventCompression
,
629
StreamEventAuthentication
,
630
StreamEventSessionInit
,
631
StreamEventResourceBinding
,
632
StreamEventSessionCreation
,
634
StreamEventRoster
,
635
StreamEventFinished
636
};
637
641
enum
ConnectionError
642
{
643
ConnNoError
,
644
ConnStreamError
,
646
ConnStreamVersionError
,
647
ConnStreamClosed
,
648
ConnProxyAuthRequired
,
650
ConnProxyAuthFailed
,
652
ConnProxyNoSupportedAuth
,
654
ConnIoError
,
655
ConnParseError
,
656
ConnConnectionRefused
,
658
ConnDnsError
,
660
ConnOutOfMemory
,
661
ConnNoSupportedAuth
,
663
ConnTlsFailed
,
665
ConnTlsNotAvailable
,
668
ConnCompressionFailed
,
670
ConnAuthenticationFailed
,
672
ConnUserDisconnected
,
673
ConnNotConnected
674
};
675
679
enum
TLSPolicy
680
{
681
TLSDisabled
,
682
TLSOptional
,
683
TLSRequired
686
};
687
691
enum
StreamFeature
692
{
693
StreamFeatureBind
= 1,
694
StreamFeatureUnbind
= 2,
695
StreamFeatureSession
= 4,
696
StreamFeatureStartTls
= 8,
697
StreamFeatureIqRegister
= 16,
699
StreamFeatureIqAuth
= 32,
701
StreamFeatureCompressZlib
= 64,
703
StreamFeatureCompressDclz
= 128
705
// SASLMechanism below must be adjusted accordingly.
706
};
707
711
// must be adjusted with changes to StreamFeature enum above
712
enum
SaslMechanism
713
{
714
SaslMechNone
= 0,
715
SaslMechDigestMd5
= 256,
716
SaslMechPlain
= 512,
717
SaslMechAnonymous
= 1024,
719
SaslMechExternal
= 2048,
720
SaslMechGssapi
= 4096,
721
SaslMechNTLM
= 8192,
722
SaslMechAll
= 65535
723
};
724
728
enum
StreamError
729
{
730
StreamErrorBadFormat
,
736
StreamErrorBadNamespacePrefix
,
739
StreamErrorConflict
,
742
StreamErrorConnectionTimeout
,
744
StreamErrorHostGone
,
747
StreamErrorHostUnknown
,
750
StreamErrorImproperAddressing
,
752
StreamErrorInternalServerError
,
755
StreamErrorInvalidFrom
,
759
StreamErrorInvalidId
,
761
StreamErrorInvalidNamespace
,
765
StreamErrorInvalidXml
,
767
StreamErrorNotAuthorized
,
771
StreamErrorPolicyViolation
,
774
StreamErrorRemoteConnectionFailed
,
776
StreamErrorResourceConstraint
,
778
StreamErrorRestrictedXml
,
781
StreamErrorSeeOtherHost
,
786
StreamErrorSystemShutdown
,
788
StreamErrorUndefinedCondition
,
791
StreamErrorUnsupportedEncoding
,
794
StreamErrorUnsupportedStanzaType
,
796
StreamErrorUnsupportedVersion
,
800
StreamErrorXmlNotWellFormed
,
802
StreamErrorUndefined
805
};
806
810
enum
StanzaErrorType
811
{
812
StanzaErrorTypeAuth
,
813
StanzaErrorTypeCancel
,
814
StanzaErrorTypeContinue
,
815
StanzaErrorTypeModify
,
817
StanzaErrorTypeWait
,
818
StanzaErrorTypeUndefined
819
};
820
825
enum
StanzaError
826
{
827
828
StanzaErrorBadRequest
,
832
StanzaErrorConflict
,
835
StanzaErrorFeatureNotImplemented
,
838
StanzaErrorForbidden
,
840
StanzaErrorGone
,
844
StanzaErrorInternalServerError
,
847
StanzaErrorItemNotFound
,
849
StanzaErrorJidMalformed
,
854
StanzaErrorNotAcceptable
,
858
StanzaErrorNotAllowed
,
860
StanzaErrorNotAuthorized
,
863
StanzaErrorNotModified
,
865
StanzaErrorPaymentRequired
,
868
StanzaErrorRecipientUnavailable
,
873
StanzaErrorRedirect
,
878
StanzaErrorRegistrationRequired
,
881
StanzaErrorRemoteServerNotFound
,
884
StanzaErrorRemoteServerTimeout
,
888
StanzaErrorResourceConstraint
,
890
StanzaErrorServiceUnavailable
,
892
StanzaErrorSubscribtionRequired
,
895
StanzaErrorUndefinedCondition
,
899
StanzaErrorUnexpectedRequest
,
902
StanzaErrorUnknownSender
,
906
StanzaErrorUndefined
907
};
908
912
// enum Presence
913
// {
914
// PresenceUnknown, /**< Unknown status. */
915
// PresenceAvailable, /**< The entity or resource is online and available. */
916
// PresenceChat, /**< The entity or resource is actively interested in chatting. */
917
// PresenceAway, /**< The entity or resource is temporarily away. */
918
// PresenceDnd, /**< The entity or resource is busy (dnd = "Do Not Disturb"). */
919
// PresenceXa, /**< The entity or resource is away for an extended period (xa =
920
// * "eXtended Away"). */
921
// PresenceUnavailable /**< The entity or resource is offline. */
922
// };
923
927
enum
CertStatus
928
{
929
CertOk
= 0,
930
CertInvalid
= 1,
931
CertSignerUnknown
= 2,
932
CertRevoked
= 4,
933
CertExpired
= 8,
934
CertNotActive
= 16,
935
CertWrongPeer
= 32,
937
CertSignerNotCa
= 64
938
};
939
943
struct
CertInfo
944
{
945
int
status
;
946
bool
chain
;
947
std::string
issuer
;
948
std::string
server
;
949
int
date_from
;
951
int
date_to
;
953
std::string
protocol
;
954
std::string
cipher
;
955
std::string
mac
;
956
std::string
compression
;
957
};
958
962
enum
AuthenticationError
963
{
964
AuthErrorUndefined
,
965
SaslAborted
,
968
SaslIncorrectEncoding
,
973
SaslInvalidAuthzid
,
978
SaslInvalidMechanism
,
981
SaslMalformedRequest
,
985
SaslMechanismTooWeak
,
989
SaslNotAuthorized
,
993
SaslTemporaryAuthFailure
,
996
NonSaslConflict
,
997
NonSaslNotAcceptable
,
998
NonSaslNotAuthorized
999
};
1000
1004
enum
LogArea
1005
{
1006
LogAreaClassParser
= 0x000001,
1007
LogAreaClassConnectionTCPBase
= 0x000002,
1008
LogAreaClassClient
= 0x000004,
1009
LogAreaClassClientbase
= 0x000008,
1010
LogAreaClassComponent
= 0x000010,
1011
LogAreaClassDns
= 0x000020,
1012
LogAreaClassConnectionHTTPProxy
= 0x000040,
1013
LogAreaClassConnectionSOCKS5Proxy
= 0x000080,
1014
LogAreaClassConnectionTCPClient
= 0x000100,
1015
LogAreaClassConnectionTCPServer
= 0x000200,
1016
LogAreaClassS5BManager
= 0x000400,
1017
LogAreaClassSOCKS5Bytestream
= 0x000800,
1018
LogAreaClassConnectionBOSH
= 0x001000,
1019
LogAreaClassConnectionTLS
= 0x002000,
1020
LogAreaAllClasses
= 0x01FFFF,
1021
LogAreaXmlIncoming
= 0x020000,
1022
LogAreaXmlOutgoing
= 0x040000,
1023
LogAreaUser
= 0x800000,
1024
LogAreaAll
= 0xFFFFFF
1025
};
1026
1030
enum
LogLevel
1031
{
1032
LogLevelDebug
,
1033
LogLevelWarning
,
1034
LogLevelError
1035
};
1036
1040
enum
MessageEventType
1041
{
1042
MessageEventOffline
= 1,
1044
MessageEventDelivered
= 2,
1046
MessageEventDisplayed
= 4,
1047
MessageEventComposing
= 8,
1048
MessageEventInvalid
= 16,
1049
MessageEventCancel
= 32
1050
};
1051
1055
enum
ChatStateType
1056
{
1057
ChatStateActive
= 1,
1058
ChatStateComposing
= 2,
1059
ChatStatePaused
= 4,
1060
ChatStateInactive
= 8,
1061
ChatStateGone
= 16,
1063
ChatStateInvalid
= 32
1064
};
1065
1069
enum
ResourceBindError
1070
{
1071
RbErrorUnknownError
,
1072
RbErrorBadRequest
,
1073
RbErrorNotAllowed
,
1074
RbErrorConflict
1075
};
1076
1080
enum
SessionCreateError
1081
{
1082
ScErrorUnknownError
,
1083
ScErrorInternalServerError
,
1084
ScErrorForbidden
,
1085
ScErrorConflict
1087
};
1088
1092
enum
MessageSessionFilter
1093
{
1094
FilterMessageEvents
= 1,
1095
FilterChatStates
= 2
1096
};
1097
1101
enum
MUCRoomAffiliation
1102
{
1103
AffiliationNone
,
1104
AffiliationOutcast
,
1105
AffiliationMember
,
1106
AffiliationOwner
,
1107
AffiliationAdmin
,
1108
AffiliationInvalid
1109
};
1110
1114
enum
MUCRoomRole
1115
{
1116
RoleNone
,
1117
RoleVisitor
,
1118
RoleParticipant
,
1119
RoleModerator
,
1120
RoleInvalid
1121
};
1122
1126
enum
MUCRoomFlag
1127
{
1128
FlagPasswordProtected
= 1<< 1,
1129
FlagPublicLogging
= 1<< 2,
1130
FlagPublicLoggingOff
= 1<< 3,
1131
FlagHidden
= 1<< 4,
1132
FlagMembersOnly
= 1<< 5,
1133
FlagModerated
= 1<< 6,
1134
FlagNonAnonymous
= 1<< 7,
1135
FlagOpen
= 1<< 8,
1136
FlagPersistent
= 1<< 9,
1137
FlagPublic
= 1<<10,
1138
FlagSemiAnonymous
= 1<<11,
1139
FlagTemporary
= 1<<12,
1140
FlagUnmoderated
= 1<<13,
1141
FlagUnsecured
= 1<<14,
1142
FlagFullyAnonymous
= 1<<15
1143
// keep in sync with MUCUserFlag below
1144
};
1145
1149
// keep in sync with MUCRoomFlag above
1150
enum
MUCUserFlag
1151
{
1152
UserSelf
= 1<<16,
1153
UserNickChanged
= 1<<17,
1154
UserKicked
= 1<<18,
1155
UserBanned
= 1<<19,
1156
UserAffiliationChanged
= 1<<20,
1158
UserRoomDestroyed
= 1<<21,
1159
UserNickAssigned
= 1<<22,
1161
UserNewRoom
= 1<<23,
1162
UserMembershipRequired
= 1<<24,
1165
UserRoomShutdown
= 1<<25,
1167
UserAffiliationChangedWNR
= 1<<26
1169
};
1170
1174
enum
SubscriptionType
1175
{
1176
S10nNone
,
1178
S10nNoneOut
,
1181
S10nNoneIn
,
1186
S10nNoneOutIn
,
1190
S10nTo
,
1191
S10nToIn
,
1193
S10nFrom
,
1194
S10nFromOut
,
1196
S10nBoth
1197
};
1198
1202
typedef
std::list<std::string>
StringList
;
1203
1207
typedef
std::list<std::string*>
StringPList
;
1208
1212
typedef
std::map<std::string, std::string>
StringMap
;
1213
1217
typedef
std::multimap<std::string, std::string>
StringMultiMap
;
1218
1219
class
StanzaExtension
;
1223
typedef
std::list<const StanzaExtension*>
StanzaExtensionList
;
1224
}
1225
1226
extern
"C"
1227
{
1228
GLOOX_API
const
char
* gloox_version();
1229
}
1230
1231
#endif // GLOOX_H__
Generated on Thu Jun 27 2013 13:02:36 for gloox by
1.8.1.2