17 #include "clientbase.h"
129 Client(
const std::string& server );
141 Client(
const JID& jid,
const std::string& password,
int port = -1 );
163 bool bindResource(
const std::string& resource )
164 {
return bindOperation( resource,
true ); }
175 bool selectResource(
const std::string& resource );
193 bool unbindResource(
const std::string& resource )
194 {
return bindOperation( resource,
false ); }
200 const std::string&
resource()
const {
return m_jid.resource(); }
213 void setStreamManagement(
bool enable =
true,
bool resume =
true );
224 void ackStreamManagement();
233 void reqStreamManagement();
239 int priority()
const {
return m_presence.priority(); }
245 void setUsername(
const std::string &username );
251 void setResource(
const std::string &resource ) { m_jid.setResource( resource ); }
306 GLOOX_DEPRECATED
void setForceNonSasl(
bool force =
true ) { m_forceNonSasl = force; }
313 void disableRoster();
361 ResourceBind(
const std::string& resource,
bool bind =
true );
367 ResourceBind(
const Tag* tag );
378 const std::string& resource()
const {
return m_resource; }
384 const JID& jid()
const {
return m_jid; }
391 bool unbind()
const {
return !m_bind; }
394 virtual const std::string& filterString()
const;
397 virtual StanzaExtension* newInstance(
const Tag* tag )
const
399 return new ResourceBind( tag );
403 virtual Tag* tag()
const;
406 virtual StanzaExtension* clone()
const
408 return new ResourceBind( *
this );
412 std::string m_resource;
423 class SessionCreation :
public StanzaExtension
435 ~SessionCreation() {}
438 virtual const std::string& filterString()
const {
return EmptyString; }
441 virtual StanzaExtension* newInstance(
const Tag* tag )
const
442 { (void)tag;
return 0; }
445 virtual Tag* tag()
const;
448 virtual StanzaExtension* clone()
const
453 virtual void handleStartNode(
const Tag* ) {}
454 virtual bool handleNormalNode( Tag* tag );
456 virtual void handleIqIDForward(
const IQ& iq,
int context );
458 int getStreamFeatures( Tag* tag );
459 int getSaslMechs( Tag* tag );
460 int getCompressionMethods( Tag* tag );
461 void processResourceBind(
const IQ& iq );
462 void processCreateSession(
const IQ& iq );
463 void sendPresence( Presence& pres );
464 void createSession();
467 virtual void rosterFilled();
468 virtual void cleanup();
469 bool bindOperation(
const std::string& resource,
bool bind );
470 void sendStreamManagement();
476 CtxResourceBind = 1000,
478 CtxSessionEstablishment
481 RosterManager* m_rosterManager;
486 bool m_resourceBound;
491 std::string m_smLocation;
496 int m_streamFeatures;