xref: /aoo41x/main/sc/inc/scextopt.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_SCEXTOPT_HXX
24cdf0e10cSrcweir #define SC_SCEXTOPT_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <memory>
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <tools/color.hxx>
29cdf0e10cSrcweir #include "global.hxx"
30cdf0e10cSrcweir #include "rangelst.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // ============================================================================
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /** Extended settings for the document, used in import/export filters. */
35cdf0e10cSrcweir struct ScExtDocSettings
36cdf0e10cSrcweir {
37cdf0e10cSrcweir     String              maGlobCodeName;     /// Global codename (VBA module name).
38cdf0e10cSrcweir     double              mfTabBarWidth;      /// Width of the tabbar, relative to frame window width (0.0 ... 1.0).
39cdf0e10cSrcweir     sal_uInt32          mnLinkCnt;          /// Recursive counter for loading external documents.
40cdf0e10cSrcweir     SCTAB               mnDisplTab;         /// Index of displayed sheet.
41cdf0e10cSrcweir 
42cdf0e10cSrcweir     explicit            ScExtDocSettings();
43cdf0e10cSrcweir };
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // ============================================================================
46cdf0e10cSrcweir 
47cdf0e10cSrcweir /** Enumerates possible positions of panes in split sheets. */
48cdf0e10cSrcweir enum ScExtPanePos
49cdf0e10cSrcweir {
50cdf0e10cSrcweir     SCEXT_PANE_TOPLEFT,         /// Single, top, left, or top-left pane.
51cdf0e10cSrcweir     SCEXT_PANE_TOPRIGHT,        /// Right, or top-right pane.
52cdf0e10cSrcweir     SCEXT_PANE_BOTTOMLEFT,      /// Bottom, or bottom-left pane.
53cdf0e10cSrcweir     SCEXT_PANE_BOTTOMRIGHT      /// Bottom-right pane.
54cdf0e10cSrcweir };
55cdf0e10cSrcweir 
56cdf0e10cSrcweir // ----------------------------------------------------------------------------
57cdf0e10cSrcweir 
58cdf0e10cSrcweir /** Extended settings for a sheet, used in import/export filters. */
59cdf0e10cSrcweir struct ScExtTabSettings
60cdf0e10cSrcweir {
61cdf0e10cSrcweir     ScRange             maUsedArea;         /// Used area in the sheet (columns/rows only).
62cdf0e10cSrcweir     ScRangeList         maSelection;        /// Selected cell ranges (columns/rows only).
63cdf0e10cSrcweir     ScAddress           maCursor;           /// The cursor position (column/row only).
64cdf0e10cSrcweir     ScAddress           maFirstVis;         /// Top-left visible cell (column/row only).
65cdf0e10cSrcweir     ScAddress           maSecondVis;        /// Top-left visible cell in add. panes (column/row only).
66cdf0e10cSrcweir     ScAddress           maFreezePos;        /// Position of frozen panes (column/row only).
67cdf0e10cSrcweir     Point               maSplitPos;         /// Position of split.
68cdf0e10cSrcweir     ScExtPanePos        meActivePane;       /// Active (focused) pane.
69cdf0e10cSrcweir     Color               maGridColor;        /// Grid color.
70cdf0e10cSrcweir     long                mnNormalZoom;       /// Zoom in percent for normal view.
71cdf0e10cSrcweir     long                mnPageZoom;         /// Zoom in percent for pagebreak preview.
72cdf0e10cSrcweir     bool                mbSelected;         /// true = Sheet is selected.
73cdf0e10cSrcweir     bool                mbFrozenPanes;      /// true = Frozen panes; false = Normal splits.
74cdf0e10cSrcweir     bool                mbPageMode;         /// true = Pagebreak mode; false = Normal view mode.
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     explicit            ScExtTabSettings();
77cdf0e10cSrcweir };
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // ============================================================================
80cdf0e10cSrcweir 
81cdf0e10cSrcweir struct ScExtDocOptionsImpl;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir /** Extended options held by an ScDocument containing additional settings for filters.
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     This object is owned by a Calc document. It contains global document settings
86cdf0e10cSrcweir     (struct ScExtDocSettings), settings for all sheets in the document
87cdf0e10cSrcweir     (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
88cdf0e10cSrcweir  */
89cdf0e10cSrcweir class SC_DLLPUBLIC ScExtDocOptions
90cdf0e10cSrcweir {
91cdf0e10cSrcweir public:
92cdf0e10cSrcweir     explicit            ScExtDocOptions();
93cdf0e10cSrcweir                         ScExtDocOptions( const ScExtDocOptions& rSrc );
94cdf0e10cSrcweir                         ~ScExtDocOptions();
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     ScExtDocOptions&    operator=( const ScExtDocOptions& rSrc );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     /** Returns true, if the data needs to be copied to the view data after import. */
99cdf0e10cSrcweir     bool                IsChanged() const;
100cdf0e10cSrcweir     /** If set to true, the data will be copied to the view data after import. */
101cdf0e10cSrcweir     void                SetChanged( bool bChanged );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     /** Returns read access to the global document settings. */
104cdf0e10cSrcweir     const ScExtDocSettings& GetDocSettings() const;
105cdf0e10cSrcweir     /** Returns read/write access to the global document settings. */
106cdf0e10cSrcweir     ScExtDocSettings&   GetDocSettings();
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     /** Returns read access to the settings of a sheet, if extant; otherwise 0. */
109cdf0e10cSrcweir     const ScExtTabSettings* GetTabSettings( SCTAB nTab ) const;
110cdf0e10cSrcweir     /** Returns read/write access to the settings of a sheet, may create a new struct. */
111cdf0e10cSrcweir     ScExtTabSettings&   GetOrCreateTabSettings( SCTAB nTab );
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     /** Returns the number of sheet codenames. */
114cdf0e10cSrcweir     SCTAB               GetCodeNameCount() const;
115cdf0e10cSrcweir     /** Returns the specified codename (empty string = no codename). */
116cdf0e10cSrcweir     const String&       GetCodeName( SCTAB nTab ) const;
117cdf0e10cSrcweir     /** Appends a codename for a sheet. */
118cdf0e10cSrcweir     void                SetCodeName( SCTAB nTab, const String& rCodeName );
119cdf0e10cSrcweir 
120cdf0e10cSrcweir private:
121cdf0e10cSrcweir     ::std::auto_ptr< ScExtDocOptionsImpl > mxImpl;
122cdf0e10cSrcweir };
123cdf0e10cSrcweir 
124cdf0e10cSrcweir // ============================================================================
125cdf0e10cSrcweir 
126cdf0e10cSrcweir #endif
127cdf0e10cSrcweir 
128