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 : : #ifndef SC_SCEXTOPT_HXX
29 : : #define SC_SCEXTOPT_HXX
30 : :
31 : : #include <memory>
32 : : #include <tools/gen.hxx>
33 : : #include <tools/color.hxx>
34 : : #include "global.hxx"
35 : : #include "rangelst.hxx"
36 : :
37 : : /** Extended settings for the document, used in import/export filters. */
38 : 262 : struct ScExtDocSettings
39 : : {
40 : : String maGlobCodeName; /// Global codename (VBA module name).
41 : : double mfTabBarWidth; /// Width of the tabbar, relative to frame window width (0.0 ... 1.0).
42 : : sal_uInt32 mnLinkCnt; /// Recursive counter for loading external documents.
43 : : SCTAB mnDisplTab; /// Index of displayed sheet.
44 : :
45 : : explicit ScExtDocSettings();
46 : : };
47 : :
48 : : /** Enumerates possible positions of panes in split sheets. */
49 : : enum ScExtPanePos
50 : : {
51 : : SCEXT_PANE_TOPLEFT, /// Single, top, left, or top-left pane.
52 : : SCEXT_PANE_TOPRIGHT, /// Right, or top-right pane.
53 : : SCEXT_PANE_BOTTOMLEFT, /// Bottom, or bottom-left pane.
54 : : SCEXT_PANE_BOTTOMRIGHT /// Bottom-right pane.
55 : : };
56 : :
57 : : /** Extended settings for a sheet, used in import/export filters. */
58 : 801 : struct ScExtTabSettings
59 : : {
60 : : ScRange maUsedArea; /// Used area in the sheet (columns/rows only).
61 : : ScRangeList maSelection; /// Selected cell ranges (columns/rows only).
62 : : ScAddress maCursor; /// The cursor position (column/row only).
63 : : ScAddress maFirstVis; /// Top-left visible cell (column/row only).
64 : : ScAddress maSecondVis; /// Top-left visible cell in add. panes (column/row only).
65 : : ScAddress maFreezePos; /// Position of frozen panes (column/row only).
66 : : Point maSplitPos; /// Position of split.
67 : : ScExtPanePos meActivePane; /// Active (focused) pane.
68 : : Color maGridColor; /// Grid color.
69 : : long mnNormalZoom; /// Zoom in percent for normal view.
70 : : long mnPageZoom; /// Zoom in percent for pagebreak preview.
71 : : bool mbSelected; /// true = Sheet is selected.
72 : : bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits.
73 : : bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode.
74 : : bool mbShowGrid; /// Whether or not to display gridlines.
75 : :
76 : : explicit ScExtTabSettings();
77 : : };
78 : :
79 : : struct ScExtDocOptionsImpl;
80 : :
81 : : /** Extended options held by an ScDocument containing additional settings for filters.
82 : :
83 : : This object is owned by a Calc document. It contains global document settings
84 : : (struct ScExtDocSettings), settings for all sheets in the document
85 : : (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
86 : : */
87 : : class SC_DLLPUBLIC ScExtDocOptions
88 : : {
89 : : public:
90 : : explicit ScExtDocOptions();
91 : : ScExtDocOptions( const ScExtDocOptions& rSrc );
92 : : ~ScExtDocOptions();
93 : :
94 : : ScExtDocOptions& operator=( const ScExtDocOptions& rSrc );
95 : :
96 : : /** Returns true, if the data needs to be copied to the view data after import. */
97 : : bool IsChanged() const;
98 : : /** If set to true, the data will be copied to the view data after import. */
99 : : void SetChanged( bool bChanged );
100 : :
101 : : /** Returns read access to the global document settings. */
102 : : const ScExtDocSettings& GetDocSettings() const;
103 : : /** Returns read/write access to the global document settings. */
104 : : ScExtDocSettings& GetDocSettings();
105 : :
106 : : /** Returns read access to the settings of a sheet, if extant; otherwise 0. */
107 : : const ScExtTabSettings* GetTabSettings( SCTAB nTab ) const;
108 : : /** Returns read/write access to the settings of a sheet, may create a new struct. */
109 : : ScExtTabSettings& GetOrCreateTabSettings( SCTAB nTab );
110 : :
111 : : /** Returns the number of sheet codenames. */
112 : : SCTAB GetCodeNameCount() const;
113 : : /** Returns the specified codename (empty string = no codename). */
114 : : const String& GetCodeName( SCTAB nTab ) const;
115 : : /** Appends a codename for a sheet. */
116 : : void SetCodeName( SCTAB nTab, const String& rCodeName );
117 : :
118 : : private:
119 : : ::std::auto_ptr< ScExtDocOptionsImpl > mxImpl;
120 : : };
121 : :
122 : : #endif
123 : :
124 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|