F:/KPlato/koffice/libs/kofficecore/KoView.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef __koView_h__
00020 #define __koView_h__
00021 
00022 #include <QWidget>
00023 #include <QPointer>
00024 //Added by qt3to4:
00025 #include <QCustomEvent>
00026 
00027 #include <kparts/part.h>
00028 
00029 #include <KoChild.h>
00030 #include <koffice_export.h>
00031 #include <KoDocumentChild.h>
00032 #include <KoFrame.h>
00033 #include <KoViewChild.h>
00034 class KoDocument;
00035 class KoMainWindow;
00036 class KoViewPrivate;
00037 class KoViewChild;
00038 class KoDocumentChild;
00039 class KoDockFactory;
00040 
00041 // KDE classes
00042 class KStatusBar;
00043 class KInstance;
00044 class KPrinter;
00045 class KMainWindow;
00046 class KAction;
00047 class KActionCollection;
00048 namespace KParts
00049 {
00050   class PartManager;
00051   class PartActivateEvent;
00052   class PartSelectEvent;
00053 }
00054 
00055 // Qt classes
00056 class QDockWidget;
00057 class QCustomEvent;
00058 
00064 class KOFFICECORE_EXPORT KoView : public QWidget, public KParts::PartBase
00065 {
00066   Q_OBJECT
00067 public:
00079   KoView( KoDocument *document, QWidget *parent = 0 );
00083   virtual ~KoView();
00084 
00088   KoDocument *koDocument() const;
00089 
00093   void setDocumentDeleted();
00099   bool documentDeleted() const;
00100 
00101   virtual void setPartManager( KParts::PartManager *manager );
00102   virtual KParts::PartManager *partManager() const;
00103 
00115   virtual KAction *action( const QDomElement &element ) const;
00116 
00127   virtual KoDocument *hitTest( const QPoint &pos );
00128 
00147   virtual int leftBorder() const;
00151   virtual int rightBorder() const;
00155   virtual int topBorder() const;
00159   virtual int bottomBorder() const;
00160 
00171   virtual void setZoom( double zoom );
00177   virtual double zoom() const;
00178 
00185   virtual QWidget *canvas() const;
00186 
00194   virtual int canvasXOffset() const;
00195 
00203   virtual int canvasYOffset() const;
00204 
00213   virtual void canvasAddChild( KoViewChild *child );
00214 
00219    virtual KoDocumentChild *selectedChild();
00220 
00225   virtual KoDocumentChild *activeChild();
00226 
00230   void enableAutoScroll();
00231 
00235   void disableAutoScroll();
00236 
00240   virtual void paintEverything( QPainter &painter, const QRect &rect, bool transparent = false );
00241 
00248   bool hasDocumentInWindow( KoDocument *doc );
00249 
00258   virtual QMatrix matrix() const KDE_DEPRECATED;
00259 
00266   virtual QPoint applyViewTransformations( const QPoint& ) const;
00267 
00275   virtual QPoint reverseViewTransformations( const QPoint& ) const;
00276 
00280   virtual QRect applyViewTransformations( const QRect& ) const;
00281 
00285   virtual QRect reverseViewTransformations( const QRect& ) const;
00286 
00292   KoViewChild *child( KoView *view );
00297   KoViewChild *child( KoDocument *document );
00298 
00304 //   virtual DCOPObject * dcopObject();
00305 
00311   virtual void setupPrinter( KPrinter &printer );
00312 
00313   // BCI: make it return a bool, so that aborting doesn't still fire up the print preview afterwards
00317   virtual void print( KPrinter &printer );
00318 
00324   KoMainWindow * shell() const;
00325 
00330   KMainWindow* mainWindow() const;
00331 
00337   KStatusBar * statusBar() const;
00338 
00350   void addStatusBarItem( QWidget * widget, int stretch = 0, bool permanent = false );
00351 
00355   void removeStatusBarItem( QWidget * widget );
00356 
00360   void showAllStatusBarItems( bool show );
00361 
00371    QDockWidget * createDock(const QString & title, QWidget * w);
00372     
00377   virtual void updateReadWrite( bool readwrite ) = 0;
00378 
00387     virtual QDockWidget *createToolBox() { return 0; }
00388 
00393     virtual QDockWidget *createShapeSelector() { return 0; }
00394 
00402     QDockWidget *createDockWidget(KoDockFactory* factory);
00403 
00409   bool isInOperation() const;
00410 
00411 public slots:
00415     virtual void newView();
00416 
00423     virtual void beginOperation();
00424 
00431     virtual void endOperation();
00432 
00437     void slotActionStatusText( const QString &text );
00438 
00443     void slotClearStatusText();
00444 
00445 protected:
00451   virtual void customEvent( QEvent *ev );
00452 
00456   virtual void partActivateEvent( KParts::PartActivateEvent *event );
00460   virtual void partSelectEvent( KParts::PartSelectEvent *event );
00464   virtual void guiActivateEvent( KParts::GUIActivateEvent * );
00465 
00466 
00470   QString newObjectName();
00471 
00472 signals:
00473   void activated( bool active );
00474   void selected( bool select );
00475 
00476   void autoScroll(const QPoint &scrollDistance);
00477 
00478   void childSelected( KoDocumentChild *child );
00479   void childUnselected( KoDocumentChild *child );
00480 
00481   void childActivated( KoDocumentChild *child );
00482   void childDeactivated( KoDocumentChild *child );
00483 
00484   void regionInvalidated( const QRegion &region, bool erase );
00485 
00486   void invalidated();
00487 
00488 // KDE invents public signals :)
00489 #undef signals
00490 #define signals public
00491 signals:
00492 
00498   void embeddImage(const QString &filename);
00499 
00500 #undef signals
00501 #define signals protected
00502 
00503 protected slots:
00504   virtual void slotChildActivated( bool a );
00505   virtual void slotChildChanged( KoDocumentChild *child );
00506   virtual void slotAutoScroll( );
00507 
00508 private:
00509   KAction *actionNewView;
00510   virtual void setupGlobalActions( void );
00511   KoViewPrivate *d;
00512   int autoScrollAcceleration( int offset ) const;
00513 };
00514 
00515 #endif

Généré le Wed Nov 22 23:41:04 2006 pour KPlato par  doxygen 1.5.1-p1