00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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 Q_PROPERTY(
QString fileName READ fileName WRITE setFileName )
00139
00140
public:
00141 KWritePermsIcon(
const QString & fileName,
QWidget *parent = 0,
const char *name = 0);
00142 ~KWritePermsIcon();
00146 bool status()
const {
return writable; }
00147
00152 void setFileName(
const QString & fileName) { fi.setFile(fileName);
updateStatus(); }
00153
00158 QString fileName()
const {
return fi.fileName(); }
00159
00160
public slots:
00161
void updateStatus();
00162
00163
protected:
00164
bool writable;
00165
QFileInfo fi;
00166
00167
protected:
00168
virtual void virtual_hook(
int id,
void* data );
00169
private:
00170 KWritePermsIconPrivate *d;
00171 };
00172
00173
#endif