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

mainwindow.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** Licensees holding valid Qtopia Developer license may use this
00007 ** file in accordance with the Qtopia Developer License Agreement
00008 ** provided with the Software.
00009 **
00010 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
00011 ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00012 ** PURPOSE.
00013 **
00014 ** email sales@trolltech.com for information about Qtopia License
00015 ** Agreements.
00016 **
00017 ** Contact info@trolltech.com if any conditions of this licensing are
00018 ** not clear to you.
00019 **
00020 **********************************************************************/
00021 
00022 #ifndef MAINWINDOW_H
00023 #define MAINWINDOW_H
00024 
00025 #include <qmainwindow.h>
00026 #include <qwidgetstack.h>
00027 #include <qmap.h>
00028 #include <qpe/filemanager.h>
00029 
00030 class QAction;
00031 class QComboBox;
00032 class FileSelectorView;
00033 class FileSelector;
00034 class QToolBar;
00035 class ButtonMenu;
00036 
00037 namespace Qt3 {
00038 
00039 class QTextEdit;
00040 
00041 }
00042 
00043 class MainWindow : public QMainWindow
00044 {
00045     Q_OBJECT
00046 
00047 public:
00048     MainWindow( QWidget *parent = 0, const char *name = 0 , WFlags fl = 0);
00049     ~MainWindow();
00050 
00051     static QString appName() { return QString::fromLatin1("opie-write"); }
00052 
00053 protected:
00054     void closeEvent( QCloseEvent *e );
00055 
00056 private slots:
00057     // new file functions
00058     void fileOpen();
00059     void fileRevert();
00060     void fileNew();
00061 
00062     void editUndo();
00063     void editRedo();
00064     void editCut();
00065     void editCopy();
00066     void editPaste();
00067 
00068     void textBold();
00069     void textUnderline();
00070     void textItalic();
00071     void textFamily( const QString &f );
00072     void textSize( const QString &p );
00073     void textStyle( int s );
00074     void textAlign( int );
00075 
00076     void fontChanged( const QFont &f );
00077     void colorChanged( const QColor &c );
00078     void alignmentChanged( int a );
00079     void editorChanged( QWidget * );
00080 
00081     // these are from textedit, we may need them
00082     void insertTable();
00083     void newFile( const DocLnk & );
00084     void openFile( const DocLnk & );
00085     void showEditTools();
00086     void hideEditTools();
00087 
00088 private:
00089     void updateFontSizeCombo( const QFont &f );
00090     void setupActions();
00091     Qt3::QTextEdit *currentEditor() const;
00092     void doConnections( Qt3::QTextEdit *e );
00093     void updateCaption();
00094     void save();
00095     void clear();
00096 
00097     // added these from the textedit
00098     QWidgetStack *editorStack;
00099     FileSelector *fileSelector;
00100     QToolBar *tbMenu;
00101     QToolBar *tbEdit;
00102     QToolBar *tbFont;
00103     QToolBar *tbStyle;
00104     QAction *actionTextBold,
00105         *actionTextUnderline,
00106         *actionTextItalic;
00107     QComboBox *comboFont,
00108         *comboSize;
00109     ButtonMenu *alignMenu;
00110     DocLnk *doc;
00111     Qt3::QTextEdit* editor;
00112 };
00113 
00114 
00115 #endif

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