kopete/protocols/messenger/libpapillon
connector.cpp
Go to the documentation of this file.00001 /* 00002 connector.cpp - Papillon Socket connector abstract class. 00003 00004 Copyright (c) 2006 by Michaƫl Larouche <larouche@kde.org> 00005 00006 Based on code Copyright (c) 2004 Matt Rogers <mattr@kde.org> 00007 Based on code copyright (c) 2004 SuSE Linux AG <http://www.suse.com> 00008 Based on Iris, Copyright (C) 2003 Justin Karneges <justin@affinix.com> 00009 00010 ************************************************************************* 00011 * * 00012 * This library is free software; you can redistribute it and/or * 00013 * modify it under the terms of the GNU Lesser General Public * 00014 * License as published by the Free Software Foundation; either * 00015 * version 2 of the License, or (at your option) any later version. * 00016 * * 00017 ************************************************************************* 00018 */ 00019 00020 #include "Papillon/Base/Connector" 00021 00022 namespace Papillon 00023 { 00024 00025 class Connector::Private 00026 { 00027 public: 00028 bool haveaddr; 00029 QHostAddress addr; 00030 quint16 port; 00031 }; 00032 00033 Connector::Connector(QObject *parent) 00034 :QObject(parent), d(new Private()) 00035 { 00036 setPeerAddressNone(); 00037 } 00038 00039 Connector::~Connector() 00040 { 00041 delete d; 00042 } 00043 00044 bool Connector::havePeerAddress() const 00045 { 00046 return d->haveaddr; 00047 } 00048 00049 QHostAddress Connector::peerAddress() const 00050 { 00051 return d->addr; 00052 } 00053 00054 quint16 Connector::peerPort() const 00055 { 00056 return d->port; 00057 } 00058 00059 void Connector::setPeerAddressNone() 00060 { 00061 d->haveaddr = false; 00062 d->addr = QHostAddress(); 00063 d->port = 0; 00064 } 00065 00066 void Connector::setPeerAddress(const QHostAddress &_addr, quint16 _port) 00067 { 00068 d->haveaddr = true; 00069 d->addr = _addr; 00070 d->port = _port; 00071 } 00072 00073 } 00074 00075 #include "connector.moc"
KDE 4.2 API Reference