cupsinfos.h

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
00018  **/
00019 
00020 #ifndef CUPSINFOS_H
00021 #define CUPSINFOS_H
00022 
00023 #include <qstring.h>
00024 #include "kpreloadobject.h"
00025 
00026 class CupsInfos : public KPReloadObject
00027 {
00028 public:
00029     static CupsInfos* self();
00030 
00031     CupsInfos();
00032     ~CupsInfos();
00033 
00034     const QString& host() const;
00035         QString  hostaddr() const;
00036     int port() const;
00037     QString ippAssembleURI(const QString& resource) const;
00038     const QString& login() const;
00039     const QString& password() const;
00040     const QString& realLogin() const;
00041     bool savePassword() const;
00042 
00043     void setHost(const QString& s);
00044     void setPort(int p);
00045     void setLogin(const QString& s);
00046     void setPassword(const QString& s);
00047     void setSavePassword( bool on );
00048 
00049     const char* getPasswordCB();
00050 
00051     void load();
00052     void save();
00053 
00054 protected:
00055     void reload();
00056     void configChanged();
00057 
00058 private:
00059     static CupsInfos    *unique_;
00060 
00061     QString host_;
00062     int port_;
00063     QString login_;
00064     QString password_;
00065     QString reallogin_;
00066     bool savepwd_;
00067 
00068     int count_;
00069 };
00070 
00071 inline const QString& CupsInfos::host() const
00072 { return host_; }
00073 
00074 inline int CupsInfos::port() const
00075 { return port_; }
00076 
00077 inline const QString& CupsInfos::login() const
00078 { return login_; }
00079 
00080 inline const QString& CupsInfos::password() const
00081 { return password_; }
00082 
00083 inline const QString& CupsInfos::realLogin() const
00084 { return reallogin_; }
00085 
00086 inline bool CupsInfos::savePassword() const
00087 { return savepwd_; }
00088 
00089 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys