gloox
1.1-svn
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
346
#ifndef GLOOX_H__
347
#define GLOOX_H__
348
349
#include "macros.h"
350
351
#include <string>
352
#include <list>
353
#include <map>
354
361
namespace
gloox
362
{
364
GLOOX_API
extern
const
std::string
XMLNS_CLIENT
;
365
367
GLOOX_API
extern
const
std::string
XMLNS_COMPONENT_ACCEPT
;
368
370
GLOOX_API
extern
const
std::string
XMLNS_COMPONENT_CONNECT
;
371
373
GLOOX_API
extern
const
std::string
XMLNS_DISCO_INFO
;
374
376
GLOOX_API
extern
const
std::string
XMLNS_DISCO_ITEMS
;
377
379
GLOOX_API
extern
const
std::string
XMLNS_DISCO_PUBLISH
;
380
382
GLOOX_API
extern
const
std::string
XMLNS_ADHOC_COMMANDS
;
383
385
GLOOX_API
extern
const
std::string
XMLNS_COMPRESSION
;
386
388
GLOOX_API
extern
const
std::string
XMLNS_OFFLINE
;
389
391
GLOOX_API
extern
const
std::string
XMLNS_CHAT_STATES
;
392
394
GLOOX_API
extern
const
std::string
XMLNS_AMP
;
395
397
GLOOX_API
extern
const
std::string
XMLNS_IBB
;
398
400
GLOOX_API
extern
const
std::string
XMLNS_FEATURE_NEG
;
401
403
GLOOX_API
extern
const
std::string
XMLNS_CHATNEG
;
404
406
GLOOX_API
extern
const
std::string
XMLNS_XHTML_IM
;
407
409
GLOOX_API
extern
const
std::string
XMLNS_DELAY
;
410
412
GLOOX_API
extern
const
std::string
XMLNS_ROSTER
;
413
415
GLOOX_API
extern
const
std::string
XMLNS_VERSION
;
416
418
GLOOX_API
extern
const
std::string
XMLNS_REGISTER
;
419
421
GLOOX_API
extern
const
std::string
XMLNS_PRIVACY
;
422
424
GLOOX_API
extern
const
std::string
XMLNS_AUTH
;
425
427
GLOOX_API
extern
const
std::string
XMLNS_PRIVATE_XML
;
428
430
GLOOX_API
extern
const
std::string
XMLNS_LAST
;
431
433
GLOOX_API
extern
const
std::string
XMLNS_SEARCH
;
434
436
GLOOX_API
extern
const
std::string
XMLNS_IQ_OOB
;
437
439
GLOOX_API
extern
const
std::string
XMLNS_X_DATA
;
440
442
GLOOX_API
extern
const
std::string
XMLNS_X_EVENT
;
443
445
GLOOX_API
extern
const
std::string
XMLNS_X_OOB
;
446
448
GLOOX_API
extern
const
std::string
XMLNS_X_DELAY
;
449
451
GLOOX_API
extern
const
std::string
XMLNS_X_GPGSIGNED
;
452
454
GLOOX_API
extern
const
std::string
XMLNS_X_GPGENCRYPTED
;
455
457
GLOOX_API
extern
const
std::string
XMLNS_VCARD_TEMP
;
458
460
GLOOX_API
extern
const
std::string
XMLNS_X_VCARD_UPDATE
;
461
463
GLOOX_API
extern
const
std::string
XMLNS_BOOKMARKS
;
464
466
GLOOX_API
extern
const
std::string
XMLNS_ANNOTATIONS
;
467
469
GLOOX_API
extern
const
std::string
XMLNS_ROSTER_DELIMITER
;
470
472
GLOOX_API
extern
const
std::string
XMLNS_XMPP_PING
;
473
475
GLOOX_API
extern
const
std::string
XMLNS_SI
;
476
478
GLOOX_API
extern
const
std::string
XMLNS_SI_FT
;
479
481
GLOOX_API
extern
const
std::string
XMLNS_BYTESTREAMS
;
482
484
GLOOX_API
extern
const
std::string
XMLNS_MUC
;
485
487
GLOOX_API
extern
const
std::string
XMLNS_MUC_USER
;
488
490
GLOOX_API
extern
const
std::string
XMLNS_MUC_ADMIN
;
491
493
GLOOX_API
extern
const
std::string
XMLNS_MUC_UNIQUE
;
494
496
GLOOX_API
extern
const
std::string
XMLNS_MUC_OWNER
;
497
499
GLOOX_API
extern
const
std::string
XMLNS_MUC_ROOMINFO
;
500
502
GLOOX_API
extern
const
std::string
XMLNS_MUC_ROOMS
;
503
505
GLOOX_API
extern
const
std::string
XMLNS_MUC_REQUEST
;
506
508
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB
;
509
511
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_ERRORS
;
512
514
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_EVENT
;
515
517
GLOOX_API
extern
const
std::string
XMLNS_PUBSUB_OWNER
;
518
520
GLOOX_API
extern
const
std::string
XMLNS_CAPS
;
521
523
GLOOX_API
extern
const
std::string
XMLNS_FT_FASTMODE
;
524
526
GLOOX_API
extern
const
std::string
XMLNS_STREAM
;
527
529
GLOOX_API
extern
const
std::string
XMLNS_XMPP_STREAM
;
530
532
GLOOX_API
extern
const
std::string
XMLNS_XMPP_STANZAS
;
533
535
GLOOX_API
extern
const
std::string
XMLNS_STREAM_TLS
;
536
538
GLOOX_API
extern
const
std::string
XMLNS_STREAM_SASL
;
539
541
GLOOX_API
extern
const
std::string
XMLNS_STREAM_BIND
;
542
544
GLOOX_API
extern
const
std::string
XMLNS_STREAM_SESSION
;
545
547
GLOOX_API
extern
const
std::string
XMLNS_STREAM_IQAUTH
;
548
550
GLOOX_API
extern
const
std::string
XMLNS_STREAM_IQREGISTER
;
551
553
GLOOX_API
extern
const
std::string
XMLNS_STREAM_COMPRESS
;
554
556
GLOOX_API
extern
const
std::string
XMLNS_HTTPBIND
;
557
559
GLOOX_API
extern
const
std::string
XMLNS_XMPP_BOSH
;
560
562
GLOOX_API
extern
const
std::string
XMLNS_RECEIPTS
;
563
565
GLOOX_API
extern
const
std::string
XMLNS_NICKNAME
;
566
568
GLOOX_API
extern
const
std::string
XMLNS_JINGLE
;
569
571
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_ERROR
;
572
574
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_RTP
;
575
577
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_ICE_UDP
;
578
580
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_RAW_UDP
;
581
583
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_DTMF
;
584
586
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_FILE_TRANSFER
;
587
589
GLOOX_API
extern
const
std::string
XMLNS_JINGLE_XML_STREAMS
;
590
592
GLOOX_API
extern
const
std::string
XMLNS_SHIM
;
593
595
GLOOX_API
extern
const
std::string
XMLNS_ATTENTION
;
596
598
GLOOX_API
extern
const
std::string
XMLNS_RAP
;
599
601
GLOOX_API
extern
const
std::string
XMLNS_BOB
;
602
604
GLOOX_API
extern
const
std::string
XMLNS_X_CONFERENCE
;
605
606
608
GLOOX_API
extern
const
std::string
XMPP_STREAM_VERSION_MAJOR
;
609
611
GLOOX_API
extern
const
std::string
XMPP_STREAM_VERSION_MINOR
;
612
614
GLOOX_API
extern
const
std::string
GLOOX_VERSION
;
615
617
GLOOX_API
extern
const
std::string
GLOOX_CAPS_NODE
;
618
620
GLOOX_API
extern
const
std::string
XMLNS
;
621
623
GLOOX_API
extern
const
std::string
TYPE
;
624
626
GLOOX_API
extern
const
std::string
EmptyString
;
627
631
enum
ConnectionState
632
{
633
StateDisconnected
,
634
StateConnecting
,
635
StateConnected
637
};
638
643
enum
StreamEvent
644
{
645
StreamEventConnecting
,
646
StreamEventEncryption
,
647
StreamEventCompression
,
648
StreamEventAuthentication
,
649
StreamEventSessionInit
,
650
StreamEventResourceBinding
,
651
StreamEventSessionCreation
,
653
StreamEventRoster
,
654
StreamEventFinished
655
};
656
660
enum
ConnectionError
661
{
662
ConnNoError
,
663
ConnStreamError
,
665
ConnStreamVersionError
,
666
ConnStreamClosed
,
667
ConnProxyAuthRequired
,
669
ConnProxyAuthFailed
,
671
ConnProxyNoSupportedAuth
,
673
ConnIoError
,
674
ConnParseError
,
675
ConnConnectionRefused
,
677
ConnSocketError
,
678
ConnDnsError
,
680
ConnOutOfMemory
,
681
ConnNoSupportedAuth
,
683
ConnTlsFailed
,
685
ConnTlsNotAvailable
,
688
ConnCompressionFailed
,
690
ConnCompressionNotAvailable
,
692
ConnAuthenticationFailed
,
694
ConnUserDisconnected
,
695
ConnNotConnected
696
};
697
701
enum
TLSPolicy
702
{
703
TLSDisabled
,
704
TLSOptional
,
705
TLSRequired
708
};
709
713
enum
StreamFeature
714
{
715
StreamFeatureBind
= 1,
716
StreamFeatureUnbind
= 2,
717
StreamFeatureSession
= 4,
718
StreamFeatureStartTls
= 8,
719
StreamFeatureIqRegister
= 16,
721
StreamFeatureIqAuth
= 32,
723
StreamFeatureCompressZlib
= 64,
725
StreamFeatureCompressDclz
= 128
727
// SASLMechanism below must be adjusted accordingly.
728
};
729
733
// must be adjusted with changes to StreamFeature enum above
734
enum
SaslMechanism
735
{
736
SaslMechNone
= 0,
737
SaslMechDigestMd5
= 256,
738
SaslMechPlain
= 512,
739
SaslMechAnonymous
= 1024,
741
SaslMechExternal
= 2048,
742
SaslMechGssapi
= 4096,
743
SaslMechNTLM
= 8192,
744
SaslMechAll
= 65535
745
};
746
750
enum
StreamError
751
{
752
StreamErrorBadFormat
,
758
StreamErrorBadNamespacePrefix
,
761
StreamErrorConflict
,
764
StreamErrorConnectionTimeout
,
766
StreamErrorHostGone
,
769
StreamErrorHostUnknown
,
772
StreamErrorImproperAddressing
,
774
StreamErrorInternalServerError
,
777
StreamErrorInvalidFrom
,
781
StreamErrorInvalidId
,
783
StreamErrorInvalidNamespace
,
787
StreamErrorInvalidXml
,
789
StreamErrorNotAuthorized
,
793
StreamErrorPolicyViolation
,
796
StreamErrorRemoteConnectionFailed
,
798
StreamErrorResourceConstraint
,
800
StreamErrorRestrictedXml
,
803
StreamErrorSeeOtherHost
,
808
StreamErrorSystemShutdown
,
810
StreamErrorUndefinedCondition
,
813
StreamErrorUnsupportedEncoding
,
816
StreamErrorUnsupportedStanzaType
,
818
StreamErrorUnsupportedVersion
,
822
StreamErrorXmlNotWellFormed
,
824
StreamErrorUndefined
827
};
828
832
enum
StanzaErrorType
833
{
834
StanzaErrorTypeAuth
,
835
StanzaErrorTypeCancel
,
836
StanzaErrorTypeContinue
,
837
StanzaErrorTypeModify
,
839
StanzaErrorTypeWait
,
840
StanzaErrorTypeUndefined
841
};
842
847
enum
StanzaError
848
{
849
850
StanzaErrorBadRequest
,
854
StanzaErrorConflict
,
857
StanzaErrorFeatureNotImplemented
,
860
StanzaErrorForbidden
,
862
StanzaErrorGone
,
866
StanzaErrorInternalServerError
,
869
StanzaErrorItemNotFound
,
871
StanzaErrorJidMalformed
,
876
StanzaErrorNotAcceptable
,
880
StanzaErrorNotAllowed
,
882
StanzaErrorNotAuthorized
,
885
StanzaErrorNotModified
,
887
StanzaErrorPaymentRequired
,
890
StanzaErrorRecipientUnavailable
,
895
StanzaErrorRedirect
,
900
StanzaErrorRegistrationRequired
,
903
StanzaErrorRemoteServerNotFound
,
906
StanzaErrorRemoteServerTimeout
,
910
StanzaErrorResourceConstraint
,
912
StanzaErrorServiceUnavailable
,
914
StanzaErrorSubscribtionRequired
,
917
StanzaErrorUndefinedCondition
,
921
StanzaErrorUnexpectedRequest
,
924
StanzaErrorUnknownSender
,
928
StanzaErrorUndefined
929
};
930
934
// enum Presence
935
// {
936
// PresenceUnknown, /**< Unknown status. */
937
// PresenceAvailable, /**< The entity or resource is online and available. */
938
// PresenceChat, /**< The entity or resource is actively interested in chatting. */
939
// PresenceAway, /**< The entity or resource is temporarily away. */
940
// PresenceDnd, /**< The entity or resource is busy (dnd = "Do Not Disturb"). */
941
// PresenceXa, /**< The entity or resource is away for an extended period (xa =
942
// * "eXtended Away"). */
943
// PresenceUnavailable /**< The entity or resource is offline. */
944
// };
945
949
enum
CertStatus
950
{
951
CertOk
= 0,
952
CertInvalid
= 1,
953
CertSignerUnknown
= 2,
954
CertRevoked
= 4,
955
CertExpired
= 8,
956
CertNotActive
= 16,
957
CertWrongPeer
= 32,
959
CertSignerNotCa
= 64
960
};
961
965
struct
CertInfo
966
{
967
int
status
;
968
bool
chain
;
969
std::string
issuer
;
970
std::string
server
;
971
int
date_from
;
973
int
date_to
;
975
std::string
protocol
;
976
std::string
cipher
;
977
std::string
mac
;
978
std::string
compression
;
979
};
980
984
enum
AuthenticationError
985
{
986
AuthErrorUndefined
,
987
SaslAborted
,
990
SaslIncorrectEncoding
,
995
SaslInvalidAuthzid
,
1000
SaslInvalidMechanism
,
1003
SaslMalformedRequest
,
1007
SaslMechanismTooWeak
,
1011
SaslNotAuthorized
,
1015
SaslTemporaryAuthFailure
,
1018
NonSaslConflict
,
1019
NonSaslNotAcceptable
,
1020
NonSaslNotAuthorized
1021
};
1022
1026
enum
LogArea
1027
{
1028
LogAreaClassParser
= 0x000001,
1029
LogAreaClassConnectionTCPBase
= 0x000002,
1030
LogAreaClassClient
= 0x000004,
1031
LogAreaClassClientbase
= 0x000008,
1032
LogAreaClassComponent
= 0x000010,
1033
LogAreaClassDns
= 0x000020,
1034
LogAreaClassConnectionHTTPProxy
= 0x000040,
1035
LogAreaClassConnectionSOCKS5Proxy
= 0x000080,
1036
LogAreaClassConnectionTCPClient
= 0x000100,
1037
LogAreaClassConnectionTCPServer
= 0x000200,
1038
LogAreaClassS5BManager
= 0x000400,
1039
LogAreaClassSOCKS5Bytestream
= 0x000800,
1040
LogAreaClassConnectionBOSH
= 0x001000,
1041
LogAreaClassConnectionTLS
= 0x002000,
1042
LogAreaAllClasses
= 0x01FFFF,
1043
LogAreaXmlIncoming
= 0x020000,
1044
LogAreaXmlOutgoing
= 0x040000,
1045
LogAreaUser
= 0x800000,
1046
LogAreaAll
= 0xFFFFFF
1047
};
1048
1052
enum
LogLevel
1053
{
1054
LogLevelDebug
,
1055
LogLevelWarning
,
1056
LogLevelError
1057
};
1058
1062
enum
MessageEventType
1063
{
1064
MessageEventOffline
= 1,
1066
MessageEventDelivered
= 2,
1068
MessageEventDisplayed
= 4,
1069
MessageEventComposing
= 8,
1070
MessageEventInvalid
= 16,
1071
MessageEventCancel
= 32
1072
};
1073
1077
enum
ChatStateType
1078
{
1079
ChatStateActive
= 1,
1080
ChatStateComposing
= 2,
1081
ChatStatePaused
= 4,
1082
ChatStateInactive
= 8,
1083
ChatStateGone
= 16,
1085
ChatStateInvalid
= 32
1086
};
1087
1091
enum
ResourceBindError
1092
{
1093
RbErrorUnknownError
,
1094
RbErrorBadRequest
,
1095
RbErrorNotAllowed
,
1096
RbErrorConflict
1097
};
1098
1102
enum
SessionCreateError
1103
{
1104
ScErrorUnknownError
,
1105
ScErrorInternalServerError
,
1106
ScErrorForbidden
,
1107
ScErrorConflict
1109
};
1110
1114
enum
MessageSessionFilter
1115
{
1116
FilterMessageEvents
= 1,
1117
FilterChatStates
= 2
1118
};
1119
1123
enum
MUCRoomAffiliation
1124
{
1125
AffiliationNone
,
1126
AffiliationOutcast
,
1127
AffiliationMember
,
1128
AffiliationOwner
,
1129
AffiliationAdmin
,
1130
AffiliationInvalid
1131
};
1132
1136
enum
MUCRoomRole
1137
{
1138
RoleNone
,
1139
RoleVisitor
,
1140
RoleParticipant
,
1141
RoleModerator
,
1142
RoleInvalid
1143
};
1144
1148
enum
MUCRoomFlag
1149
{
1150
FlagPasswordProtected
= 1<< 1,
1151
FlagPublicLogging
= 1<< 2,
1152
FlagPublicLoggingOff
= 1<< 3,
1153
FlagHidden
= 1<< 4,
1154
FlagMembersOnly
= 1<< 5,
1155
FlagModerated
= 1<< 6,
1156
FlagNonAnonymous
= 1<< 7,
1157
FlagOpen
= 1<< 8,
1158
FlagPersistent
= 1<< 9,
1159
FlagPublic
= 1<<10,
1160
FlagSemiAnonymous
= 1<<11,
1161
FlagTemporary
= 1<<12,
1162
FlagUnmoderated
= 1<<13,
1163
FlagUnsecured
= 1<<14,
1164
FlagFullyAnonymous
= 1<<15
1165
// keep in sync with MUCUserFlag below
1166
};
1167
1171
// keep in sync with MUCRoomFlag above
1172
enum
MUCUserFlag
1173
{
1174
UserSelf
= 1<<16,
1175
UserNickChanged
= 1<<17,
1176
UserKicked
= 1<<18,
1177
UserBanned
= 1<<19,
1178
UserAffiliationChanged
= 1<<20,
1180
UserRoomDestroyed
= 1<<21,
1181
UserNickAssigned
= 1<<22,
1183
UserNewRoom
= 1<<23,
1184
UserMembershipRequired
= 1<<24,
1187
UserRoomShutdown
= 1<<25,
1189
UserAffiliationChangedWNR
= 1<<26
1191
};
1192
1196
enum
SubscriptionType
1197
{
1198
S10nNone
,
1200
S10nNoneOut
,
1203
S10nNoneIn
,
1208
S10nNoneOutIn
,
1212
S10nTo
,
1213
S10nToIn
,
1215
S10nFrom
,
1216
S10nFromOut
,
1218
S10nBoth
1219
};
1220
1224
typedef
std::list<std::string>
StringList
;
1225
1229
typedef
std::list<std::string*>
StringPList
;
1230
1234
typedef
std::map<std::string, std::string>
StringMap
;
1235
1239
typedef
std::multimap<std::string, std::string>
StringMultiMap
;
1240
1241
class
StanzaExtension
;
1245
typedef
std::list<const StanzaExtension*>
StanzaExtensionList
;
1246
1247
}
1248
1249
extern
"C"
1250
{
1251
GLOOX_API
const
char
* gloox_version();
1252
}
1253
1254
#endif // GLOOX_H__
Generated on Thu Jun 27 2013 13:43:27 for gloox by
1.8.1.2