kspread

kspread_handler.h

00001 #ifndef KSPREAD_HANDLER_H
00002 #define KSPREAD_HANDLER_H
00003 
00004 #include <KoContainerHandler.h>
00005 
00006 #include <qpoint.h>
00007 
00008 #include <KoQueryTrader.h>
00009 
00010 class QWidget;
00011 
00012 enum HandlerType
00013 {
00014   Part,
00015   Chart,
00016   Picture
00017 };
00018 
00019 namespace KSpread
00020 {
00021 class View;
00022 
00028 class InsertHandler : public KoEventHandler
00029 {
00030     Q_OBJECT
00031 public:
00032     InsertHandler( View* view, QWidget* widget );
00033     ~InsertHandler();
00034 
00035     virtual HandlerType getType() = 0;
00036 
00037 protected:
00038     bool eventFilter( QObject*, QEvent* );
00039     virtual void insertObject( QRect ) = 0;
00040 
00041     View* m_view;
00042     QPoint m_geometryStart;
00043     QPoint m_geometryEnd;
00044     bool m_started;
00045     bool m_clicked;
00046 };
00047 
00048 class InsertPartHandler : public InsertHandler
00049 {
00050   public:
00051     InsertPartHandler( View* view, QWidget* widget, const KoDocumentEntry& entry );
00052     virtual ~InsertPartHandler();
00053     HandlerType getType() { return Part; }
00054 
00055   private:
00056     void insertObject( QRect );
00057 
00058     KoDocumentEntry m_entry;
00059 };
00060 
00061 
00062 class InsertChartHandler : public InsertHandler
00063 {
00064   public:
00065     InsertChartHandler( View* view, QWidget* widget, const KoDocumentEntry& entry );
00066     virtual ~InsertChartHandler();
00067     HandlerType getType() { return Chart; }
00068 
00069   private:
00070     void insertObject( QRect );
00071 
00072     KoDocumentEntry m_entry;
00073 };
00074 
00075 class InsertPictureHandler : public InsertHandler
00076 {
00077   public:
00078     InsertPictureHandler( View* view, QWidget* widget, const KURL &);
00079     virtual ~InsertPictureHandler();
00080     HandlerType getType() { return Picture; }
00081 
00082   private:
00083     void insertObject( QRect );
00084 
00085     KURL m_file;
00086 };
00087 
00088 } // namespace KSpread
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys