]> git.sesse.net Git - casparcg/blob - core/help/help_sink.h
[mixer] Merged fixed from 2.0 where contrast adjustment incorrectly worked on premult...
[casparcg] / core / help / help_sink.h
1 /*
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
3 *
4 * This file is part of CasparCG (www.casparcg.com).
5 *
6 * CasparCG 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 3 of the License, or
9 * (at your option) any later version.
10 *
11 * CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Author: Helge Norberg, helge.norberg@svt.se
20 */
21
22 #pragma once
23
24 #include <string>
25
26 #include <common/memory.h>
27
28 namespace caspar { namespace core {
29
30 class paragraph_builder : public spl::enable_shared_from_this<paragraph_builder>
31 {
32 public:
33         virtual ~paragraph_builder() { }
34         virtual spl::shared_ptr<paragraph_builder> text(std::wstring text) { return shared_from_this(); };
35         virtual spl::shared_ptr<paragraph_builder> code(std::wstring text) { return shared_from_this(); };
36         virtual spl::shared_ptr<paragraph_builder> strong(std::wstring text) { return shared_from_this(); };
37         virtual spl::shared_ptr<paragraph_builder> see(std::wstring item) { return shared_from_this(); };
38         virtual spl::shared_ptr<paragraph_builder> url(std::wstring url, std::wstring name = L"") { return shared_from_this(); };
39 };
40
41 class definition_list_builder : public spl::enable_shared_from_this<definition_list_builder>
42 {
43 public:
44         virtual ~definition_list_builder() { }
45         virtual spl::shared_ptr<definition_list_builder> item(std::wstring term, std::wstring description) { return shared_from_this(); };
46 };
47
48 class help_sink
49 {
50 public:
51         virtual ~help_sink() { }
52
53         virtual void short_description(const std::wstring& short_description) { };
54         virtual void syntax(const std::wstring& syntax) { };
55         virtual spl::shared_ptr<paragraph_builder> para() { return spl::make_shared<paragraph_builder>(); }
56         virtual spl::shared_ptr<definition_list_builder> definitions() { return spl::make_shared<definition_list_builder>(); }
57         virtual void example(const std::wstring& code, const std::wstring& caption = L"") { }
58 private:
59         virtual void begin_item(const std::wstring& name) { };
60         virtual void end_item() { };
61
62         friend help_repository;
63 };
64
65 }}