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 NICKNAME_H__ 00014 #define NICKNAME_H__ 00015 00016 #include "gloox.h" 00017 #include "stanzaextension.h" 00018 00019 #include <string> 00020 00021 namespace gloox 00022 { 00023 00024 class Tag; 00025 00033 class GLOOX_API Nickname : public StanzaExtension 00034 { 00035 public: 00036 00041 Nickname( const Tag* tag ); 00042 00047 Nickname( const std::string& nick ) 00048 : StanzaExtension( ExtNickname ), m_nick( nick ) 00049 {} 00050 00054 virtual ~Nickname() {} 00055 00060 const std::string nick() const { return m_nick; } 00061 00062 // reimplemented from StanzaExtension 00063 virtual const std::string& filterString() const; 00064 00065 // reimplemented from StanzaExtension 00066 virtual StanzaExtension* newInstance( const Tag* tag ) const 00067 { 00068 return new Nickname( tag ); 00069 } 00070 00071 // reimplemented from StanzaExtension 00072 Tag* tag() const; 00073 00074 // reimplemented from StanzaExtension 00075 virtual StanzaExtension* clone() const 00076 { 00077 return new Nickname( *this ); 00078 } 00079 00080 private: 00081 std::string m_nick; 00082 00083 }; 00084 00085 } 00086 00087 #endif // NICKNAME_H__