LibreOffice Module sc (master) 1
scenariobuffer.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 <oox/helper/refmap.hxx>
24#include "workbookhelper.hxx"
25
26namespace oox { class AttributeList; }
27namespace oox { class SequenceInputStream; }
28
29namespace oox::xls {
30
32{
34 OUString maValue;
35 sal_Int32 mnNumFmtId;
37
38 explicit ScenarioCellModel();
39};
40
42{
43 OUString maName;
44 OUString maComment;
45 OUString maUser;
46 bool mbLocked;
47 bool mbHidden;
49
50 explicit ScenarioModel();
51};
52
54{
55public:
56 explicit Scenario( const WorkbookHelper& rHelper, sal_Int16 nSheet, bool bIsActive );
57
59 void importScenario( const AttributeList& rAttribs );
61 void importInputCells( const AttributeList& rAttribs );
62
67
69 void finalizeImport();
70
71private:
72 std::vector< ScenarioCellModel > maCells;
74 sal_Int16 mnSheet;
75};
76
78{
79 sal_Int32 mnCurrent;
80 sal_Int32 mnShown;
81
82 explicit SheetScenariosModel();
83};
84
86{
87public:
88 explicit SheetScenarios( const WorkbookHelper& rHelper, sal_Int16 nSheet );
89
91 void importScenarios( const AttributeList& rAttribs );
94
97
99 void finalizeImport();
100
101private:
105 sal_Int16 mnSheet;
106};
107
109{
110public:
111 explicit ScenarioBuffer( const WorkbookHelper& rHelper );
112
114 SheetScenarios& createSheetScenarios( sal_Int16 nSheet );
115
117 void finalizeImport();
118
119private:
122};
123
124} // namespace oox::xls
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScenarioBuffer(const WorkbookHelper &rHelper)
RefMap< sal_Int16, SheetScenarios, ::std::greater< sal_Int16 > > SheetScenariosMap
SheetScenarios & createSheetScenarios(sal_Int16 nSheet)
Creates and returns a scenario collection for the passed sheet.
SheetScenariosMap maSheetScenarios
void finalizeImport()
Creates all scenarios in the Calc document.
void finalizeImport()
Creates the scenario in the Calc document.
std::vector< ScenarioCellModel > maCells
ScenarioModel maModel
Scenario cells.
Scenario(const WorkbookHelper &rHelper, sal_Int16 nSheet, bool bIsActive)
void importInputCells(const AttributeList &rAttribs)
Imports a new cell for this scenario from an inputCells element.
sal_Int16 mnSheet
Scenario model data.
void importScenario(const AttributeList &rAttribs)
Imports a scenario definition from a scenario element.
SheetScenariosModel maModel
SheetScenarios(const WorkbookHelper &rHelper, sal_Int16 nSheet)
void finalizeImport()
Creates all scenarios in the Calc sheet.
RefVector< Scenario > ScenarioVector
Scenario & createScenario()
Creates and returns a new scenario in this collection.
void importScenarios(const AttributeList &rAttribs)
Imports sheet scenario settings from a scenarios element.
Helper class to provide access to global workbook data.
void SvStream & rStrm
OUString maComment
Name of the scenario.
bool mbActive
True = scenario is hidden.
bool mbHidden
True = input cell values locked.
OUString maUser
Comment.
bool mbLocked
Name of user created the scenario.
SheetScenariosModel()
Visible scenario.
sal_Int32 mnShown
Selected scenario.