summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
committermanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
commit4c3251ec645c8b71820dab7e51e612e5919d4e75 (patch)
tree9533268a93e58fc2e16de1b8ee3fafe3784e5225 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
parentf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (diff)
downloadkodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.gz
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.bz2
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
new file mode 100644
index 0000000..c64bc1e
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/TextViewer.h
@@ -0,0 +1,118 @@
1#pragma once
2/*
3 * Copyright (C) 2015-2016 Team KODI
4 * http://kodi.tv
5 *
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with KODI; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#include "../definitions.h"
23#include "../../AddonBase.h"
24
25namespace kodi
26{
27namespace gui
28{
29namespace dialogs
30{
31
32 //============================================================================
33 ///
34 /// \defgroup cpp_kodi_gui_dialogs_TextViewer Dialog Text Viewer
35 /// \ingroup cpp_kodi_gui
36 /// @{
37 /// @brief \cpp_namespace{ kodi::gui::dialogs::TextViewer }
38 /// **Text viewer dialog**
39 ///
40 /// The text viewer dialog can be used to display descriptions, help texts or
41 /// other larger texts.
42 ///
43 /// In order to achieve a line break is a <b>\\n</b> directly in the text or
44 /// in the <em>"./resources/language/resource.language.??_??/strings.po"</em>
45 /// to call with <b>std::string kodi::general::GetLocalizedString(...);</b>.
46 ///
47 /// It has the header \ref TextViewer.h "#include <kodi/gui/dialogs/TextViewer.h>"
48 /// be included to enjoy it.
49 ///
50 namespace TextViewer
51 {
52 //==========================================================================
53 ///
54 /// \ingroup cpp_kodi_gui_dialogs_TextViewer
55 /// @brief Show info text dialog
56 ///
57 /// @param[in] heading Small heading text
58 /// @param[in] text Showed text on dialog
59 ///
60 ///
61 ///-------------------------------------------------------------------------
62 ///
63 /// **Example:**
64 /// ~~~~~~~~~~~~~{.cpp}
65 /// #include <kodi/gui/dialogs/TextViewer.h>
66 ///
67 /// kodi::gui::dialogs::TextViewer::Show("The Wizard of Oz (1939 film)",
68 /// "The Wizard of Oz is a 1939 American musical comedy-drama fantasy film "
69 /// "produced by Metro-Goldwyn-Mayer, and the most well-known and commercially "
70 /// "successful adaptation based on the 1900 novel The Wonderful Wizard of Oz "
71 /// "by L. Frank Baum. The film stars Judy Garland as Dorothy Gale. The film"
72 /// "co-stars Terry the dog, billed as Toto; Ray Bolger, Jack Haley, Bert Lahr, "
73 /// "Frank Morgan, Billie Burke, Margaret Hamilton, with Charley Grapewin and "
74 /// "Clara Blandick, and the Singer Midgets as the Munchkins.\n"
75 /// "\n"
76 /// "Notable for its use of Technicolor, fantasy storytelling, musical score and "
77 /// "unusual characters, over the years it has become an icon of American popular "
78 /// "culture. It was nominated for six Academy Awards, including Best Picture but "
79 /// "lost to Gone with the Wind. It did win in two other categories including Best "
80 /// "Original Song for \"Over the Rainbow\". However, the film was a box office "
81 /// "disappointment on its initial release, earning only $3,017,000 on a $2,777,000 "
82 /// "budget, despite receiving largely positive reviews. It was MGM's most "
83 /// "expensive production at that time, and did not completely recoup the studio's "
84 /// "investment and turn a profit until theatrical re-releases starting in 1949.\n"
85 /// "\n"
86 /// "The 1956 broadcast television premiere of the film on CBS re-introduced the "
87 /// "film to the wider public and eventually made the presentation an annual "
88 /// "tradition, making it one of the most known films in cinema history. The "
89 /// "film was named the most-viewed motion picture on television syndication by "
90 /// "the Library of Congress who also included the film in its National Film "
91 /// "Registry in its inaugural year in 1989. Designation on the registry calls "
92 /// "for efforts to preserve it for being \"culturally, historically, and "
93 /// "aesthetically significant\". It is also one of the few films on UNESCO's "
94 /// "Memory of the World Register.\n"
95 /// "\n"
96 /// "The Wizard of Oz is often ranked on best-movie lists in critics' and public "
97 /// "polls. It is the source of many quotes referenced in modern popular culture. "
98 /// "It was directed primarily by Victor Fleming (who left production to take "
99 /// "over direction on the troubled Gone with the Wind production). Noel Langley, "
100 /// "Florence Ryerson and Edgar Allan Woolf received credit for the screenplay, "
101 /// "but there were uncredited contributions by others. The songs were written "
102 /// "by Edgar \"Yip\" Harburg (lyrics) and Harold Arlen (music). The incidental "
103 /// "music, based largely on the songs, was composed by Herbert Stothart, with "
104 /// "interspersed renderings from classical composers.\n");
105 /// ~~~~~~~~~~~~~
106 ///
107 inline void Show(const std::string& heading, const std::string& text)
108 {
109 using namespace ::kodi::addon;
110 CAddonBase::m_interface->toKodi->kodi_gui->dialogTextViewer->open(CAddonBase::m_interface->toKodi->kodiBase, heading.c_str(), text.c_str());
111 }
112 //--------------------------------------------------------------------------
113 };
114 /// @}
115
116} /* namespace dialogs */
117} /* namespace gui */
118} /* namespace kodi */