kword

KWFrameSetEdit.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 Reginald Stadlbauer <reggie@kde.org>
00003    Copyright (C) 2005 Thomas Zander <zander@kde.org>
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 of the License, or (at your option) any later version.
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 frame_set_edit_h
00022 #define frame_set_edit_h
00023 
00024 #include <qrect.h>
00025 #include <KoPoint.h>
00026 #include <KoRect.h>
00027 
00028 class KWCanvas;
00029 class KWFrame;
00030 class KWFrameSet;
00031 class KWView;
00032 class KWViewMode;
00033 class KWFrameViewManager;
00034 
00035 class QDragEnterEvent;
00036 class QDragLeaveEvent;
00037 class QDragMoveEvent;
00038 class QDropEvent;
00039 class QIMEvent;
00040 class QKeyEvent;
00041 class QMimeSource;
00042 class QMouseEvent;
00043 class QPainter;
00044 class QPoint;
00045 
00050 class KWFrameSetEdit
00051 {
00052 public:
00053     KWFrameSetEdit( KWFrameSet * fs, KWCanvas * canvas );
00054     virtual ~KWFrameSetEdit() {}
00055 
00056     KWFrameSet * frameSet() const { return m_fs; }
00057     KWCanvas * canvas() const { return m_canvas; }
00058     KWFrame * currentFrame() const { return m_currentFrame; }
00059 
00063     virtual KWFrameSetEdit* currentTextEdit() { return 0L; }
00064 
00068     virtual void terminate(bool /*removeselection*/ = true) {}
00069 
00075     virtual void drawContents( QPainter *, const QRect &,
00076                                const QColorGroup &, bool onlyChanged, bool resetChanged,
00077                                KWViewMode *viewMode,
00078                                KWFrameViewManager *frameViewManager );
00079 
00080     // Events forwarded by the canvas (when being in "edit" mode)
00081     virtual void keyPressEvent( QKeyEvent * ) {}
00082     virtual void keyReleaseEvent( QKeyEvent * ) {}
00083     virtual void imStartEvent( QIMEvent * ) {}
00084     virtual void imComposeEvent( QIMEvent * ) {}
00085     virtual void imEndEvent( QIMEvent * ) {}
00086     virtual void mousePressEvent( QMouseEvent *, const QPoint &, const KoPoint & ) {}
00087     virtual void mouseMoveEvent( QMouseEvent *, const QPoint &, const KoPoint & ) {} // only called if button is pressed
00088     virtual void mouseReleaseEvent( QMouseEvent *, const QPoint &, const KoPoint & ) {}
00089     virtual void mouseDoubleClickEvent( QMouseEvent *, const QPoint &, const KoPoint & ) {}
00090     virtual void dragEnterEvent( QDragEnterEvent * ) {}
00091     virtual void dragMoveEvent( QDragMoveEvent *, const QPoint &, const KoPoint & ) {}
00092     virtual void dragLeaveEvent( QDragLeaveEvent * ) {}
00093     virtual void dropEvent( QDropEvent *, const QPoint &, const KoPoint &, KWView* ) {}
00094     virtual void focusInEvent() {}
00095     virtual void focusOutEvent() {}
00096     virtual void copy() {}
00097     virtual void cut() {}
00098     virtual void paste() {}
00099     virtual void selectAll() {}
00100     virtual void pasteData( QMimeSource* /*data*/, int /*provides*/, bool /*drop*/ ) {}
00101 
00102 
00105     bool exitLeft();
00108     bool exitRight();
00109 
00110 protected:
00111     KWFrameSet * m_fs;
00112     KWCanvas * m_canvas;
00117     KWFrame * m_currentFrame;
00118 };
00119 
00120 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys