KDEPrint
cupsinfos.h
Go to the documentation of this file.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 <QtCore/QString> 00024 #include "kpreloadobject.h" 00025 00026 #ifdef __GNUC__ 00027 #warning rename class or remove from global namespace 00028 #endif 00029 class CupsInfos : public KPReloadObject 00030 { 00031 public: 00032 static CupsInfos* self(); 00033 00034 CupsInfos(); 00035 ~CupsInfos(); 00036 00037 const QString& host() const; 00038 int port() const; 00039 const QString hostaddr() const; 00040 const QString ippaddr() const; 00041 const QString& login() const; 00042 const QString& password() const; 00043 const QString& realLogin() const; 00044 bool savePassword() const; 00045 00046 void setHost(const QString& s); 00047 void setPort(int p); 00048 void setLogin(const QString& s); 00049 void setPassword(const QString& s); 00050 void setSavePassword(bool on); 00051 00052 const char* getPasswordCB(); 00053 00054 void load(); 00055 void save(); 00056 00057 protected: 00058 void reload(); 00059 void configChanged(); 00060 00061 private: 00062 static CupsInfos *unique_; 00063 00064 QString host_; 00065 int port_; 00066 QString login_; 00067 QString password_; 00068 QString reallogin_; 00069 bool savepwd_; 00070 00071 int count_; 00072 }; 00073 00074 inline const QString& CupsInfos::host() const 00075 { 00076 return host_; 00077 } 00078 00079 inline int CupsInfos::port() const 00080 { 00081 return port_; 00082 } 00083 00084 inline const QString& CupsInfos::login() const 00085 { 00086 return login_; 00087 } 00088 00089 inline const QString& CupsInfos::password() const 00090 { 00091 return password_; 00092 } 00093 00094 inline const QString& CupsInfos::realLogin() const 00095 { 00096 return reallogin_; 00097 } 00098 00099 inline bool CupsInfos::savePassword() const 00100 { 00101 return savepwd_; 00102 } 00103 00104 #endif
KDE 4.2 API Reference