ProjectNotes.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * ProjectNotes.h - header for project-notes-editor
  3. *
  4. * Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef PROJECT_NOTES_H
  25. #define PROJECT_NOTES_H
  26. #include <QMainWindow>
  27. #include <QCloseEvent>
  28. #include "SerializingObject.h"
  29. class QAction;
  30. class QComboBox;
  31. class QTextCharFormat;
  32. class QTextEdit;
  33. class LMMS_EXPORT ProjectNotes : public QMainWindow, public SerializingObject
  34. {
  35. Q_OBJECT
  36. public:
  37. ProjectNotes();
  38. virtual ~ProjectNotes();
  39. void clear();
  40. void setText( const QString & _text );
  41. void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
  42. void loadSettings( const QDomElement & _this ) override;
  43. inline QString nodeName() const override
  44. {
  45. return "projectnotes";
  46. }
  47. protected:
  48. void closeEvent( QCloseEvent * _ce ) override;
  49. void setupActions();
  50. private slots:
  51. void textBold();
  52. void textUnderline();
  53. void textItalic();
  54. void textFamily( const QString & _f );
  55. void textSize( const QString & _p );
  56. void textColor();
  57. void textAlign( QAction * _a );
  58. void formatChanged( const QTextCharFormat & _f );
  59. void alignmentChanged( int _a );
  60. private:
  61. QTextEdit * m_edit;
  62. QAction * m_actionTextBold,
  63. * m_actionTextUnderline,
  64. * m_actionTextItalic,
  65. * m_actionTextColor,
  66. * m_actionAlignLeft,
  67. * m_actionAlignCenter,
  68. * m_actionAlignRight,
  69. * m_actionAlignJustify;
  70. QComboBox * m_comboFont;
  71. QComboBox * m_comboSize;
  72. } ;
  73. #endif