LibreOffice Module sc (master)
1
sc
source
ui
inc
pfuncache.hxx
Go to the documentation of this file.
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 <vector>
23
#include <
tools/gen.hxx
>
24
#include <
rangelst.hxx
>
25
#include <printopt.hxx>
26
27
class
ScDocShell
;
28
class
ScMarkData
;
29
class
OutputDevice
;
30
33
enum class
ScPrintSelectionMode
34
{
35
Invalid
,
36
Document
,
37
Cursor
,
38
Range
,
39
RangeExclusivelyOleAndDrawObjects
40
};
41
45
class
ScPrintSelectionStatus
46
{
47
ScPrintSelectionMode
eMode
;
48
ScRangeList
aRanges
;
49
ScPrintOptions
aOptions
;
50
51
public
:
52
ScPrintSelectionStatus
() :
eMode
(
ScPrintSelectionMode
::
Invalid
) {}
53
54
void
SetMode
(
ScPrintSelectionMode
eNew) {
eMode
= eNew; }
55
void
SetRanges
(
const
ScRangeList
& rNew) {
aRanges
= rNew; }
56
void
SetOptions
(
const
ScPrintOptions
& rNew) {
aOptions
= rNew; }
57
58
bool
operator==
(
const
ScPrintSelectionStatus
& rOther)
const
59
{
return
eMode
== rOther.
eMode
&&
aRanges
== rOther.
aRanges
&&
aOptions
== rOther.
aOptions
; }
60
61
ScPrintSelectionMode
GetMode
()
const
{
return
eMode
; }
62
const
ScPrintOptions
&
GetOptions
()
const
{
return
aOptions
; }
63
};
64
68
struct
ScPrintPageLocation
69
{
70
tools::Long
nPage
;
71
ScRange
aCellRange
;
72
tools::Rectangle
aRectangle
;
// pixels
73
74
ScPrintPageLocation
() :
75
nPage
(-1) {}
// default: invalid
76
77
ScPrintPageLocation
(
tools::Long
nP,
const
ScRange
& rRange,
const
tools::Rectangle
& rRect ) :
78
nPage
(nP),
aCellRange
(rRange),
aRectangle
(rRect) {}
79
};
80
84
class
ScPrintFuncCache
85
{
86
ScPrintSelectionStatus
aSelection
;
87
ScDocShell
*
pDocSh
;
88
tools::Long
nTotalPages
;
89
std::vector<tools::Long>
nPages
;
90
std::vector<tools::Long>
nFirstAttr
;
91
std::vector<ScPrintPageLocation>
aLocations
;
92
bool
bLocInitialized
;
93
94
public
:
95
ScPrintFuncCache
(
ScDocShell
* pD,
const
ScMarkData
& rMark,
96
ScPrintSelectionStatus
aStatus );
97
~ScPrintFuncCache
();
98
99
bool
IsSameSelection
(
const
ScPrintSelectionStatus
& rStatus )
const
;
100
101
void
InitLocations
(
const
ScMarkData
& rMark,
OutputDevice
* pDev );
102
bool
FindLocation
(
const
ScAddress
& rCell,
ScPrintPageLocation
& rLocation )
const
;
103
104
tools::Long
GetPageCount
()
const
{
return
nTotalPages
; }
105
tools::Long
GetFirstAttr
(
SCTAB
nTab )
const
{
return
nFirstAttr
[nTab]; }
106
SCTAB
GetTabForPage
(
tools::Long
nPage )
const
;
107
tools::Long
GetTabStart
(
SCTAB
nTab )
const
;
108
tools::Long
GetDisplayStart
(
SCTAB
nTab )
const
;
109
};
110
111
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Range
ScAddress
Definition:
address.hxx:207
ScDocShell
Definition:
docsh.hxx:81
ScMarkData
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition:
markdata.hxx:43
ScPrintFuncCache
Stores the data for printing that is needed from several sheets, so it doesn't have to be calculated ...
Definition:
pfuncache.hxx:85
ScPrintFuncCache::aLocations
std::vector< ScPrintPageLocation > aLocations
Definition:
pfuncache.hxx:91
ScPrintFuncCache::nTotalPages
tools::Long nTotalPages
Definition:
pfuncache.hxx:88
ScPrintFuncCache::GetTabStart
tools::Long GetTabStart(SCTAB nTab) const
Definition:
pfuncache.cxx:161
ScPrintFuncCache::nFirstAttr
std::vector< tools::Long > nFirstAttr
Definition:
pfuncache.hxx:90
ScPrintFuncCache::nPages
std::vector< tools::Long > nPages
Definition:
pfuncache.hxx:89
ScPrintFuncCache::GetDisplayStart
tools::Long GetDisplayStart(SCTAB nTab) const
Definition:
pfuncache.cxx:170
ScPrintFuncCache::ScPrintFuncCache
ScPrintFuncCache(ScDocShell *pD, const ScMarkData &rMark, ScPrintSelectionStatus aStatus)
Definition:
pfuncache.cxx:30
ScPrintFuncCache::bLocInitialized
bool bLocInitialized
Definition:
pfuncache.hxx:92
ScPrintFuncCache::aSelection
ScPrintSelectionStatus aSelection
Definition:
pfuncache.hxx:86
ScPrintFuncCache::FindLocation
bool FindLocation(const ScAddress &rCell, ScPrintPageLocation &rLocation) const
Definition:
pfuncache.cxx:132
ScPrintFuncCache::GetTabForPage
SCTAB GetTabForPage(tools::Long nPage) const
Definition:
pfuncache.cxx:149
ScPrintFuncCache::InitLocations
void InitLocations(const ScMarkData &rMark, OutputDevice *pDev)
Definition:
pfuncache.cxx:81
ScPrintFuncCache::GetPageCount
tools::Long GetPageCount() const
Definition:
pfuncache.hxx:104
ScPrintFuncCache::IsSameSelection
bool IsSameSelection(const ScPrintSelectionStatus &rStatus) const
Definition:
pfuncache.cxx:144
ScPrintFuncCache::pDocSh
ScDocShell * pDocSh
Definition:
pfuncache.hxx:87
ScPrintFuncCache::~ScPrintFuncCache
~ScPrintFuncCache()
Definition:
pfuncache.cxx:77
ScPrintFuncCache::GetFirstAttr
tools::Long GetFirstAttr(SCTAB nTab) const
Definition:
pfuncache.hxx:105
ScPrintOptions
Definition:
printopt.hxx:27
ScPrintSelectionStatus
Stores the selection in the ScPrintFuncCache so it is only used for the same selection again.
Definition:
pfuncache.hxx:46
ScPrintSelectionStatus::aRanges
ScRangeList aRanges
Definition:
pfuncache.hxx:48
ScPrintSelectionStatus::eMode
ScPrintSelectionMode eMode
Definition:
pfuncache.hxx:47
ScPrintSelectionStatus::SetOptions
void SetOptions(const ScPrintOptions &rNew)
Definition:
pfuncache.hxx:56
ScPrintSelectionStatus::GetMode
ScPrintSelectionMode GetMode() const
Definition:
pfuncache.hxx:61
ScPrintSelectionStatus::SetRanges
void SetRanges(const ScRangeList &rNew)
Definition:
pfuncache.hxx:55
ScPrintSelectionStatus::ScPrintSelectionStatus
ScPrintSelectionStatus()
Definition:
pfuncache.hxx:52
ScPrintSelectionStatus::GetOptions
const ScPrintOptions & GetOptions() const
Definition:
pfuncache.hxx:62
ScPrintSelectionStatus::aOptions
ScPrintOptions aOptions
Definition:
pfuncache.hxx:49
ScPrintSelectionStatus::operator==
bool operator==(const ScPrintSelectionStatus &rOther) const
Definition:
pfuncache.hxx:58
ScPrintSelectionStatus::SetMode
void SetMode(ScPrintSelectionMode eNew)
Definition:
pfuncache.hxx:54
ScRangeList
Definition:
rangelst.hxx:32
ScRange
Definition:
address.hxx:495
tools::Rectangle
gen.hxx
DataAccessDescriptorProperty::Cursor
@ Cursor
tools::Long
long Long
ScPrintSelectionMode
ScPrintSelectionMode
Possible types of selection for print functions.
Definition:
pfuncache.hxx:34
ScPrintSelectionMode::RangeExclusivelyOleAndDrawObjects
@ RangeExclusivelyOleAndDrawObjects
rangelst.hxx
OutputDevice
ScPrintPageLocation
The range that is printed on a page (excluding repeated columns/rows), and its position on the page,...
Definition:
pfuncache.hxx:69
ScPrintPageLocation::aRectangle
tools::Rectangle aRectangle
Definition:
pfuncache.hxx:72
ScPrintPageLocation::ScPrintPageLocation
ScPrintPageLocation()
Definition:
pfuncache.hxx:74
ScPrintPageLocation::nPage
tools::Long nPage
Definition:
pfuncache.hxx:70
ScPrintPageLocation::ScPrintPageLocation
ScPrintPageLocation(tools::Long nP, const ScRange &rRange, const tools::Rectangle &rRect)
Definition:
pfuncache.hxx:77
ScPrintPageLocation::aCellRange
ScRange aCellRange
Definition:
pfuncache.hxx:71
TransferBufferType::Document
@ Document
SCTAB
sal_Int16 SCTAB
Definition:
types.hxx:22
SwServiceType::Invalid
@ Invalid
Generated on Sun Jul 30 2023 04:29:21 for LibreOffice Module sc (master) by
1.9.3