PageRenderTime 1162ms CodeModel.GetById 1157ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 9#pragma once
10
11#include "guilib/GUIDialog.h"
12
13class CGUIDialogTextViewer :
14      public CGUIDialog
15{
16public:
17  CGUIDialogTextViewer(void);
18  ~CGUIDialogTextViewer(void) override;
19  bool OnMessage(CGUIMessage& message) override;
20  void SetText(const std::string& strText) { m_strText = strText; }
21  void SetHeading(const std::string& strHeading) { m_strHeading = strHeading; }
22  void UseMonoFont(bool use);
23
24  //! \brief Load a file into memory and show in dialog.
25  //! \param path Path to file
26  //! \param useMonoFont True to use monospace font
27  static void ShowForFile(const std::string& path, bool useMonoFont);
28protected:
29  void OnDeinitWindow(int nextWindowID) override;
30  bool OnAction(const CAction &action) override;
31
32  std::string m_strText;
33  std::string m_strHeading;
34  bool m_mono = false;
35
36  void SetText();
37  void SetHeading();
38};
39