Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / shell / source / win32 / shlxthandler / propsheets / document_statistic.hxx
blobe6f0dc5dc29a85dcbb48a810004c7b5213237656
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_DOCUMENT_STATISTIC_HXX
21 #define INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_DOCUMENT_STATISTIC_HXX
23 #include <utility>
24 #include <string>
25 #include <memory>
26 #include <vector>
27 #include <metainforeader.hxx>
30 struct statistic_item
32 statistic_item();
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)
43 std::wstring title_;
44 std::wstring value_;
45 bool editable_;
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;
54 class document_statistic_reader;
55 typedef std::unique_ptr<document_statistic_reader> document_statistic_reader_ptr;
57 document_statistic_reader_ptr create_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
60 class document_statistic_reader
62 public:
63 virtual ~document_statistic_reader();
65 void read(statistic_group_list_t* group_list);
67 std::wstring get_document_name() const;
69 protected:
70 document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
72 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list) = 0;
74 virtual void fill_origin_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list);
76 private:
77 std::wstring document_name_;
78 CMetaInfoReader* meta_info_accessor_;
80 friend document_statistic_reader_ptr create_document_statistic_reader(
81 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
85 class writer_document_statistic_reader : public document_statistic_reader
87 protected:
88 writer_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
90 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list) override;
92 friend document_statistic_reader_ptr create_document_statistic_reader(
93 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
97 class calc_document_statistic_reader : public document_statistic_reader
99 protected:
100 calc_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
102 virtual void fill_description_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list) override;
104 friend document_statistic_reader_ptr create_document_statistic_reader(
105 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
109 class draw_impress_math_document_statistic_reader : public document_statistic_reader
111 protected:
112 draw_impress_math_document_statistic_reader(const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
114 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list) override;
116 friend document_statistic_reader_ptr create_document_statistic_reader(
117 const std::wstring& document_name, CMetaInfoReader* meta_info_accessor);
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */