/src/libreoffice/sc/inc/prnsave.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include "address.hxx" |
23 | | #include <optional> |
24 | | #include <memory> |
25 | | #include <vector> |
26 | | |
27 | | namespace tools { class JsonWriter; } |
28 | | |
29 | | class ScPrintSaverTab |
30 | | { |
31 | | typedef ::std::vector< ScRange > ScRangeVec; |
32 | | |
33 | | ScRangeVec maPrintRanges; ///< Array |
34 | | std::optional<ScRange> moRepeatCol; ///< single |
35 | | std::optional<ScRange> moRepeatRow; ///< single |
36 | | bool mbEntireSheet; |
37 | | |
38 | | public: |
39 | | ScPrintSaverTab(); |
40 | | ~ScPrintSaverTab(); |
41 | | |
42 | | void SetAreas( ScRangeVec&& rRanges, bool bEntireSheet ); |
43 | | void SetRepeat( std::optional<ScRange> oCol, std::optional<ScRange> oRow ); |
44 | | |
45 | 0 | const ScRangeVec& GetPrintRanges() const { return maPrintRanges; } |
46 | 0 | bool IsEntireSheet() const { return mbEntireSheet; } |
47 | 0 | const std::optional<ScRange>& GetRepeatCol() const { return moRepeatCol; } |
48 | 0 | const std::optional<ScRange>& GetRepeatRow() const { return moRepeatRow; } |
49 | | |
50 | | bool operator==( const ScPrintSaverTab& rCmp ) const; |
51 | | }; |
52 | | |
53 | | class ScPrintRangeSaver |
54 | | { |
55 | | SCTAB nTabCount; |
56 | | std::unique_ptr<ScPrintSaverTab[]> pData; |
57 | | |
58 | | public: |
59 | | ScPrintRangeSaver( SCTAB nCount ); |
60 | | ~ScPrintRangeSaver(); |
61 | | |
62 | 0 | SCTAB GetTabCount() const { return nTabCount; } |
63 | | ScPrintSaverTab& GetTabData(SCTAB nTab); |
64 | | const ScPrintSaverTab& GetTabData(SCTAB nTab) const; |
65 | | void GetPrintRangesInfo(tools::JsonWriter& rPrintRanges) const; |
66 | | |
67 | | bool operator==( const ScPrintRangeSaver& rCmp ) const; |
68 | | }; |
69 | | |
70 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |