kformula

kformula_view.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
00003                   Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef __kformula_view_h__
00022 #define __kformula_view_h__
00023 
00024 class KAction;
00025 class KFormulaDoc;
00026 class KFormulaPartView;
00027 class KFormulaWidget;
00028 class KSelectAction;
00029 class QPaintEvent;
00030 class QScrollView;
00031 class DCOPObject;
00032 
00033 namespace KFormula {
00034     class View;
00035 }
00036 
00037 #include <KoView.h>
00038 #include <qptrlist.h>
00039 #include <qstringlist.h>
00040 
00044 class KFormulaPartView : public KoView
00045 {
00046     Q_OBJECT
00047 
00048 public:
00049     KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent=0, const char* _name=0);
00050     virtual ~KFormulaPartView();
00051     virtual DCOPObject* dcopObject();
00052 
00053     virtual void setupPrinter( KPrinter &printer );
00054     virtual void print( KPrinter &printer );
00055 
00056     KFormulaDoc* document() const { return m_pDoc; }
00057 
00058     const KFormula::View* formulaView() const;
00059     KFormula::View* formulaView();
00060 
00061     QStringList readFormulaString( QString text );
00062 
00063 protected:
00064 
00065     virtual void resizeEvent(QResizeEvent* _ev);
00066     virtual void focusInEvent(QFocusEvent*);
00067 
00068     virtual void updateReadWrite(bool);
00069 
00070 protected slots:
00071 
00072     void configure();
00073     void cursorChanged(bool visible, bool selecting);
00074 
00075     void formulaString();
00076 
00077     void sizeSelected( int );
00078 
00079     void slotShowTipOnStart();
00080     void slotShowTip();
00081 
00082 private:
00083 
00087     void setEnabled(bool enabled);
00088 
00089     KFormulaDoc *m_pDoc;
00090     KFormulaWidget* formulaWidget;
00091     QScrollView* scrollview;
00092 
00093     KAction* cutAction;
00094     KAction* copyAction;
00095     KAction* pasteAction;
00096 
00097     KAction* addBracketAction;
00098     KAction* addFractionAction;
00099     KAction* addRootAction;
00100     KAction* addSumAction;
00101     KAction* addProductAction;
00102     KAction* addIntegralAction;
00103     KAction* addMatrixAction;
00104     KAction* addUpperLeftAction;
00105     KAction* addLowerLeftAction;
00106     KAction* addUpperRightAction;
00107     KAction* addLowerRightAction;
00108     KAction* addGenericUpperAction;
00109     KAction* addGenericLowerAction;
00110     KAction* removeEnclosingAction;
00111 
00112     KAction* formulaStringAction;
00113 
00114     static bool first_window;
00115 
00116     DCOPObject *m_dcop;
00117 };
00118 
00119 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys