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

  1. /****************************************************************************
  2. ** $Id:  qt/textedit.h   3.0.0   edited Jun 1 18:44 $
  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 TEXTEDIT_H
  12. #define TEXTEDIT_H
  13.  
  14. #include <qmainwindow.h>
  15. #include <qmap.h>
  16.  
  17. class QAction;
  18. class QComboBox;
  19. class QTabWidget;
  20. class QTextEdit;
  21.  
  22. class TextEdit : public QMainWindow
  23. {
  24.     Q_OBJECT
  25.  
  26. public:
  27.     TextEdit( QWidget *parent = 0, const char *name = 0 );
  28.  
  29. private:
  30.     void setupFileActions();
  31.     void setupEditActions();
  32.     void setupTextActions();
  33.     void load( const QString &f );
  34.     QTextEdit *currentEditor() const;
  35.     void doConnections( QTextEdit *e );
  36.  
  37. private slots:
  38.     void fileNew();
  39.     void fileOpen();
  40.     void fileSave();
  41.     void fileSaveAs();
  42.     void filePrint();
  43.     void fileClose();
  44.     void fileExit();
  45.  
  46.     void editUndo();
  47.     void editRedo();
  48.     void editCut();
  49.     void editCopy();
  50.     void editPaste();
  51.  
  52.     void textBold();
  53.     void textUnderline();
  54.     void textItalic();
  55.     void textFamily( const QString &f );
  56.     void textSize( const QString &p );
  57.     void textStyle( int s );
  58.     void textColor();
  59.     void textAlign( QAction *a );
  60.  
  61.     void fontChanged( const QFont &f );
  62.     void colorChanged( const QColor &c );
  63.     void alignmentChanged( int a );
  64.     void editorChanged( QWidget * );
  65.  
  66. private:
  67.     QAction *actionTextBold,
  68.     *actionTextUnderline,
  69.     *actionTextItalic,
  70.     *actionTextColor,
  71.     *actionAlignLeft,
  72.     *actionAlignCenter,
  73.     *actionAlignRight,
  74.     *actionAlignJustify;
  75.     QComboBox *comboStyle,
  76.     *comboFont,
  77.     *comboSize;
  78.     QTabWidget *tabWidget;
  79.     QMap<QTextEdit*, QString> filenames;
  80.  
  81. };
  82.  
  83.  
  84. #endif
  85.