gloox 1.0
|
00001 /* 00002 Copyright (c) 2007-2009 by Jakob Schroeter <js@camaya.net> 00003 This file is part of the gloox library. http://camaya.net/gloox 00004 00005 This software is distributed under a license. The full license 00006 agreement can be found in the file LICENSE in this distribution. 00007 This software may not be copied, modified, sold or distributed 00008 other than expressed in the named license agreement. 00009 00010 This software is distributed without any warranty. 00011 */ 00012 00013 #ifndef SUBSCRIPTION_H__ 00014 #define SUBSCRIPTION_H__ 00015 00016 #include "stanza.h" 00017 00018 #include <string> 00019 00020 namespace gloox 00021 { 00022 00023 class JID; 00024 00031 class GLOOX_API Subscription : public Stanza 00032 { 00033 00034 public: 00035 00036 friend class ClientBase; 00037 00041 enum S10nType 00042 { 00043 Subscribe, 00044 Subscribed, 00045 Unsubscribe, 00046 Unsubscribed, 00047 Invalid 00048 }; 00049 00057 Subscription( S10nType type, const JID& to, const std::string& status = EmptyString, 00058 const std::string& xmllang = EmptyString ); 00062 virtual ~Subscription(); 00063 00069 S10nType subtype() const { return m_subtype; } 00070 00080 const std::string status( const std::string& lang = "default" ) const 00081 { 00082 return findLang( m_stati, m_status, lang ); 00083 } 00084 00085 // reimplemented from Stanza 00086 virtual Tag* tag() const; 00087 00088 private: 00089 #ifdef SUBSCRIPTION_TEST 00090 public: 00091 #endif 00092 00096 Subscription( Tag* tag ); 00097 00098 S10nType m_subtype; 00099 StringMap* m_stati; 00100 std::string m_status; 00101 00102 }; 00103 00104 } 00105 00106 #endif // SUBSCRIPTION_H__