21 #include "addressee.h"
28 : mAddressee( 0 ), mIntern( false )
33 : mAddressee( 0 ),mUrl( url ), mIntern( false )
38 : mAddressee( addressee ), mIntern( true )
48 bool Agent::operator==(
const Agent &a )
const
50 if ( mIntern != a.mIntern )
57 if ( mAddressee && !a.mAddressee )
return false;
58 if ( !mAddressee && a.mAddressee )
return false;
59 if ( !mAddressee && !a.mAddressee )
return false;
60 if ( (*mAddressee) != (*a.mAddressee) )
return false;
66 bool Agent::operator!=(
const Agent &a )
const
68 return !( a == *this );
76 if ( addr.mIntern && addr.mAddressee ) {
81 *mAddressee = *(addr.mAddressee);
85 mIntern = addr.mIntern;
120 return "intern agent";
125 TQDataStream &TDEABC::operator<<( TQDataStream &s,
const Agent &agent )
127 TQ_UINT32 hasAddressee = ( agent.mAddressee != 0 );
129 s << agent.mIntern << agent.mUrl << hasAddressee;
131 s << (*agent.mAddressee);
136 TQDataStream &TDEABC::operator>>( TQDataStream &s,
Agent &agent )
138 TQ_UINT32 hasAddressee;
140 s >> agent.mIntern >> agent.mUrl >> hasAddressee;
142 if ( hasAddressee ) {
144 s >> (*agent.mAddressee);
void setAddressee(Addressee *addressee)
Sets the addressee of the agent.
void setUrl(const TQString &url)
Sets a URL for the location of the agent file.
Addressee * addressee() const
Returns the addressee object of this agent.
TQString asString() const
Returns string representation of the agent.
TQString url() const
Returns the location URL of this agent.
bool isIntern() const
Returns whether the agent is described by a URL (extern) or by a addressee (intern).
static data, shared by ALL addressee objects