Orcus
view.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_VIEW_HPP
9 #define INCLUDED_ORCUS_SPREADSHEET_VIEW_HPP
10 
11 #include "orcus/env.hpp"
12 #include "orcus/spreadsheet/types.hpp"
13 #include "orcus/spreadsheet/view_types.hpp"
14 
15 #include <memory>
16 
17 namespace orcus { namespace spreadsheet {
18 
19 class sheet_view;
20 class document;
21 
22 class ORCUS_SPM_DLLPUBLIC view
23 {
24  struct impl;
25  std::unique_ptr<impl> mp_impl;
26 public:
27  view(document& doc);
28  ~view();
29 
30  sheet_view* get_or_create_sheet_view(sheet_t sheet);
31  const sheet_view* get_sheet_view(sheet_t sheet) const;
32 
33  void set_active_sheet(sheet_t sheet);
34  sheet_t get_active_sheet() const;
35 };
36 
37 class ORCUS_SPM_DLLPUBLIC sheet_view
38 {
39  struct impl;
40  std::unique_ptr<impl> mp_impl;
41 public:
42  sheet_view(view& doc_view);
43  ~sheet_view();
44 
45  const range_t& get_selection(sheet_pane_t pos) const;
46 
47  void set_selection(sheet_pane_t pos, const range_t& range);
48 
49  void set_active_pane(sheet_pane_t pos);
50  sheet_pane_t get_active_pane() const;
51 
52  void set_split_pane(double hor_split, double ver_split, const address_t& top_left_cell);
53  const split_pane_t& get_split_pane() const;
54 
55  void set_frozen_pane(col_t visible_cols, row_t visible_rows, const address_t& top_left_cell);
56  const frozen_pane_t& get_frozen_pane() const;
57 
58  view& get_document_view();
59 };
60 
61 }}
62 
63 #endif
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: view_types.hpp:66
Definition: document.hpp:47
Definition: view.hpp:37
Definition: sheet.hpp:34
Definition: view_types.hpp:41
Definition: types.hpp:358
Definition: types.hpp:346
Definition: view.hpp:22