home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / qwerty / qwerty.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  1KB  |  60 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qwerty.h   3.0.0   edited Oct 2 13:32 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #ifndef QWERTY_H
  12. #define QWERTY_H
  13.  
  14. #include <qwidget.h>
  15. #include <qmenubar.h>
  16. #include <qmultilineedit.h>
  17. #include <qprinter.h>
  18.  
  19. class Editor : public QWidget
  20. {
  21.     Q_OBJECT
  22. public:
  23.     Editor( QWidget *parent=0, const char *name="qwerty" );
  24.    ~Editor();
  25.  
  26.     void load( const QString& fileName, int code=-1 );
  27.  
  28. public slots:
  29.     void newDoc();
  30.     void load();
  31.     bool save();
  32.     void print();
  33.     void addEncoding();
  34.     void toUpper();
  35.     void toLower();
  36.     void font();
  37. protected:
  38.     void resizeEvent( QResizeEvent * );
  39.     void closeEvent( QCloseEvent * );
  40.  
  41. private slots:
  42.     void saveAsEncoding( int );
  43.     void openAsEncoding( int );
  44.     void textChanged();
  45.  
  46. private:
  47.     bool saveAs( const QString& fileName, int code=-1 );
  48.     void rebuildCodecList();
  49.     QMenuBar        *m;
  50.     QMultiLineEdit *e;
  51. #ifndef QT_NO_PRINTER
  52.     QPrinter        printer;
  53. #endif
  54.     QPopupMenu       *save_as;
  55.     QPopupMenu       *open_as;
  56.     bool changed;
  57. };
  58.  
  59. #endif // QWERTY_H
  60.