kitchensync Library API Documentation

kapabilities.cpp

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <freyther@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #include <kdebug.h>
00023 #include "kapabilities.h"
00024 
00025 using namespace KSync;
00026 
00027 class Kapabilities::KapabilitiesPrivate
00028 {
00029 public:
00030   KapabilitiesPrivate(){
00031   };
00032 };
00033 
00034 Kapabilities::Kapabilities()
00035 {
00036     //d = 0;
00037     //d = new KapabilitiesPrivate;
00038     m_push = false;
00039     m_needConnection = false;
00040     m_listdir = false;
00041     m_needsIp = false;
00042     m_needsSrcIp = false;
00043     m_needsDestIp = false;
00044     m_canHandle = false;
00045     m_needsAuthent=false;
00046     m_meta = false;
00047     m_supMeta = false;
00048     m_needsNet = true;
00049     m_current = -1;
00050     m_needsName = false;
00051 }
00052 Kapabilities::Kapabilities(const Kapabilities &kap )
00053     //: //d( 0 )
00054 {
00055     //d = new KapabilitiesPrivate;
00056     //d = kap.d;
00057     (*this) = kap;
00058 }
00059 Kapabilities::~Kapabilities()
00060 {
00061     //delete d;
00062 }
00063 bool Kapabilities::supportsMetaSyncing() const
00064 {
00065     return m_supMeta;
00066 }
00067 void Kapabilities::setSupportMetaSyncing( bool meta )
00068 {
00069     m_supMeta = meta;
00070 }
00071 void Kapabilities::setMetaSyncingEnabled( bool enable )
00072 {
00073     m_meta = enable;
00074 }
00075 bool Kapabilities::isMetaSyncingEnabled() const
00076 {
00077     return m_meta;
00078 }
00079 bool Kapabilities::supportsPushSync() const
00080 {
00081   return m_push;
00082 }
00083 void Kapabilities::setSupportsPushSync(bool push)
00084 {
00085   m_push = push;
00086 }
00087 bool Kapabilities::needsConnection() const
00088 {
00089   return m_needConnection;
00090 }
00091 void Kapabilities::setNeedsConnection(bool connection)
00092 {
00093   m_needConnection = connection;
00094 }
00095 bool Kapabilities::supportsListDir() const
00096 {
00097   return m_listdir;
00098 }
00099 
00100 void Kapabilities::setSupportsListDir(bool listDir)
00101 {
00102   m_listdir = listDir;
00103 }
00104 QMemArray<int> Kapabilities::ports()const
00105 {
00106   return m_ports;
00107 }
00108 void Kapabilities::setPorts(const QMemArray<int> & ports)
00109 {
00110   m_ports = ports;
00111 }
00112 int Kapabilities::currentPort() const
00113 {
00114   return m_current;
00115 }
00116 void Kapabilities::setCurrentPort(int port )
00117 {
00118   m_current = port;
00119 }
00120 bool Kapabilities::needsIPs() const
00121 {
00122   return m_needsIp;
00123 }
00124 bool Kapabilities::needsSrcIP() const
00125 {
00126   return m_needsSrcIp;
00127 }
00128 bool Kapabilities::needsDestIP() const
00129 {
00130   return m_needsDestIp;
00131 }
00132 void Kapabilities::setNeedsIPs(bool needs)
00133 {
00134   m_needsIp = needs;
00135 }
00136 void Kapabilities::setNeedsSrcIP(bool needs)
00137 {
00138   m_needsSrcIp = needs;
00139 }
00140 void Kapabilities::setNeedsDestIP(bool needs)
00141 {
00142   m_needsDestIp = needs;
00143 }
00144 void Kapabilities::setSrcIP(const QString &addr)
00145 {
00146   m_src = addr;
00147 }
00148 void Kapabilities::setDestIP(const QString &addr)
00149 {
00150   m_dest = addr;
00151 }
00152 QString Kapabilities::srcIP() const
00153 {
00154   return m_src;
00155 }
00156 QString Kapabilities::destIP() const
00157 {
00158   return m_dest;
00159 }
00160 bool Kapabilities::canAutoHandle()const
00161 {
00162   return m_canHandle;
00163 }
00164 void Kapabilities::setAutoHandle(bool handle)
00165 {
00166   m_canHandle = handle;
00167 }
00168 QStringList  Kapabilities::ipProposals() const
00169 {
00170   return m_propsIPs;
00171 }
00172 void Kapabilities::setIpProposals( const QStringList &ips )
00173 {
00174   m_propsIPs = ips;
00175 }
00176 bool Kapabilities::needAuthentication() const
00177 {
00178   return m_needsAuthent;
00179 }
00180 void Kapabilities::setNeedAuthentication(bool authent)
00181 {
00182   m_needsAuthent = authent;
00183 }
00184 void Kapabilities::setUser(const QString &user )
00185 {
00186   m_user = user;
00187 }
00188 void Kapabilities::setPassword(const QString &pass )
00189 {
00190   m_pass = pass;
00191 }
00192 QString Kapabilities::password() const
00193 {
00194   return m_pass;
00195 }
00196 QString Kapabilities::user() const
00197 {
00198   return m_user;
00199 }
00200 QValueList<QPair<QString,QString> > Kapabilities::userProposals() const
00201 {
00202   return m_propAuth;
00203 }
00204 void Kapabilities::setUserProposals( QValueList< QPair<QString, QString> > auth )
00205 {
00206   m_propAuth = auth;
00207 }
00208 void Kapabilities::setExtraOption( const QString &extra, const QString &variant )
00209 {
00210     m_extras.replace( extra, variant );
00211 }
00212 bool Kapabilities::needsNetworkConnection()const
00213 {
00214     return m_needsNet;
00215 }
00216 void Kapabilities::setNeedsNetworkConnection( bool net )
00217 {
00218     m_needsNet = net;
00219 }
00220 QStringList Kapabilities::models() const
00221 {
00222     return m_models;
00223 }
00224 void Kapabilities::setModels( const QStringList& model )
00225 {
00226     m_models = model;
00227 }
00228 QString Kapabilities::currentModel() const
00229 {
00230     return m_currModell;
00231 }
00232 void Kapabilities::setCurrentModel( const QString &mod )
00233 {
00234     m_currModell = mod;
00235 }
00236 void Kapabilities::setConnectionMode( const QStringList &mode )
00237 {
00238     m_modes= mode;
00239 }
00240 QStringList Kapabilities::connectionModes() const
00241 {
00242     return m_modes;
00243 }
00244 QString Kapabilities::currentConnectionMode()const
00245 {
00246     return m_currMode;
00247 }
00248 void Kapabilities::setCurrentConnectionMode( const QString &mode )
00249 {
00250     m_currMode = mode;
00251 }
00252 Kapabilities &Kapabilities::operator=(const Kapabilities &rhs )
00253 {
00254     m_push = rhs.m_push;
00255     m_needConnection = rhs.m_needConnection;
00256     m_listdir = rhs.m_listdir;
00257     m_needsIp = rhs.m_needsIp;
00258     m_needsSrcIp = rhs.m_needsSrcIp;
00259     m_needsDestIp = rhs.m_needsDestIp;
00260     m_needsAuthent = rhs.m_needsAuthent;
00261     m_src = rhs.m_src;
00262     m_dest = rhs.m_dest;
00263     m_propsIPs = rhs.m_propsIPs;
00264     m_propAuth = rhs.m_propAuth;
00265     m_canHandle = rhs.m_canHandle;
00266     m_ports = rhs.m_ports;
00267     m_current = rhs.m_current;
00268     m_user = rhs.m_user;
00269     m_pass = rhs.m_pass;
00270     m_extras = rhs.m_extras;
00271     m_meta = rhs.m_meta;
00272     m_supMeta = rhs.m_supMeta;
00273     m_needsNet = rhs.m_needsNet;
00274 
00275     m_currModell = rhs.m_currModell;
00276     m_models = rhs.m_models;
00277     m_currMode = rhs.m_currMode;
00278     m_modes = rhs.m_modes;
00279 
00280     m_needsName = rhs.m_needsName;
00281     m_name = rhs.m_name;
00282 
00283     return (*this );
00284 }
00285 bool Kapabilities::needsModelName()const {
00286     return m_needsName;
00287 }
00288 void Kapabilities::setNeedsModelName( bool b ) {
00289     m_needsName = b;
00290 }
00291 QString Kapabilities::modelName()const {
00292     return m_name;
00293 }
00294 void Kapabilities::setModelName( const QString& name ) {
00295     m_name = name;
00296 }
00297 /*
00298 void Kapabilities::dump()const
00299 {
00300     kdDebug(5201) << "Needs Net " << m_needsNet << endl;
00301     kdDebug(5201) << "Can Push " << m_push << endl;
00302     kdDebug(5201) << "Needs Conn " << m_needConnection << endl;
00303     kdDebug(5201) << "ListDir" <<  m_listdir << endl;
00304     kdDebug(5201) << "Needs IP" << m_needsIp << endl;
00305     kdDebug(5201) << "Needs SRC " << m_needsSrcIp << endl;
00306 
00307 }
00308 */
00309 
00310 
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 23 18:20:08 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003