17 #include "clientbase.h"
111 Client(
const std::string& server );
123 Client(
const JID& jid,
const std::string& password,
int port = -1 );
145 bool bindResource(
const std::string& resource )
146 {
return bindOperation( resource,
true ); }
157 bool selectResource(
const std::string& resource );
175 bool unbindResource(
const std::string& resource )
176 {
return bindOperation( resource,
false ); }
182 const std::string&
resource()
const {
return m_jid.resource(); }
188 int priority()
const {
return m_presence.priority(); }
194 void setUsername(
const std::string &username );
200 void setResource(
const std::string &resource ) { m_jid.setResource( resource ); }
255 GLOOX_DEPRECATED
void setForceNonSasl(
bool force =
true ) { m_forceNonSasl = force; }
262 void disableRoster();
307 ResourceBind(
const std::string& resource,
bool bind =
true );
313 ResourceBind(
const Tag* tag );
324 const std::string& resource()
const {
return m_resource; }
330 const JID& jid()
const {
return m_jid; }
337 bool unbind()
const {
return !m_bind; }
340 virtual const std::string& filterString()
const;
343 virtual StanzaExtension* newInstance(
const Tag* tag )
const
345 return new ResourceBind( tag );
349 virtual Tag* tag()
const;
352 virtual StanzaExtension* clone()
const
354 return new ResourceBind( *
this );
358 std::string m_resource;
369 class SessionCreation :
public StanzaExtension
381 ~SessionCreation() {}
384 virtual const std::string& filterString()
const {
return EmptyString; }
387 virtual StanzaExtension* newInstance(
const Tag* tag )
const
388 { (void)tag;
return 0; }
391 virtual Tag* tag()
const;
394 virtual StanzaExtension* clone()
const
399 virtual void handleStartNode(
const Tag* ) {}
400 virtual bool handleNormalNode( Tag* tag );
402 virtual void handleIqIDForward(
const IQ& iq,
int context );
404 int getStreamFeatures( Tag* tag );
405 int getSaslMechs( Tag* tag );
406 int getCompressionMethods( Tag* tag );
407 void processResourceBind(
const IQ& iq );
408 void processCreateSession(
const IQ& iq );
409 void sendPresence( Presence& pres );
410 void createSession();
413 virtual void rosterFilled();
414 virtual void cleanup();
415 bool bindOperation(
const std::string& resource,
bool bind );
421 CtxResourceBind = 1000,
423 CtxSessionEstablishment
426 RosterManager* m_rosterManager;
431 bool m_resourceBound;
435 int m_streamFeatures;