LibreOffice Module sc (master) 1
appoptio.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 <sfx2/zoomitem.hxx>
23#include "scdllapi.h"
24#include "global.hxx"
25#include "optutil.hxx"
26#include <tools/fldunit.hxx>
27#include <tools/color.hxx>
28#include <tools/link.hxx>
29
31{
32public:
34 ScAppOptions( const ScAppOptions& rCpy );
36
37 void SetDefaults();
38
39 void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
40 FieldUnit GetAppMetric() const { return eMetric; }
41 void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; }
42 sal_uInt16 GetZoom() const { return nZoom; }
43 void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; }
44 SvxZoomType GetZoomType() const { return eZoomType; }
45 void SetSynchronizeZoom( bool bNew ) { bSynchronizeZoom = bNew; }
46 bool GetSynchronizeZoom() const { return bSynchronizeZoom; }
47 sal_uInt16 GetLRUFuncListCount() const { return nLRUFuncCount; }
48 sal_uInt16* GetLRUFuncList() const { return pLRUList.get(); }
49 void SetLRUFuncList( const sal_uInt16* pList,
50 const sal_uInt16 nCount );
51 void SetStatusFunc( sal_uInt32 nNew ) { nStatusFunc = nNew; }
52 sal_uInt32 GetStatusFunc() const { return nStatusFunc; }
53 void SetAutoComplete( bool bNew ) { bAutoComplete = bNew; }
54 bool GetAutoComplete() const { return bAutoComplete; }
55 void SetDetectiveAuto( bool bNew ) { bDetectiveAuto = bNew; }
56 bool GetDetectiveAuto() const { return bDetectiveAuto; }
57
58 void SetTrackContentColor(Color nNew) { nTrackContentColor = nNew; }
59 Color GetTrackContentColor() const { return nTrackContentColor; }
60 void SetTrackInsertColor(Color nNew) { nTrackInsertColor = nNew; }
61 Color GetTrackInsertColor() const { return nTrackInsertColor; }
62 void SetTrackDeleteColor(Color nNew) { nTrackDeleteColor = nNew; }
63 Color GetTrackDeleteColor() const { return nTrackDeleteColor; }
64 void SetTrackMoveColor(Color nNew) { nTrackMoveColor = nNew; }
65 Color GetTrackMoveColor() const { return nTrackMoveColor; }
66
67 ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
68 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
69
70 void SetDefaultObjectSizeWidth(sal_Int32 nNew) { nDefaultObjectSizeWidth = nNew; }
71 sal_Int32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; }
72 void SetDefaultObjectSizeHeight(sal_Int32 nNew) { nDefaultObjectSizeHeight = nNew; }
73 sal_Int32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; }
74
75 void SetShowSharedDocumentWarning( bool bNew ) { mbShowSharedDocumentWarning = bNew; }
76 bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; }
77 ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; }
78 void SetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { meKeyBindingType = e; }
79
80 ScAppOptions& operator= ( const ScAppOptions& rOpt );
81
82private:
84 sal_uInt16 nLRUFuncCount;
85 std::unique_ptr<sal_uInt16[]>
88 sal_uInt16 nZoom;
90 sal_uInt32 nStatusFunc;
102};
103
104// Config Item containing app options
105
106class ScAppCfg : private ScAppOptions
107{
108 // spread about 5 config paths
110
118
119 void ReadLayoutCfg();
120 void ReadInputCfg();
121 void ReadRevisionCfg();
122 void ReadContentCfg();
123 void ReadSortListCfg();
124 void ReadMiscCfg();
125 void ReadCompatCfg();
126
127 DECL_LINK( LayoutCommitHdl, ScLinkConfigItem&, void );
128 DECL_LINK( InputCommitHdl, ScLinkConfigItem&, void );
129 DECL_LINK( RevisionCommitHdl, ScLinkConfigItem&, void );
130 DECL_LINK( ContentCommitHdl, ScLinkConfigItem&, void );
131 DECL_LINK( SortListCommitHdl, ScLinkConfigItem&, void );
132 DECL_LINK( MiscCommitHdl, ScLinkConfigItem&, void );
133 DECL_LINK( CompatCommitHdl, ScLinkConfigItem&, void );
134
135 DECL_LINK( LayoutNotifyHdl, ScLinkConfigItem&, void );
136 DECL_LINK( InputNotifyHdl, ScLinkConfigItem&, void );
137 DECL_LINK( RevisionNotifyHdl, ScLinkConfigItem&, void );
138 DECL_LINK( ContentNotifyHdl, ScLinkConfigItem&, void );
139 DECL_LINK( SortListNotifyHdl, ScLinkConfigItem&, void );
140 DECL_LINK( MiscNotifyHdl, ScLinkConfigItem&, void );
141 DECL_LINK( CompatNotifyHdl, ScLinkConfigItem&, void );
142
143 static css::uno::Sequence<OUString> GetLayoutPropertyNames();
144 static css::uno::Sequence<OUString> GetInputPropertyNames();
145 static css::uno::Sequence<OUString> GetRevisionPropertyNames();
146 static css::uno::Sequence<OUString> GetContentPropertyNames();
147 static css::uno::Sequence<OUString> GetSortListPropertyNames();
148 static css::uno::Sequence<OUString> GetMiscPropertyNames();
149 static css::uno::Sequence<OUString> GetCompatPropertyNames();
150
151public:
152 ScAppCfg();
153
154 const ScAppOptions& GetOptions() const { return *this; }
155 void SetOptions( const ScAppOptions& rNew );
156};
157
158/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static css::uno::Sequence< OUString > GetInputPropertyNames()
Definition: appoptio.cxx:227
ScLinkConfigItem aCompatItem
Definition: appoptio.hxx:117
DECL_LINK(LayoutNotifyHdl, ScLinkConfigItem &, void)
void ReadCompatCfg()
Definition: appoptio.cxx:448
static css::uno::Sequence< OUString > GetSortListPropertyNames()
Definition: appoptio.cxx:247
ScLinkConfigItem aInputItem
Definition: appoptio.hxx:112
static css::uno::Sequence< OUString > GetMiscPropertyNames()
Definition: appoptio.cxx:252
void SetOptions(const ScAppOptions &rNew)
Definition: appoptio.cxx:636
ScLinkConfigItem aLayoutItem
split ScAppOptions into different classes
Definition: appoptio.hxx:111
DECL_LINK(MiscCommitHdl, ScLinkConfigItem &, void)
ScLinkConfigItem aContentItem
Definition: appoptio.hxx:114
ScLinkConfigItem aMiscItem
Definition: appoptio.hxx:116
ScLinkConfigItem aSortListItem
Definition: appoptio.hxx:115
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
Definition: appoptio.cxx:214
DECL_LINK(RevisionCommitHdl, ScLinkConfigItem &, void)
const ScAppOptions & GetOptions() const
Definition: appoptio.hxx:154
DECL_LINK(RevisionNotifyHdl, ScLinkConfigItem &, void)
void ReadMiscCfg()
Definition: appoptio.cxx:432
static css::uno::Sequence< OUString > GetCompatPropertyNames()
Definition: appoptio.cxx:259
void ReadSortListCfg()
Definition: appoptio.cxx:400
DECL_LINK(CompatNotifyHdl, ScLinkConfigItem &, void)
DECL_LINK(LayoutCommitHdl, ScLinkConfigItem &, void)
void ReadLayoutCfg()
Definition: appoptio.cxx:309
DECL_LINK(MiscNotifyHdl, ScLinkConfigItem &, void)
void ReadInputCfg()
Definition: appoptio.cxx:346
void ReadRevisionCfg()
Definition: appoptio.cxx:370
DECL_LINK(ContentCommitHdl, ScLinkConfigItem &, void)
ScLinkConfigItem aRevisionItem
Definition: appoptio.hxx:113
static css::uno::Sequence< OUString > GetRevisionPropertyNames()
Definition: appoptio.cxx:234
DECL_LINK(CompatCommitHdl, ScLinkConfigItem &, void)
DECL_LINK(ContentNotifyHdl, ScLinkConfigItem &, void)
DECL_LINK(SortListCommitHdl, ScLinkConfigItem &, void)
DECL_LINK(InputNotifyHdl, ScLinkConfigItem &, void)
DECL_LINK(SortListNotifyHdl, ScLinkConfigItem &, void)
DECL_LINK(InputCommitHdl, ScLinkConfigItem &, void)
void ReadContentCfg()
Definition: appoptio.cxx:388
static css::uno::Sequence< OUString > GetContentPropertyNames()
Definition: appoptio.cxx:242
bool bAutoComplete
Definition: appoptio.hxx:91
Color GetTrackMoveColor() const
Definition: appoptio.hxx:65
sal_uInt16 nZoom
Definition: appoptio.hxx:88
void SetStatusFunc(sal_uInt32 nNew)
Definition: appoptio.hxx:51
Color GetTrackInsertColor() const
Definition: appoptio.hxx:61
sal_Int32 nDefaultObjectSizeWidth
Definition: appoptio.hxx:98
void SetTrackInsertColor(Color nNew)
Definition: appoptio.hxx:60
sal_uInt16 GetLRUFuncListCount() const
Definition: appoptio.hxx:47
bool bDetectiveAuto
Definition: appoptio.hxx:92
SvxZoomType GetZoomType() const
Definition: appoptio.hxx:44
void SetTrackMoveColor(Color nNew)
Definition: appoptio.hxx:64
sal_uInt16 nLRUFuncCount
Definition: appoptio.hxx:84
void SetKeyBindingType(ScOptionsUtil::KeyBindingType e)
Definition: appoptio.hxx:78
Color nTrackContentColor
Definition: appoptio.hxx:93
sal_Int32 GetDefaultObjectSizeWidth() const
Definition: appoptio.hxx:71
ScLkUpdMode GetLinkMode() const
Definition: appoptio.hxx:67
FieldUnit GetAppMetric() const
Definition: appoptio.hxx:40
void SetDetectiveAuto(bool bNew)
Definition: appoptio.hxx:55
sal_uInt16 GetZoom() const
Definition: appoptio.hxx:42
Color GetTrackContentColor() const
Definition: appoptio.hxx:59
void SetZoom(sal_uInt16 nNew)
Definition: appoptio.hxx:41
bool GetShowSharedDocumentWarning() const
Definition: appoptio.hxx:76
sal_Int32 GetDefaultObjectSizeHeight() const
Definition: appoptio.hxx:73
void SetDefaultObjectSizeHeight(sal_Int32 nNew)
Definition: appoptio.hxx:72
FieldUnit eMetric
Definition: appoptio.hxx:83
sal_Int32 nDefaultObjectSizeHeight
Definition: appoptio.hxx:99
Color nTrackInsertColor
Definition: appoptio.hxx:94
ScLkUpdMode eLinkMode
Definition: appoptio.hxx:97
void SetShowSharedDocumentWarning(bool bNew)
Definition: appoptio.hxx:75
void SetAutoComplete(bool bNew)
Definition: appoptio.hxx:53
SvxZoomType eZoomType
Definition: appoptio.hxx:87
void SetTrackDeleteColor(Color nNew)
Definition: appoptio.hxx:62
std::unique_ptr< sal_uInt16[]> pLRUList
Definition: appoptio.hxx:86
ScOptionsUtil::KeyBindingType meKeyBindingType
Definition: appoptio.hxx:101
void SetTrackContentColor(Color nNew)
Definition: appoptio.hxx:58
void SetZoomType(SvxZoomType eNew)
Definition: appoptio.hxx:43
bool GetSynchronizeZoom() const
Definition: appoptio.hxx:46
void SetAppMetric(FieldUnit eUnit)
Definition: appoptio.hxx:39
sal_uInt32 nStatusFunc
Definition: appoptio.hxx:90
void SetLinkMode(ScLkUpdMode nSet)
Definition: appoptio.hxx:68
Color nTrackDeleteColor
Definition: appoptio.hxx:95
Color nTrackMoveColor
Definition: appoptio.hxx:96
sal_uInt16 * GetLRUFuncList() const
Definition: appoptio.hxx:48
sal_uInt32 GetStatusFunc() const
Definition: appoptio.hxx:52
bool GetAutoComplete() const
Definition: appoptio.hxx:54
void SetDefaultObjectSizeWidth(sal_Int32 nNew)
Definition: appoptio.hxx:70
ScOptionsUtil::KeyBindingType GetKeyBindingType() const
Definition: appoptio.hxx:77
bool GetDetectiveAuto() const
Definition: appoptio.hxx:56
Color GetTrackDeleteColor() const
Definition: appoptio.hxx:63
void SetSynchronizeZoom(bool bNew)
Definition: appoptio.hxx:45
bool mbShowSharedDocumentWarning
Definition: appoptio.hxx:100
bool bSynchronizeZoom
Definition: appoptio.hxx:89
FieldUnit
ScLkUpdMode
Definition: global.hxx:410
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
SvxZoomType