Bibletime – a bible study tool
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.

cplainwritedisplay.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*********
  2. *
  3. * This file is part of BibleTime's source code, http://www.bibletime.info/.
  4. *
  5. * Copyright 1999-2006 by the BibleTime developers.
  6. * The BibleTime source code is licensed under the GNU General Public License version 2.0.
  7. *
  8. **********/
  9. #ifndef CPLAINWRITEDISPLAY_H
  10. #define CPLAINWRITEDISPLAY_H
  11. //Bibletime include files
  12. #include "cwritedisplay.h"
  13. //TQt includes
  14. #include <tqwidget.h>
  15. #include <tqtextedit.h>
  16. class CHTMLWriteDisplay;
  17. class TDEAction;
  18. /** The write display implementation for plain source code editing.
  19. * @author The BibleTime team
  20. */
  21. class CPlainWriteDisplay : public TQTextEdit, public CWriteDisplay {
  22. public:
  23. /**
  24. * Reimplementation.
  25. */
  26. virtual void selectAll();
  27. /**
  28. * Sets the new text for this display widget.
  29. */
  30. virtual void setText( const TQString& newText );
  31. /**
  32. * Returns true if the display widget has a selection. Otherwise false.
  33. */
  34. virtual const bool hasSelection();
  35. /**
  36. * Returns the view of this display widget.
  37. */
  38. virtual TQWidget* view();
  39. virtual const TQString text( const CDisplay::TextType format = CDisplay::HTMLText, const CDisplay::TextPart part = CDisplay::Document );
  40. virtual void print( const CDisplay::TextPart, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions );
  41. /**
  42. * Reimplementation.
  43. */
  44. virtual const bool isModified() const;
  45. /**
  46. * Sets the current status of the edit widget.
  47. */
  48. virtual void setModified( const bool modified );
  49. /**
  50. * Returns the text of this edit widget.
  51. */
  52. virtual const TQString plainText();
  53. /**
  54. * Creates the necessary action objects and puts them on the toolbar.
  55. */
  56. virtual void setupToolbar(TDEToolBar * bar, TDEActionCollection * actionCollection);
  57. protected:
  58. friend class CDisplay;
  59. friend class CHTMLWriteDisplay;
  60. CPlainWriteDisplay(CWriteWindow* parentWindow, TQWidget* parent);
  61. virtual ~CPlainWriteDisplay();
  62. /**
  63. * Reimplementation from TQTextEdit. Provides an popup menu for the given position.
  64. */
  65. virtual TQPopupMenu* createPopupMenu( const TQPoint& pos );
  66. /**
  67. * Reimplementation from TQTextEdit. Provides an popup menu.
  68. */
  69. virtual TQPopupMenu* createPopupMenu();
  70. /**
  71. * Reimplementation to manage drops of our drag and drop objects.
  72. */
  73. virtual void contentsDropEvent( TQDropEvent* e );
  74. /**
  75. * Reimplementation to insert the text of a dragged reference into the edit view.
  76. */
  77. virtual void contentsDragEnterEvent( TQDragEnterEvent* e );
  78. /**
  79. * Reimplementation to insert the text of a dragged reference into the edit view.
  80. */
  81. virtual void contentsDragMoveEvent( TQDragMoveEvent* e );
  82. };
  83. #endif