bibletime
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.

chtmlwritedisplay.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 CHTMLWRITEDISPLAY_H
  10. #define CHTMLWRITEDISPLAY_H
  11. //BibleTime includes
  12. #include "cplainwritedisplay.h"
  13. //TQt includes
  14. #include <tqwidget.h>
  15. #include <tqtextedit.h>
  16. class CWriteWindow;
  17. class TQPopupMenu;
  18. class TDEToggleAction;
  19. class TDEFontAction;
  20. class TDEFontSizeAction;
  21. class KColorButton;
  22. /** The WYSIWYG implementation of the write display interface.
  23. * @author The BibleTime team
  24. */
  25. class CHTMLWriteDisplay : public CPlainWriteDisplay {
  26. Q_OBJECT
  27. public:
  28. /**
  29. * Sets the new text for this display widget.
  30. */
  31. virtual void setText( const TQString& newText );
  32. /**
  33. * Returns the text of this edit widget.
  34. */
  35. virtual const TQString plainText();
  36. /**
  37. * Creates the necessary action objects and puts them on the toolbar.
  38. */
  39. virtual void setupToolbar(TDEToolBar * bar, TDEActionCollection * actionCollection);
  40. protected:
  41. friend class CDisplay;
  42. CHTMLWriteDisplay(CWriteWindow* parentWindow, TQWidget* parent);
  43. ~CHTMLWriteDisplay();
  44. /**
  45. * Reimplementation to show a popup menu if the right mouse butoon was clicked.
  46. */
  47. virtual TQPopupMenu* createPopupMenu( const TQPoint& pos );
  48. protected slots:
  49. void toggleBold();
  50. void toggleItalic();
  51. void toggleUnderline();
  52. void alignLeft();
  53. void alignCenter();
  54. void alignRight();
  55. void slotFontChanged( const TQFont& );
  56. /**
  57. * The text's alignment changed. Enable the right buttons.
  58. */
  59. void slotAlignmentChanged( int );
  60. /**
  61. * Is called when a new color was selected.
  62. */
  63. void slotColorSelected( const TQColor& );
  64. /**
  65. * Is called when a text with another color was selected.
  66. */
  67. void slotColorChanged( const TQColor& );
  68. private:
  69. struct {
  70. TDEToggleAction* bold;
  71. TDEToggleAction* italic;
  72. TDEToggleAction* underline;
  73. TDEToggleAction* alignLeft;
  74. TDEToggleAction* alignCenter;
  75. TDEToggleAction* alignRight;
  76. TDEFontAction* fontChooser;
  77. TDEFontSizeAction* fontSizeChooser;
  78. //popup menu
  79. TDEAction* selectAll;
  80. }
  81. m_actions;
  82. KColorButton* m_colorButton;
  83. };
  84. #endif