/xbmc/dialogs/GUIDialogTextViewer.h

http://github.com/xbmc/xbmc · C Header · 39 lines · 22 code · 7 blank · 10 comment · 0 complexity · 07fdd4b0f118b1d68b90a6a10b14c9cf MD5 · raw file

  1. /*
  2. * Copyright (C) 2005-2018 Team Kodi
  3. * This file is part of Kodi - https://kodi.tv
  4. *
  5. * SPDX-License-Identifier: GPL-2.0-or-later
  6. * See LICENSES/README.md for more information.
  7. */
  8. #pragma once
  9. #include "guilib/GUIDialog.h"
  10. class CGUIDialogTextViewer :
  11. public CGUIDialog
  12. {
  13. public:
  14. CGUIDialogTextViewer(void);
  15. ~CGUIDialogTextViewer(void) override;
  16. bool OnMessage(CGUIMessage& message) override;
  17. void SetText(const std::string& strText) { m_strText = strText; }
  18. void SetHeading(const std::string& strHeading) { m_strHeading = strHeading; }
  19. void UseMonoFont(bool use);
  20. //! \brief Load a file into memory and show in dialog.
  21. //! \param path Path to file
  22. //! \param useMonoFont True to use monospace font
  23. static void ShowForFile(const std::string& path, bool useMonoFont);
  24. protected:
  25. void OnDeinitWindow(int nextWindowID) override;
  26. bool OnAction(const CAction &action) override;
  27. std::string m_strText;
  28. std::string m_strHeading;
  29. bool m_mono = false;
  30. void SetText();
  31. void SetHeading();
  32. };