LibreOffice Module sc (master) 1
viewopti.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 <svx/optgrid.hxx>
23
24#include "scdllapi.h"
25#include "optutil.hxx"
26#include "global.hxx"
27
28// View options
29
31{
49};
50
52{
56};
57
58#define MAX_OPT sal_uInt16(VOPT_THEMEDCURSOR)+1
59#define MAX_TYPE sal_uInt16(VOBJ_TYPE_DRAW)+1
60
61// SvxGrid options with standard operators
62
64{
65public:
67 ScGridOptions( const SvxOptionsGrid& rOpt ) : SvxOptionsGrid( rOpt ) {}
68
69 void SetDefaults();
70 bool operator== ( const ScGridOptions& rOpt ) const;
71 bool operator!= ( const ScGridOptions& rOpt ) const { return !(operator==(rOpt)); }
72};
73
74// Options - View
75
77{
78public:
80 ScViewOptions( const ScViewOptions& rCpy );
82
83 void SetDefaults();
84
85 void SetOption( ScViewOption eOpt, bool bNew ) { aOptArr[eOpt] = bNew; }
86 bool GetOption( ScViewOption eOpt ) const { return aOptArr[eOpt]; }
87
88 void SetObjMode( ScVObjType eObj, ScVObjMode eMode ) { aModeArr[eObj] = eMode; }
89 ScVObjMode GetObjMode( ScVObjType eObj ) const { return aModeArr[eObj]; }
90
91 void SetGridColor( const Color& rCol, const OUString& rName ) { aGridCol = rCol; aGridColName = rName;}
92 Color const & GetGridColor( OUString* pStrName = nullptr ) const;
93
94 const ScGridOptions& GetGridOptions() const { return aGridOpt; }
95 void SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; }
96 std::unique_ptr<SvxGridItem> CreateGridItem() const;
97
98 const OUString& GetColorSchemeName() const { return sColorSchemeName; }
99 void SetColorSchemeName( const OUString& rName ) { sColorSchemeName = rName; }
100
101 const Color& GetDocColor() const { return aDocCol; }
102 void SetDocColor(const Color& rDocColor) { aDocCol = rDocColor; }
103
104 ScViewOptions& operator= ( const ScViewOptions& rCpy );
105 bool operator== ( const ScViewOptions& rOpt ) const;
106 bool operator!= ( const ScViewOptions& rOpt ) const { return !(operator==(rOpt)); }
107
108private:
109 bool aOptArr [MAX_OPT];
112 OUString aGridColName;
114 // The name of the color scheme
115 OUString sColorSchemeName = "Default";
116 // The background color of the document
118};
119
120// Item for the options dialog - View
121
123{
124public:
125 ScTpViewItem( const ScViewOptions& rOpt );
126 virtual ~ScTpViewItem() override;
127
128 ScTpViewItem(ScTpViewItem const &) = default;
130 ScTpViewItem & operator =(ScTpViewItem const &) = delete; // due to SfxPoolItem
131 ScTpViewItem & operator =(ScTpViewItem &&) = delete; // due to SfxPoolItem
132
133 virtual bool operator==( const SfxPoolItem& ) const override;
134 virtual ScTpViewItem* Clone( SfxItemPool *pPool = nullptr ) const override;
135
136 const ScViewOptions& GetViewOptions() const { return theOptions; }
137
138private:
140};
141
142// CfgItem for View options
143
145{
149
150 DECL_LINK( LayoutCommitHdl, ScLinkConfigItem&, void );
151 DECL_LINK( DisplayCommitHdl, ScLinkConfigItem&, void );
152 DECL_LINK( GridCommitHdl, ScLinkConfigItem&, void );
153
154 static css::uno::Sequence<OUString> GetLayoutPropertyNames();
155 static css::uno::Sequence<OUString> GetDisplayPropertyNames();
156 static css::uno::Sequence<OUString> GetGridPropertyNames();
157
158public:
159 ScViewCfg();
160
161 void SetOptions( const ScViewOptions& rNew );
162};
163
164/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScGridOptions(const SvxOptionsGrid &rOpt)
Definition: viewopti.hxx:67
bool operator==(const ScGridOptions &rOpt) const
Definition: viewopti.cxx:63
void SetDefaults()
Definition: viewopti.cxx:38
bool operator!=(const ScGridOptions &rOpt) const
Definition: viewopti.hxx:71
ScTpViewItem(ScTpViewItem &&)=default
ScViewOptions theOptions
Definition: viewopti.hxx:139
ScTpViewItem(ScTpViewItem const &)=default
const ScViewOptions & GetViewOptions() const
Definition: viewopti.hxx:136
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
Definition: viewopti.cxx:235
ScLinkConfigItem aDisplayItem
Definition: viewopti.hxx:147
static css::uno::Sequence< OUString > GetDisplayPropertyNames()
Definition: viewopti.cxx:251
void SetOptions(const ScViewOptions &rNew)
Definition: viewopti.cxx:609
ScLinkConfigItem aLayoutItem
Definition: viewopti.hxx:146
DECL_LINK(DisplayCommitHdl, ScLinkConfigItem &, void)
static css::uno::Sequence< OUString > GetGridPropertyNames()
Definition: viewopti.cxx:264
ScLinkConfigItem aGridItem
Definition: viewopti.hxx:148
DECL_LINK(LayoutCommitHdl, ScLinkConfigItem &, void)
DECL_LINK(GridCommitHdl, ScLinkConfigItem &, void)
void SetGridColor(const Color &rCol, const OUString &rName)
Definition: viewopti.hxx:91
Color aGridCol
Definition: viewopti.hxx:111
void SetOption(ScViewOption eOpt, bool bNew)
Definition: viewopti.hxx:85
void SetColorSchemeName(const OUString &rName)
Definition: viewopti.hxx:99
void SetObjMode(ScVObjType eObj, ScVObjMode eMode)
Definition: viewopti.hxx:88
const ScGridOptions & GetGridOptions() const
Definition: viewopti.hxx:94
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:86
ScGridOptions aGridOpt
Definition: viewopti.hxx:113
const Color & GetDocColor() const
Definition: viewopti.hxx:101
const OUString & GetColorSchemeName() const
Definition: viewopti.hxx:98
ScVObjMode GetObjMode(ScVObjType eObj) const
Definition: viewopti.hxx:89
void SetDocColor(const Color &rDocColor)
Definition: viewopti.hxx:102
OUString aGridColName
Definition: viewopti.hxx:112
void SetGridOptions(const ScGridOptions &rNew)
Definition: viewopti.hxx:95
ScVObjMode
Definition: global.hxx:368
Mode eMode
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
#define MAX_OPT
Definition: viewopti.hxx:58
#define MAX_TYPE
Definition: viewopti.hxx:59
ScVObjType
Definition: viewopti.hxx:52
@ VOBJ_TYPE_CHART
Definition: viewopti.hxx:54
@ VOBJ_TYPE_OLE
Definition: viewopti.hxx:53
@ VOBJ_TYPE_DRAW
Definition: viewopti.hxx:55
ScViewOption
Definition: viewopti.hxx:31
@ VOPT_SUMMARY
Definition: viewopti.hxx:47
@ VOPT_TABCONTROLS
Definition: viewopti.hxx:39
@ VOPT_ANCHOR
Definition: viewopti.hxx:45
@ VOPT_NULLVALS
Definition: viewopti.hxx:33
@ VOPT_HSCROLL
Definition: viewopti.hxx:38
@ VOPT_OUTLINER
Definition: viewopti.hxx:40
@ VOPT_HELPLINES
Definition: viewopti.hxx:44
@ VOPT_GRID_ONTOP
Definition: viewopti.hxx:43
@ VOPT_FORMULAS_MARKS
Definition: viewopti.hxx:36
@ VOPT_GRID
Definition: viewopti.hxx:42
@ VOPT_FORMULAS
Definition: viewopti.hxx:32
@ VOPT_NOTES
Definition: viewopti.hxx:35
@ VOPT_THEMEDCURSOR
Definition: viewopti.hxx:48
@ VOPT_HEADER
Definition: viewopti.hxx:41
@ VOPT_PAGEBREAKS
Definition: viewopti.hxx:46
@ VOPT_SYNTAX
Definition: viewopti.hxx:34
@ VOPT_VSCROLL
Definition: viewopti.hxx:37
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
Definition: xestring.hxx:248
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:518