astyle.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. *openPilot Log - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef ASTYLE_H
  19. #define ASTYLE_H
  20. #include <QString>
  21. #include <QFileInfo>
  22. #include <QMap>
  23. /*!
  24. * \brief The AStyle class encapsulates style and stylesheet logic.
  25. * \todo Agree upon the file naming of the assets that will be read.
  26. * for now it is assumed that dark means "dark.qss"
  27. */
  28. class AStyle
  29. {
  30. private:
  31. static QString currentStyle;
  32. static QString currentStyleSheet;
  33. public:
  34. static const QStringList styles;
  35. static const QString defaultStyle;
  36. /*!
  37. * \brief contains a List of the available style sheets and their
  38. * file name in the resource system.
  39. */
  40. static const QList<QPair<QString, QString>> styleSheets;
  41. static const QString defaultStyleSheet;
  42. static void setup();
  43. static void setStyle(const QString style);
  44. static void setStyle(const QPair<QString, QString> stylesheet);
  45. static const QString& style();
  46. };
  47. #endif // ASTYLE_H