Bump version to 4.3-4
[LibreOffice.git] / sc / inc / sheetdata.hxx
blob0e6e240681f3a7cf982acd58760a1caee0cd6128
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_SHEETDATA_HXX
21 #define INCLUDED_SC_INC_SHEETDATA_HXX
23 #include <xmloff/maptype.hxx>
24 #include <editeng/editdata.hxx>
25 #include <vector>
26 #include <boost/unordered_set.hpp>
28 #include "address.hxx"
30 class ScAddress;
31 class SvXMLNamespaceMap;
34 struct ScStreamEntry
36 sal_Int32 mnStartOffset;
37 sal_Int32 mnEndOffset;
39 ScStreamEntry() :
40 mnStartOffset(-1),
41 mnEndOffset(-1)
45 ScStreamEntry( sal_Int32 nStart, sal_Int32 nEnd ) :
46 mnStartOffset(nStart),
47 mnEndOffset(nEnd)
52 struct ScCellStyleEntry
54 OUString maName;
55 ScAddress maCellPos;
57 ScCellStyleEntry( const OUString& rName, const ScAddress& rPos ) :
58 maName(rName),
59 maCellPos(rPos)
64 struct ScNoteStyleEntry
66 OUString maStyleName;
67 OUString maTextStyle;
68 ScAddress maCellPos;
70 ScNoteStyleEntry( const OUString& rStyle, const OUString& rText, const ScAddress& rPos ) :
71 maStyleName(rStyle),
72 maTextStyle(rText),
73 maCellPos(rPos)
78 struct ScTextStyleEntry
80 OUString maName;
81 ScAddress maCellPos;
82 ESelection maSelection;
84 ScTextStyleEntry( const OUString& rName, const ScAddress& rPos, const ESelection& rSel ) :
85 maName(rName),
86 maCellPos(rPos),
87 maSelection(rSel)
92 struct ScLoadedNamespaceEntry
94 OUString maPrefix;
95 OUString maName;
96 sal_uInt16 mnKey;
98 ScLoadedNamespaceEntry( const OUString& rPrefix, const OUString& rName, sal_uInt16 nKey ) :
99 maPrefix(rPrefix),
100 maName(rName),
101 mnKey(nKey)
106 class ScSheetSaveData
108 boost::unordered_set<OUString, OUStringHash> maInitialPrefixes;
109 std::vector<ScLoadedNamespaceEntry> maLoadedNamespaces;
111 std::vector<ScCellStyleEntry> maCellStyles;
112 std::vector<ScCellStyleEntry> maColumnStyles;
113 std::vector<ScCellStyleEntry> maRowStyles;
114 std::vector<ScCellStyleEntry> maTableStyles;
115 std::vector<ScNoteStyleEntry> maNoteStyles;
116 std::vector<ScTextStyleEntry> maNoteParaStyles;
117 std::vector<ScTextStyleEntry> maNoteTextStyles;
118 std::vector<ScTextStyleEntry> maTextStyles;
119 std::vector<bool> maBlocked;
120 std::vector<ScStreamEntry> maStreamEntries;
121 std::vector<ScStreamEntry> maSaveEntries;
122 SCTAB mnStartTab;
123 sal_Int32 mnStartOffset;
125 ScNoteStyleEntry maPreviousNote;
127 bool mbInSupportedSave;
129 public:
130 ScSheetSaveData();
131 ~ScSheetSaveData();
133 void AddCellStyle( const OUString& rName, const ScAddress& rCellPos );
134 void AddColumnStyle( const OUString& rName, const ScAddress& rCellPos );
135 void AddRowStyle( const OUString& rName, const ScAddress& rCellPos );
136 void AddTableStyle( const OUString& rName, const ScAddress& rCellPos );
138 void HandleNoteStyles( const OUString& rStyleName, const OUString& rTextName, const ScAddress& rCellPos );
139 void AddNoteContentStyle( sal_uInt16 nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
141 void AddTextStyle( const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
143 void BlockSheet( SCTAB nTab );
144 bool IsSheetBlocked( SCTAB nTab ) const;
146 void AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
147 void GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const;
148 bool HasStreamPos( SCTAB nTab ) const;
150 void StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset );
151 void EndStreamPos( sal_Int32 nEndOffset );
153 bool HasStartPos() const { return mnStartTab >= 0; }
155 void ResetSaveEntries();
156 void AddSavePos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
157 void UseSaveEntries();
159 void StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces );
160 void StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespaces );
161 bool AddLoadedNamespaces( SvXMLNamespaceMap& rNamespaces ) const;
163 const std::vector<ScCellStyleEntry>& GetCellStyles() const { return maCellStyles; }
164 const std::vector<ScCellStyleEntry>& GetColumnStyles() const { return maColumnStyles; }
165 const std::vector<ScCellStyleEntry>& GetRowStyles() const { return maRowStyles; }
166 const std::vector<ScCellStyleEntry>& GetTableStyles() const { return maTableStyles; }
167 const std::vector<ScNoteStyleEntry>& GetNoteStyles() const { return maNoteStyles; }
168 const std::vector<ScTextStyleEntry>& GetNoteParaStyles() const { return maNoteParaStyles; }
169 const std::vector<ScTextStyleEntry>& GetNoteTextStyles() const { return maNoteTextStyles; }
170 const std::vector<ScTextStyleEntry>& GetTextStyles() const { return maTextStyles; }
172 bool IsInSupportedSave() const;
173 void SetInSupportedSave( bool bSet );
176 #endif
178 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */