kauthicon.h
/* This file is part of the KDE libraries
Copyright (c) 1999 Preston Brown <pbrown@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KAUTHICON_H
#define _KAUTHICON_H "$Id: kauthicon.h 465272 2005-09-29 09:47:40Z mueller $"
#include <qfileinfo.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qwidget.h>
#include <kdelibs_export.h>
class QHBoxLayout;
class QLabel;
class KAuthIconPrivate;
class KDEUI_EXPORT KAuthIcon : public QWidget
{
Q_OBJECT
public:
KAuthIcon(QWidget *parent = 0, const char *name = 0);
~KAuthIcon();
virtual QSize sizeHint() const;
virtual bool status() const = 0;
public slots:
virtual void updateStatus() = 0;
signals:
void authChanged(bool authorized);
protected:
QHBoxLayout *layout;
QLabel *lockBox;
QLabel *lockLabel;
QPixmap lockPM;
QPixmap openLockPM;
QString lockText;
QString openLockText;
protected:
virtual void virtual_hook( int id, void* data );
private:
KAuthIconPrivate *d;
};
class KRootPermsIconPrivate;
class KDEUI_EXPORT KRootPermsIcon : public KAuthIcon
{
Q_OBJECT
public:
KRootPermsIcon(QWidget *parent = 0, const char *name = 0);
~KRootPermsIcon();
bool status() const { return root; }
public slots:
void updateStatus();
protected:
bool root;
protected:
virtual void virtual_hook( int id, void* data );
private:
KRootPermsIconPrivate *d;
};
class KWritePermsIconPrivate;
class KDEUI_EXPORT KWritePermsIcon : public KAuthIcon
{
Q_OBJECT
Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
public:
KWritePermsIcon(const QString & fileName, QWidget *parent = 0, const char *name = 0);
~KWritePermsIcon();
bool status() const { return writable; }
void setFileName(const QString & fileName) { fi.setFile(fileName); updateStatus(); }
QString fileName() const { return fi.fileName(); }
public slots:
void updateStatus();
protected:
bool writable;
QFileInfo fi;
protected:
virtual void virtual_hook( int id, void* data );
private:
KWritePermsIconPrivate *d;
};
#endif
KWritePermsIcon::status
bool status() const
Definition: kauthicon.h:146
KRootPermsIcon
Icon to show whether or not a user has root permissions.
Definition: kauthicon.h:103
KWritePermsIcon
Auth icon for write permission display.
Definition: kauthicon.h:135
KWritePermsIcon::fileName
QString fileName() const
return the filename of the currently watched file.
Definition: kauthicon.h:158
KWritePermsIcon::setFileName
void setFileName(const QString &fileName)
make the icon watch a new filename.
Definition: kauthicon.h:152
KAuthIcon::updateStatus
virtual void updateStatus()=0
Re-implement this method if you want the icon to update itself when something external has changed (i...
KAuthIcon
A base class for authorization icon widgets.
Definition: kauthicon.h:47
KRootPermsIcon::status
bool status() const
return whether or not the current user has root permissions.
Definition: kauthicon.h:114

KDE Home | KDE Accessibility Home | Description of Access Keys