TDE personal information management applications
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.
 
 
 
 
 
 

133 lines
3.5 KiB

  1. /*******************************************************************
  2. KNotes -- Notes for the KDE project
  3. Copyright (c) 1997-2004, The KNotes Developers
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. *******************************************************************/
  16. #ifndef KNOTEEDIT_H
  17. #define KNOTEEDIT_H
  18. #include <tqwidget.h>
  19. #include <ktextedit.h>
  20. class KNote;
  21. class TQFont;
  22. class TQColor;
  23. class TQPushButton;
  24. class TDEAction;
  25. class TDEActionCollection;
  26. class TDEToggleAction;
  27. class TDEFontAction;
  28. class TDEFontSizeAction;
  29. class KNoteEdit : public KTextEdit
  30. {
  31. Q_OBJECT
  32. public:
  33. KNoteEdit( TDEActionCollection *actions, TQWidget *parent=0, const char *name=0 );
  34. ~KNoteEdit();
  35. void setNote( KNote *_note ) {
  36. m_note = _note;
  37. }
  38. void setText( const TQString& text );
  39. void setTextFont( const TQFont& font );
  40. void setTextColor( const TQColor& color );
  41. void setTabStop( int tabs );
  42. void setAutoIndentMode( bool newmode );
  43. public slots:
  44. virtual void setTextFormat( TextFormat f );
  45. void textStrikeOut( bool );
  46. void textColor();
  47. void textAlignLeft();
  48. void textAlignCenter();
  49. void textAlignRight();
  50. void textAlignBlock();
  51. void textList();
  52. void textSuperScript();
  53. void textSubScript();
  54. //void textIncreaseIndent();
  55. //void textDecreaseIndent();
  56. void slotCutEnabled( bool );
  57. protected:
  58. virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
  59. virtual void contentsDropEvent( TQDropEvent *e );
  60. virtual TQPopupMenu *createPopupMenu( const TQPoint &pos );
  61. private slots:
  62. void slotReturnPressed();
  63. void fontChanged( const TQFont &f );
  64. void colorChanged( const TQColor &c );
  65. void alignmentChanged( int a );
  66. void verticalAlignmentChanged( VerticalAlignment a );
  67. void slotAllowTab();
  68. void setEnabledRedo( bool b );
  69. void setEnabledUndo( bool b );
  70. private:
  71. void autoIndent();
  72. virtual bool linksEnabled() const { return true; }
  73. virtual void emitLinkClicked( const TQString &s );
  74. void enableRichTextActions();
  75. void disableRichTextActions();
  76. private:
  77. TDEAction *m_cut;
  78. TDEAction *m_copy;
  79. TDEAction *m_paste;
  80. TDEToggleAction *m_textBold;
  81. TDEToggleAction *m_textItalic;
  82. TDEToggleAction *m_textUnderline;
  83. TDEToggleAction *m_textStrikeOut;
  84. TDEToggleAction *m_textAlignLeft;
  85. TDEToggleAction *m_textAlignCenter;
  86. TDEToggleAction *m_textAlignRight;
  87. TDEToggleAction *m_textAlignBlock;
  88. TDEToggleAction *m_textList;
  89. TDEToggleAction *m_textSuper;
  90. TDEToggleAction *m_textSub;
  91. //TDEAction *m_textIncreaseIndent;
  92. //TDEAction *m_textDecreaseIndent;
  93. TDEAction *m_textColor;
  94. TDEFontAction *m_textFont;
  95. TDEFontSizeAction *m_textSize;
  96. TDEAction* undo;
  97. TDEAction* redo;
  98. bool m_autoIndentMode;
  99. KNote *m_note;
  100. };
  101. #endif