LmmsPalette.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * LmmsPalette.h - dummy class for fetching palette qproperties from CSS
  3. *
  4. *
  5. * Copyright (c) 2007-2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #include <QWidget>
  26. #include "lmms_export.h"
  27. #ifndef LMMSPALETTE_H
  28. #define LMMSPALETTE_H
  29. class LMMS_EXPORT LmmsPalette : public QWidget
  30. {
  31. Q_OBJECT
  32. Q_PROPERTY( QColor background READ background WRITE setBackground )
  33. Q_PROPERTY( QColor windowText READ windowText WRITE setWindowText )
  34. Q_PROPERTY( QColor base READ base WRITE setBase )
  35. Q_PROPERTY( QColor text READ text WRITE setText )
  36. Q_PROPERTY( QColor button READ button WRITE setButton )
  37. Q_PROPERTY( QColor shadow READ shadow WRITE setShadow )
  38. Q_PROPERTY( QColor buttonText READ buttonText WRITE setButtonText )
  39. Q_PROPERTY( QColor brightText READ brightText WRITE setBrightText )
  40. Q_PROPERTY( QColor highlight READ highlight WRITE setHighlight )
  41. Q_PROPERTY( QColor highlightedText READ highlightedText WRITE setHighlightedText )
  42. public:
  43. LmmsPalette( QWidget * parent, QStyle * stylearg );
  44. virtual ~LmmsPalette();
  45. #define ACCESSMET( read, write ) \
  46. QColor read () const; \
  47. void write ( const QColor & c ); \
  48. ACCESSMET( background, setBackground )
  49. ACCESSMET( windowText, setWindowText )
  50. ACCESSMET( base, setBase )
  51. ACCESSMET( text, setText )
  52. ACCESSMET( button, setButton )
  53. ACCESSMET( shadow, setShadow )
  54. ACCESSMET( buttonText, setButtonText )
  55. ACCESSMET( brightText, setBrightText )
  56. ACCESSMET( highlight, setHighlight )
  57. ACCESSMET( highlightedText, setHighlightedText )
  58. #undef ACCESSMET
  59. QPalette palette() const;
  60. private:
  61. QColor m_background;
  62. QColor m_windowText;
  63. QColor m_base;
  64. QColor m_text;
  65. QColor m_button;
  66. QColor m_shadow;
  67. QColor m_buttonText;
  68. QColor m_brightText;
  69. QColor m_highlight;
  70. QColor m_highlightedText;
  71. };
  72. #endif