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. public:
  25. InsertHandler( View* view, TQWidget* widget );
  26. ~InsertHandler();
  27. virtual HandlerType getType() = 0;
  28. protected:
  29. bool eventFilter( TQObject*, TQEvent* );
  30. virtual void insertObject( TQRect ) = 0;
  31. View* m_view;
  32. TQPoint m_geometryStart;
  33. TQPoint m_geometryEnd;
  34. bool m_started;
  35. bool m_clicked;
  36. };
  37. class InsertPartHandler : public InsertHandler
  38. {
  39. public:
  40. InsertPartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry );
  41. virtual ~InsertPartHandler();
  42. HandlerType getType() { return Part; }
  43. private:
  44. void insertObject( TQRect );
  45. KoDocumentEntry m_entry;
  46. };
  47. class InsertChartHandler : public InsertHandler
  48. {
  49. public:
  50. InsertChartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry );
  51. virtual ~InsertChartHandler();
  52. HandlerType getType() { return Chart; }
  53. private:
  54. void insertObject( TQRect );
  55. KoDocumentEntry m_entry;
  56. };
  57. class InsertPictureHandler : public InsertHandler
  58. {
  59. public:
  60. InsertPictureHandler( View* view, TQWidget* widget, const KURL &);
  61. virtual ~InsertPictureHandler();
  62. HandlerType getType() { return Picture; }
  63. private:
  64. void insertObject( TQRect );
  65. KURL m_file;
  66. };
  67. } // namespace KSpread
  68. #endif