Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cardmon.h

Go to the documentation of this file.
00001 /*
00002  * cardmon.h
00003  *
00004  * ---------------------
00005  *
00006  * copyright   : (c) 2003 by Maximilian Reiss
00007  * email       : max.reiss@gmx.de
00008  * based on two apps by Devin Butterfield
00009  */
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef CARDMON_H
00020 #define CARDMON_H
00021 
00022 #include <qwidget.h>
00023 #include <qpixmap.h>
00024 #include <qpopupmenu.h>
00025 
00026 namespace Opie {
00027     namespace Core {
00028         class OProcess;
00029     }
00030 }
00031 
00032 class CardMonitor : public QWidget {
00033     Q_OBJECT
00034 public:
00035     enum {
00036         PCMCIA_Socket1,
00037         PCMCIA_Socket2,
00038         MMC_Socket
00039     };
00040 
00041     CardMonitor( QWidget *parent = 0 );
00042     ~CardMonitor();
00043     bool getStatusPcmcia( int showPopUp = FALSE );
00044     bool getStatusSd( int showPopUp = FALSE );
00045     static int position();
00046 private slots:
00047     void cardMessage( const QCString &msg, const QByteArray & );
00048     void slotExited( Opie::Core::OProcess* proc );
00049     void popupTimeout();
00050 
00051 protected:
00052     void paintEvent( QPaintEvent* );
00053     void mousePressEvent( QMouseEvent * );
00054 
00055 private:
00056     void execCommand( const QStringList &command );
00057     int m_commandOrig;
00058     QPixmap pm;
00059     // pcmcia socket 0
00060     bool cardInPcmcia0;
00061     QString cardInPcmcia0Name;
00062     QString cardInPcmcia0Type;
00063     // pcmcia socket 1
00064     bool cardInPcmcia1;
00065     QString cardInPcmcia1Name;
00066     QString cardInPcmcia1Type;
00067     bool cardInSd;
00068     QString cardSdName; // the device which is mounted
00069     void iconShow();
00070     QPopupMenu *popupMenu;
00071     void popUp(QString message, QString icon = QString::null );
00072     Opie::Core::OProcess* m_process;
00073 };
00074 
00075 #endif
00076 

Generated on Sat Nov 5 16:15:24 2005 for OPIE by  doxygen 1.4.2