tdeui
kauthicon.h
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$"
00020
00021 #include <tqfileinfo.h>
00022 #include <tqpixmap.h>
00023 #include <tqstring.h>
00024 #include <tqwidget.h>
00025
00026 #include <tdelibs_export.h>
00027
00028 class TQHBoxLayout;
00029 class TQLabel;
00030 class KAuthIconPrivate;
00031
00047 class TDEUI_EXPORT KAuthIcon : public TQWidget
00048 {
00049 Q_OBJECT
00050
00051 public:
00055 KAuthIcon(TQWidget *parent = 0, const char *name = 0);
00056 ~KAuthIcon();
00057
00058 virtual TQSize 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 TQHBoxLayout *layout;
00082
00083 TQLabel *lockBox;
00084 TQLabel *lockLabel;
00085 TQPixmap lockPM;
00086 TQPixmap openLockPM;
00087 TQString lockText;
00088 TQString 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 TDEUI_EXPORT KRootPermsIcon : public KAuthIcon
00104 {
00105 Q_OBJECT
00106
00107 public:
00108 KRootPermsIcon(TQWidget *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 TDEUI_EXPORT KWritePermsIcon : public KAuthIcon
00136 {
00137 Q_OBJECT
00138 TQ_PROPERTY( TQString fileName READ fileName WRITE setFileName )
00139
00140 public:
00141 KWritePermsIcon(const TQString & fileName, TQWidget *parent = 0, const char *name = 0);
00142 ~KWritePermsIcon();
00146 bool status() const { return writable; }
00147
00152 void setFileName(const TQString & fileName) { fi.setFile(fileName); updateStatus(); }
00153
00158 TQString fileName() const { return fi.fileName(); }
00159
00160 public slots:
00161 void updateStatus();
00162
00163 protected:
00164 bool writable;
00165 TQFileInfo fi;
00166
00167 protected:
00168 virtual void virtual_hook( int id, void* data );
00169 private:
00170 KWritePermsIconPrivate *d;
00171 };
00172
00173 #endif