Debian Codegraph @

shell/source/win32/shlxthandler/propsheets/document_statistic.hxx

raw
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20 #ifndef INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_DOCUMENT_STATISTIC_HXX
21 #define INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_DOCUMENT_STATISTIC_HXX
22
23 #include <utility>
24 #include <string>
25 #include <memory>
26 #include <vector>
27 #include <metainforeader.hxx>
28
29
30 struct statistic_item
31 {
32 statistic_item();
33
34 statistic_item(
35 const std::wstring& title,
36 const std::wstring& value,
37 bool editable) :
38 title_(title),
39 value_(value),
40 editable_(editable)
41 {}
42
43 std::wstring title_;
44 std::wstring value_;
45 bool editable_;
46 };
47
48
49 typedef std::vector<statistic_item> statistic_item_list_t;
50 typedef std::pair<std::wstring, statistic_item_list_t> statistic_group_t;
51 typedef std::vector<statistic_group_t> statistic_group_list_t;
52
53
54 class document_statistic_reader;
55 typedef std::unique_ptr<document_statistic_reader> document_statistic_reader_ptr;
56
57 document_statistic_reader_ptr create_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
58
59
60 class document_statistic_reader
61 {
62 public:
63 virtual ~document_statistic_reader();
64
65 void read(statistic_group_list_t* group_list);
66
67 std::wstring get_document_name() const;
68
69 protected:
70 document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
71
72 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list) = 0;
73
74 virtual void fill_origin_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list);
75
76 private:
77 std::wstring document_name_;
78 CMetaInfoReader* meta_info_accessor_;
79
80 friend document_statistic_reader_ptr create_document_statistic_reader(
81 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
82 };
83
84
85 class writer_document_statistic_reader : public document_statistic_reader
86 {
87 protected:
88 writer_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
89
90 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list) override;
91
92 friend document_statistic_reader_ptr create_document_statistic_reader(
93 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
94 };
95
96
97 class calc_document_statistic_reader : public document_statistic_reader
98 {
99 protected:
100 calc_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
101
102 virtual void fill_description_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list) override;
103
104 friend document_statistic_reader_ptr create_document_statistic_reader(
105 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
106 };
107
108
109 class draw_impress_math_document_statistic_reader : public document_statistic_reader
110 {
111 protected:
112 draw_impress_math_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
113
114 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list) override;
115
116 friend document_statistic_reader_ptr create_document_statistic_reader(
117 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
118 };
119
120 #endif
121
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */