14 #ifndef ROSTERITEMBASE_H__
15 #define ROSTERITEMBASE_H__
48 : m_jid( jid ), m_name( name ), m_groups( groups ),
49 m_subscription(
S10nNone ), m_changed( false ), m_remove( false )
57 : m_jid( jid ), m_subscription(
S10nNone ), m_changed( false ),
70 const std::string&
jid()
const {
return m_jid; }
86 const std::string&
name()
const {
return m_name; }
98 if( subscription ==
"from" && ask.empty() )
100 else if( subscription ==
"from" && !ask.empty() )
102 else if( subscription ==
"to" && ask.empty() )
104 else if( subscription ==
"to" && !ask.empty() )
106 else if( subscription ==
"none" && ask.empty() )
108 else if( subscription ==
"none" && !ask.empty() )
110 else if( subscription ==
"both" )
147 bool remove()
const {
return m_remove; }
160 Tag* i =
new Tag(
"item" );
167 StringList::const_iterator it = m_groups.begin();
168 for( ; it != m_groups.end(); ++it )
169 new Tag( i,
"group", (*it) );
190 #endif // ROSTERITEMBASE_H__
std::list< std::string > StringList
void setGroups(const StringList &groups)
A class holding roster item data.
void setSubscription(const std::string &subscription, const std::string &ask)
const std::string & name() const
bool addAttribute(Attribute *attr)
const std::string & jid() const
virtual ~RosterItemData()
RosterItemData(const std::string &jid)
const StringList & groups() const
RosterItemData(const std::string &jid, const std::string &name, const StringList &groups)
void setName(const std::string &name)
This is an abstraction of an XML element.
SubscriptionType subscription() const