File: table.hpp

package info (click to toggle)
liborcus 0.20.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,872 kB
  • sloc: xml: 78,842; cpp: 75,171; sh: 4,626; makefile: 2,838; python: 2,614
file content (92 lines) | stat: -rw-r--r-- 1,986 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#pragma once

#include "auto_filter.hpp"

#include <string_view>

#include <ixion/address.hpp>

namespace orcus { namespace spreadsheet {

/**
 * Single column entry in table.
 */
struct ORCUS_SPM_DLLPUBLIC table_column_t
{
    std::size_t identifier;
    std::string_view name;
    std::string_view totals_row_label;
    totals_row_function_t totals_row_function;

    table_column_t();
    table_column_t(const table_column_t& other);
    ~table_column_t();

    table_column_t& operator=(const table_column_t& other);

    void reset();
};

/**
 * Table style information.
 */
struct ORCUS_SPM_DLLPUBLIC table_style_t
{
    std::string_view name;

    bool show_first_column:1;
    bool show_last_column:1;
    bool show_row_stripes:1;
    bool show_column_stripes:1;

    table_style_t();
    table_style_t(const table_style_t& other);
    ~table_style_t();

    table_style_t& operator=(const table_style_t& other);

    void reset();
};

/**
 * Single table entry.  A table is a range in a spreadsheet that represents
 * a single set of data that can be used as a data source.
 */
struct ORCUS_SPM_DLLPUBLIC table_t
{
    typedef std::vector<table_column_t> columns_type;

    std::size_t identifier;

    std::string_view name;
    std::string_view display_name;

    ixion::abs_range_t range;

    std::size_t totals_row_count;

    auto_filter_t filter;
    columns_type columns;
    table_style_t style;

    table_t();
    table_t(const table_t& other) = delete;
    table_t(table_t&& other);
    ~table_t();

    table_t& operator=(const table_t& other) = delete;
    table_t& operator=(table_t&& other);

    void reset();
};

}}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */