Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef OOX_XLS_WORKSHEETSETTINGS_HXX
30 : : #define OOX_XLS_WORKSHEETSETTINGS_HXX
31 : :
32 : : #include "richstring.hxx"
33 : : #include "worksheethelper.hxx"
34 : :
35 : : namespace oox {
36 : : namespace xls {
37 : :
38 : : // ============================================================================
39 : :
40 : : /** Sheet and outline settings. */
41 [ + - ]: 60 : struct SheetSettingsModel
42 : : {
43 : : ::rtl::OUString maCodeName; /// VBA module codename.
44 : : Color maTabColor; /// Sheet tab color.
45 : : bool mbFilterMode; /// True = sheet contains active filter.
46 : : bool mbApplyStyles; /// True = automatic styles when creating outlines.
47 : : bool mbSummaryBelow; /// True = row outline symbols below group.
48 : : bool mbSummaryRight; /// True = column outline symbols right of group.
49 : :
50 : : explicit SheetSettingsModel();
51 : : };
52 : :
53 : : // ============================================================================
54 : :
55 : : /** Sheet protection settings. */
56 : : struct SheetProtectionModel
57 : : {
58 : : sal_uInt16 mnPasswordHash; /// Hash value from sheet protection password.
59 : : bool mbSheet; /// True = sheet protection enabled, locked cells are protcted.
60 : : bool mbObjects; /// True = objects locked.
61 : : bool mbScenarios; /// True = scenarios locked.
62 : : bool mbFormatCells; /// True = format cells locked.
63 : : bool mbFormatColumns; /// True = format columns locked.
64 : : bool mbFormatRows; /// True = format rows locked.
65 : : bool mbInsertColumns; /// True = insert columns locked.
66 : : bool mbInsertRows; /// True = insert rows locked.
67 : : bool mbInsertHyperlinks; /// True = insert hyperlinks locked.
68 : : bool mbDeleteColumns; /// True = delete columns locked.
69 : : bool mbDeleteRows; /// True = delete rows locked.
70 : : bool mbSelectLocked; /// True = select locked cells locked.
71 : : bool mbSort; /// True = sorting locked.
72 : : bool mbAutoFilter; /// True = autofilters locked.
73 : : bool mbPivotTables; /// True = pivot tables locked.
74 : : bool mbSelectUnlocked; /// True = select unlocked cells locked.
75 : :
76 : : explicit SheetProtectionModel();
77 : : };
78 : :
79 : : // ============================================================================
80 : :
81 [ + - ][ + - ]: 60 : class WorksheetSettings : public WorksheetHelper
[ - + ]
82 : : {
83 : : public:
84 : : explicit WorksheetSettings( const WorksheetHelper& rHelper );
85 : :
86 : : /** Imports sheet settings from the sheetPr element. */
87 : : void importSheetPr( const AttributeList& rAttribs );
88 : : /** Imports chart sheet settings from the sheetPr element. */
89 : : void importChartSheetPr( const AttributeList& rAttribs );
90 : : /** Imports the sheet tab color from the tabColor element. */
91 : : void importTabColor( const AttributeList& rAttribs );
92 : : /** Imports outline settings from the outlinePr element. */
93 : : void importOutlinePr( const AttributeList& rAttribs );
94 : : /** Imports protection settings from the sheetProtection element. */
95 : : void importSheetProtection( const AttributeList& rAttribs );
96 : : /** Imports protection settings from the sheetProtection element of a chart sheet. */
97 : : void importChartProtection( const AttributeList& rAttribs );
98 : : /** Imports phonetic settings from the phoneticPr element. */
99 : : void importPhoneticPr( const AttributeList& rAttribs );
100 : :
101 : : /** Imports sheet properties from the SHEETPR record. */
102 : : void importSheetPr( SequenceInputStream& rStrm );
103 : : /** Imports sheet properties from the CHARTSHEETPR record. */
104 : : void importChartSheetPr( SequenceInputStream& rStrm );
105 : : /** Imports sheet protection settings from the SHEETPROTECTION record. */
106 : : void importSheetProtection( SequenceInputStream& rStrm );
107 : : /** Imports chart sheet protection settings from the CHARTPROTECTION record. */
108 : : void importChartProtection( SequenceInputStream& rStrm );
109 : : /** Imports phonetic settings from the PHONETICPR record. */
110 : : void importPhoneticPr( SequenceInputStream& rStrm );
111 : :
112 : : /** Converts the imported worksheet settings. */
113 : : void finalizeImport();
114 : :
115 : : private:
116 : : PhoneticSettings maPhoneticSett;
117 : : SheetSettingsModel maSheetSettings;
118 : : SheetProtectionModel maSheetProt;
119 : : };
120 : :
121 : : // ============================================================================
122 : :
123 : : } // namespace xls
124 : : } // namespace oox
125 : :
126 : : #endif
127 : :
128 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|