Bump version to 5.0-14
[LibreOffice.git] / shell / source / win32 / shlxthandler / propsheets / document_statistic.hxx
blob45a747784600b38da6071d6fae600ab1c7027a76
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 <vector>
26 #include "internal/metainforeader.hxx"
31 struct statistic_item
33 statistic_item();
35 statistic_item(
36 const std::wstring& title,
37 const std::wstring& value,
38 bool editable) :
39 title_(title),
40 value_(value),
41 editable_(editable)
44 std::wstring title_;
45 std::wstring value_;
46 bool editable_;
51 typedef std::vector<statistic_item> statistic_item_list_t;
52 typedef std::pair<std::wstring, statistic_item_list_t> statistic_group_t;
53 typedef std::vector<statistic_group_t> statistic_group_list_t;
57 class document_statistic_reader;
58 typedef std::unique_ptr<document_statistic_reader> document_statistic_reader_ptr;
60 document_statistic_reader_ptr create_document_statistic_reader(const std::string& document_name, CMetaInfoReader* meta_info_accessor);
64 class document_statistic_reader
66 public:
67 virtual ~document_statistic_reader();
69 void read(statistic_group_list_t* group_list);
71 std::string get_document_name() const;
73 protected:
74 document_statistic_reader(const std::string& document_name, CMetaInfoReader* meta_info_accessor);
76 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list) = 0;
78 virtual void fill_origin_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list);
80 private:
81 std::string document_name_;
82 CMetaInfoReader* meta_info_accessor_;
84 friend document_statistic_reader_ptr create_document_statistic_reader(
85 const std::string& document_name, CMetaInfoReader* meta_info_accessor);
90 class writer_document_statistic_reader : public document_statistic_reader
92 protected:
93 writer_document_statistic_reader(const std::string& document_name, CMetaInfoReader* meta_info_accessor);
95 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list);
97 friend document_statistic_reader_ptr create_document_statistic_reader(
98 const std::string& document_name, CMetaInfoReader* meta_info_accessor);
103 class calc_document_statistic_reader : public document_statistic_reader
105 protected:
106 calc_document_statistic_reader(const std::string& document_name, CMetaInfoReader* meta_info_accessor);
108 virtual void fill_description_section( CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list);
110 friend document_statistic_reader_ptr create_document_statistic_reader(
111 const std::string& document_name, CMetaInfoReader* meta_info_accessor);
116 class draw_impress_math_document_statistic_reader : public document_statistic_reader
118 protected:
119 draw_impress_math_document_statistic_reader(const std::string& document_name, CMetaInfoReader* meta_info_accessor);
121 virtual void fill_description_section(CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list);
123 friend document_statistic_reader_ptr create_document_statistic_reader(
124 const std::string& document_name, CMetaInfoReader* meta_info_accessor);
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */