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 const QString& login() const; 00038 const QString& password() const; 00039 const QString& realLogin() const; 00040 bool savePassword() const; 00041 00042 void setHost(const QString& s); 00043 void setPort(int p); 00044 void setLogin(const QString& s); 00045 void setPassword(const QString& s); 00046 void setSavePassword( bool on ); 00047 00048 const char* getPasswordCB(); 00049 00050 void load(); 00051 void save(); 00052 00053 protected: 00054 void reload(); 00055 void configChanged(); 00056 00057 private: 00058 static CupsInfos *unique_; 00059 00060 QString host_; 00061 int port_; 00062 QString login_; 00063 QString password_; 00064 QString reallogin_; 00065 bool savepwd_; 00066 00067 int count_; 00068 }; 00069 00070 inline const QString& CupsInfos::host() const 00071 { return host_; } 00072 00073 inline int CupsInfos::port() const 00074 { return port_; } 00075 00076 inline const QString& CupsInfos::login() const 00077 { return login_; } 00078 00079 inline const QString& CupsInfos::password() const 00080 { return password_; } 00081 00082 inline const QString& CupsInfos::realLogin() const 00083 { return reallogin_; } 00084 00085 inline bool CupsInfos::savePassword() const 00086 { return savepwd_; } 00087 00088 #endif