• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

kdf

kdfwidget.h

Go to the documentation of this file.
00001 /*
00002  * kdfwidget.h
00003  *
00004  * Copyright (c) 1998 Michael Kropfberger <michael.kropfberger@gmx.net>
00005  *
00006  * Requires the Qt widget libraries, available at no cost at
00007  * http://www.troll.no/
00008  *
00009  *  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with this program; if not, write to the Free Software
00021  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00022  */
00023 
00024 #ifndef KDFWIDGET_H
00025 #define KDFWIDGET_H
00026 
00027 #include <QtCore/QVector>
00028 #include <QtCore/qglobal.h>
00029 
00030 #include <Qt3Support/Q3ListView>
00031 
00032 #include "disks.h"
00033 #include "disklist.h"
00034 #include "mntconfig.h"
00035 #include "kdfconfig.h"
00036 #include "stdoption.h"
00037 
00038 class CListView;
00039 class COptionDialog;
00040 class QTimer;
00041 class KMenu;
00042 
00043 /**************************************************************/
00044 
00045 class CTabEntry
00046 {
00047   public:
00048     CTabEntry( const QString &res, const QString &name, bool visible,
00049            uint width )
00050     {
00051       mRes     = res;
00052       mName    = name;
00053       mVisible = visible;
00054       mWidth   = width;
00055     }
00056     CTabEntry( void ) { }
00057     ~CTabEntry( void ) { }
00058 
00059 
00060     QString mRes;
00061     QString mName;
00062     bool mVisible;
00063     uint mWidth;
00064 };
00065 
00066 /**************************************************************/
00067 //
00068 // 2001-03-10 Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
00069 // The purpose of this class is:
00070 // 1) overload the key() method to provide sorting keys so that the
00071 //    columns with a numeric value are sorted by numerical value.
00072 //
00073 
00074 class CListViewItem : public Q3ListViewItem
00075 {
00076   public:
00077     CListViewItem ( CListView * parent, Q3ListViewItem * after );
00078  
00079     virtual int compare ( Q3ListViewItem* i, int col, bool) const;
00080         
00081     void    setKeys ( int kb_size, int kb_avail, float percent_full ) ;
00082 
00083   private:
00084     int     size;
00085     int     avail;
00086     float   full;
00087 };
00088 
00089 /**************************************************************/
00090 
00091 class KDFWidget : public QWidget
00092 {
00093   Q_OBJECT
00094 
00095   public:
00096     enum ColId
00097     {
00098       iconCol   = 0,
00099       deviceCol = 1,
00100       typeCol   = 2,
00101       sizeCol   = 3,
00102       mntCol    = 4,
00103       freeCol   = 5,
00104       fullCol   = 6,
00105       usageCol  = 7
00106     };
00107 
00108   public:
00109     explicit KDFWidget( QWidget *parent=0, bool init=false);
00110     ~KDFWidget( );
00111 
00112   public slots:
00113     void settingsChanged( void );
00114     void loadSettings( void );
00115     void applySettings( void );
00116     void updateDF( void );
00117     void updateDFDone( void );
00118     void settingsBtnClicked( void );
00119   
00120   private slots:
00121     void criticallyFull( DiskEntry *disk );
00122     void rightButtonPressed( Q3ListViewItem *item, const QPoint &p, int );
00123     void popupMenu( Q3ListViewItem *item, const QPoint &p );
00124     void setUpdateFrequency( int frequency );
00125     void columnSizeChanged( int column, int, int newSize );
00126     void updateDiskBarPixmaps( void );
00127     void invokeHelp( void );
00128 
00129   protected:
00130     void timerEvent( QTimerEvent * );
00131     void closeEvent( QCloseEvent * );
00132     void resizeEvent( QResizeEvent * );
00133 
00134   private:
00135     void makeColumns( void );
00136     DiskEntry *selectedDisk( Q3ListViewItem *item=0 );
00137 
00138   private:
00139     bool readingDF;
00140     QVector<CTabEntry*> mTabProp;
00141     CListView     *mList;
00142     COptionDialog *mOptionDialog;
00143     KMenu    *mPopup;
00144     QTimer        *mTimer;
00145     DiskList   mDiskList;
00146     bool       mIsTopLevel;
00147     CStdOption mStd;
00148 };
00149 
00150 #endif

kdf

Skip menu "kdf"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal