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

kmobiletools

qserial.h

Go to the documentation of this file.
00001 /***************************************************************************
00002    Copyright (C) 2007
00003    by Marco Gulino <marco@kmobiletools.org>
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the
00017    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019  ***************************************************************************/
00020 #ifndef KMOBILETOOLSQSERIAL_H
00021 #define KMOBILETOOLSQSERIAL_H
00022 
00023 #include <QtCore/QIODevice>
00024 #include <termios.h>
00025 
00026 namespace KMobileTools {
00027 
00031 class QSerialPrivate;
00032 class QSerial : public QIODevice
00033 {
00034     Q_OBJECT
00035 //     Q_PROPERTY( QString device READ device WRITE setDevice )
00036 //     Q_PROPERTY( Baud baud READ baud WRITE setBaud )
00037 //     Q_PROPERTY( Parity parity READ parity WRITE setParity )
00038 //     Q_PROPERTY( StopBits stopbits READ stopBits WRITE setStopbits)
00039 //     Q_PROPERTY( FlowControl flowcontrol READ flowControl WRITE setFlowControl )
00040 //     Q_ENUMS( Baud )
00041 //     Q_ENUMS( Parity )
00042 //     Q_ENUMS( StopBits )
00043 //     Q_ENUMS( FlowControl )
00044 public:
00048     QSerial();
00054     QSerial( const QString &deviceName );
00055     ~QSerial();
00056 
00060     enum Baud {
00061         BAUD_50      = B50,
00062         BAUD_75      = B75,
00063         BAUD_110     = B110,
00064         BAUD_134     = B134,
00065         BAUD_150     = B150,
00066         BAUD_200     = B200,
00067         BAUD_300     = B300,
00068         BAUD_600     = B600,
00069         BAUD_1200    = B1200,
00070         BAUD_1800    = B1800,
00071         BAUD_2400    = B2400,
00072         BAUD_4800    = B4800,
00073         BAUD_9600    = B9600,
00074         BAUD_19200   = B19200,
00075         BAUD_38400   = B38400,
00076         BAUD_57600   = B57600,
00077         BAUD_115200  = B115200,
00078         BAUD_230400  = B230400,
00079         BAUD_DEFAULT = BAUD_57600
00080     };
00084     enum Parity {
00088         PARITY_NONE = 0x0,
00089         PARITY_ODD = 0x1,
00090         PARITY_EVEN = 0x2,
00091         PARITY_MARK = 0x3,
00092         PARITY_SPACE = 0x4,
00093         PARITY_DEFAULT = PARITY_NONE
00094     };
00098     enum DataBits {
00099         DATABITS_5=5,
00100         DATABITS_6=6,
00101         DATABITS_7=7,
00102         DATABITS_8=8,
00103         DATABITS_DEFAULT=DATABITS_8
00104     };
00108     enum StopBits {
00109         STOP_BITS_1=0x1,
00110         STOP_BITS_2=0x2,
00111         STOP_BITS_DEFAULT = STOP_BITS_1
00112     };
00116     enum FlowControl {
00120         FLOW_CONTROL_HARD=0x1,
00124         FLOW_CONTROL_XONXOFF=0x2,
00128         FLOW_CONTROL_NONE=0x0,
00132         FLOW_CONTROL_DEFAULT = FLOW_CONTROL_HARD
00133     };
00134 
00135 
00140     Baud baud();
00146     void setBaud( Baud baudrate);
00151     Parity parity();
00157     void setParity( Parity parity);
00162     DataBits databits();
00167     void setDatabits( DataBits databits);
00172     StopBits stopBits();
00178     void setStopBits( StopBits stopbits);
00183     FlowControl flowControl();
00189     void setFlowControl( FlowControl flowcontrol);
00195     QString name() const;
00202     void setName(const QString &name);
00210     bool open( OpenMode mode, bool createLockFile );
00219     bool open( OpenMode mode );
00224     void close();
00225 
00229     void flush();
00234     qint64 size() const;
00240     int getch();
00247     int putch( int ch );
00248 
00254     int  ungetch( int ch );
00259     bool reset();
00264     bool isOpen() const;
00265     bool isSequential() const;
00266 
00267 protected:
00276     qint64 readData( char *data, qint64 maxSize );
00285     qint64 writeData( const char *data, qint64 maxSize );
00286 private:
00287     bool lockFile(bool lock);
00288     const QString lockFileName();
00289     void setupParameters();
00290     void createObject();
00291     QSerialPrivate *d;
00292 private Q_SLOTS:
00293     void slotNotifierData(int);
00294 Q_SIGNALS:
00298     void gotData();
00299 };
00300 
00301 }
00302 
00303 #endif

kmobiletools

Skip menu "kmobiletools"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim 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