KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
1.7KB

  1. #ifndef KSPREAD_HANDLER_H
  2. #define KSPREAD_HANDLER_H
  3. #include <KoContainerHandler.h>
  4. #include <tqpoint.h>
  5. #include <KoQueryTrader.h>
  6. class TQWidget;
  7. enum HandlerType
  8. {
  9. Part,
  10. Chart,
  11. Picture
  12. };
  13. namespace KSpread
  14. {
  15. class View;
  16. /**
  17. * This event handler is used to insert a new part. The event handler
  18. * takes care of selecting the rectangle at which the new
  19. * part will appear.
  20. */
  21. class InsertHandler : public KoEventHandler
  22. {
  23. Q_OBJECT
  24. TQ_OBJECT
  25. public:
  26. InsertHandler( View* view, TQWidget* widget );
  27. ~InsertHandler();
  28. virtual HandlerType getType() = 0;
  29. protected:
  30. bool eventFilter( TQObject*, TQEvent* );
  31. virtual void insertObject( TQRect ) = 0;
  32. View* m_view;
  33. TQPoint m_geometryStart;
  34. TQPoint m_geometryEnd;
  35. bool m_started;
  36. bool m_clicked;
  37. };
  38. class InsertPartHandler : public InsertHandler
  39. {
  40. public:
  41. InsertPartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry );
  42. virtual ~InsertPartHandler();
  43. HandlerType getType() { return Part; }
  44. private:
  45. void insertObject( TQRect );
  46. KoDocumentEntry m_entry;
  47. };
  48. class InsertChartHandler : public InsertHandler
  49. {
  50. public:
  51. InsertChartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry );
  52. virtual ~InsertChartHandler();
  53. HandlerType getType() { return Chart; }
  54. private:
  55. void insertObject( TQRect );
  56. KoDocumentEntry m_entry;
  57. };
  58. class InsertPictureHandler : public InsertHandler
  59. {
  60. public:
  61. InsertPictureHandler( View* view, TQWidget* widget, const KURL &);
  62. virtual ~InsertPictureHandler();
  63. HandlerType getType() { return Picture; }
  64. private:
  65. void insertObject( TQRect );
  66. KURL m_file;
  67. };
  68. } // namespace KSpread
  69. #endif