Orcus
auto_filter.hpp
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 */
7
8#ifndef INCLUDED_ORCUS_SPREADSHEET_AUTO_FILTER_HPP
9#define INCLUDED_ORCUS_SPREADSHEET_AUTO_FILTER_HPP
10
11#include "types.hpp"
12#include "orcus/pstring.hpp"
13#include "../env.hpp"
14
15#include <map>
16#include <unordered_set>
17
18#include <ixion/address.hpp>
19
20namespace orcus { namespace spreadsheet {
21
25struct ORCUS_SPM_DLLPUBLIC auto_filter_column_t
26{
27 typedef std::unordered_set<pstring, pstring::hash> match_values_type;
28 match_values_type match_values;
29
30 void reset();
31 void swap(auto_filter_column_t& r);
32};
33
38struct ORCUS_SPM_DLLPUBLIC auto_filter_t
39{
40 typedef std::map<col_t, auto_filter_column_t> columns_type;
41
42 ixion::abs_range_t range;
43
44 columns_type columns;
45
47
48 void reset();
49 void swap(auto_filter_t& r);
50
59 void commit_column(col_t col, auto_filter_column_t& data);
60};
61
65struct ORCUS_SPM_DLLPUBLIC table_column_t
66{
67 size_t identifier;
68 pstring name;
69 pstring totals_row_label;
70 totals_row_function_t totals_row_function;
71
73
74 void reset();
75};
76
80struct ORCUS_SPM_DLLPUBLIC table_style_t
81{
82 pstring name;
83
84 bool show_first_column:1;
85 bool show_last_column:1;
86 bool show_row_stripes:1;
87 bool show_column_stripes:1;
88
90
91 void reset();
92};
93
98struct ORCUS_SPM_DLLPUBLIC table_t
99{
100 typedef std::vector<table_column_t> columns_type;
101
102 size_t identifier;
103
104 pstring name;
105 pstring display_name;
106
107 ixion::abs_range_t range;
108
109 size_t totals_row_count;
110
111 auto_filter_t filter;
112 columns_type columns;
113 table_style_t style;
114
115 table_t();
116
117 void reset();
118};
119
120}}
121
122#endif
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: pstring.hpp:28
Definition: auto_filter.hpp:26
Definition: auto_filter.hpp:39
void commit_column(col_t col, auto_filter_column_t &data)
Definition: auto_filter.hpp:66
Definition: auto_filter.hpp:81
Definition: auto_filter.hpp:99