kdeui Library API Documentation

kauthicon.h

00001 /* This file is part of the KDE libraries
00002    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef _KAUTHICON_H
00019 #define _KAUTHICON_H "$Id: kauthicon.h,v 1.18 2004/10/10 10:36:39 bhards Exp $"
00020 
00021 #include <qfileinfo.h>
00022 #include <qpixmap.h>
00023 #include <qstring.h>
00024 #include <qwidget.h>
00025 
00026 #include <kdelibs_export.h>
00027 
00028 class QHBoxLayout;
00029 class QLabel;
00030 class KAuthIconPrivate;
00031 
00047 class KDEUI_EXPORT KAuthIcon : public QWidget
00048 {
00049   Q_OBJECT
00050 
00051 public:
00055   KAuthIcon(QWidget *parent = 0, const char *name = 0);
00056   ~KAuthIcon();
00057 
00058   virtual QSize sizeHint() const;
00062   virtual bool status() const = 0;
00063 
00064 public slots:
00069   virtual void updateStatus() = 0;
00070 
00071 signals:
00078   void authChanged(bool authorized);
00079 
00080 protected:
00081   QHBoxLayout *layout;
00082 
00083   QLabel *lockBox;
00084   QLabel *lockLabel;
00085   QPixmap lockPM;
00086   QPixmap openLockPM;
00087   QString lockText;
00088   QString openLockText;
00089 
00090 protected:
00091   virtual void virtual_hook( int id, void* data );
00092 private:
00093   KAuthIconPrivate *d;
00094 };
00095 
00096 class KRootPermsIconPrivate;
00103 class KDEUI_EXPORT KRootPermsIcon : public KAuthIcon
00104 {
00105   Q_OBJECT
00106 
00107 public:
00108   KRootPermsIcon(QWidget *parent = 0, const char *name = 0);
00109   ~KRootPermsIcon();
00110 
00114   bool status() const { return root; }
00115 
00116 public slots:
00117   void updateStatus();
00118 
00119 protected:
00120   bool root;
00121 
00122 protected:
00123   virtual void virtual_hook( int id, void* data );
00124 private:
00125   KRootPermsIconPrivate *d;
00126 };
00127 
00128 class KWritePermsIconPrivate;
00135 class KDEUI_EXPORT KWritePermsIcon : public KAuthIcon
00136 {
00137   Q_OBJECT
00138 
00139 public:
00140   KWritePermsIcon(const QString & fileName, QWidget *parent = 0, const char *name = 0);
00141   ~KWritePermsIcon();
00145   bool status() const { return writable; }
00146 
00151   void setFileName(const QString & fileName) { fi.setFile(fileName); updateStatus(); }
00152 
00153 public slots:
00154   void updateStatus();
00155 
00156 protected:
00157   bool writable;
00158   QFileInfo fi;
00159 
00160 protected:
00161   virtual void virtual_hook( int id, void* data );
00162 private:
00163   KWritePermsIconPrivate *d;
00164 };
00165 
00166 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:11:58 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003