Fix typo
[LibreOffice.git] / sc / inc / appoptio.hxx
blobd9e22c9cba781b3c941eff6664dbe20598d2f5a2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
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>
30 class SC_DLLPUBLIC ScAppOptions
32 public:
33 ScAppOptions();
34 ScAppOptions( const ScAppOptions& rCpy );
35 ~ScAppOptions();
37 void SetDefaults();
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; }
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; }
67 ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
68 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
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; }
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; }
80 void SetLinksInsertedLikeMSExcel(bool bNew) { mbLinksInsertedLikeMSExcel = bNew; }
81 bool GetLinksInsertedLikeMSExcel() const { return mbLinksInsertedLikeMSExcel; }
83 ScAppOptions& operator= ( const ScAppOptions& rOpt );
85 private:
86 FieldUnit eMetric;
87 sal_uInt16 nLRUFuncCount;
88 std::unique_ptr<sal_uInt16[]>
89 pLRUList;
90 SvxZoomType eZoomType;
91 sal_uInt16 nZoom;
92 bool bSynchronizeZoom;
93 sal_uInt32 nStatusFunc;
94 bool bAutoComplete;
95 bool bDetectiveAuto;
96 Color nTrackContentColor;
97 Color nTrackInsertColor;
98 Color nTrackDeleteColor;
99 Color nTrackMoveColor;
100 ScLkUpdMode eLinkMode;
101 sal_Int32 nDefaultObjectSizeWidth;
102 sal_Int32 nDefaultObjectSizeHeight;
103 bool mbShowSharedDocumentWarning;
104 ScOptionsUtil::KeyBindingType meKeyBindingType;
105 bool mbLinksInsertedLikeMSExcel;
108 // Config Item containing app options
110 class ScAppCfg : private ScAppOptions
112 // spread about 5 config paths
113 //! split ScAppOptions into different classes
115 ScLinkConfigItem aLayoutItem;
116 ScLinkConfigItem aInputItem;
117 ScLinkConfigItem aRevisionItem;
118 ScLinkConfigItem aContentItem;
119 ScLinkConfigItem aSortListItem;
120 ScLinkConfigItem aMiscItem;
121 ScLinkConfigItem aCompatItem;
123 void ReadLayoutCfg();
124 void ReadInputCfg();
125 void ReadRevisionCfg();
126 void ReadContentCfg();
127 void ReadSortListCfg();
128 void ReadMiscCfg();
129 void ReadCompatCfg();
131 DECL_LINK( LayoutCommitHdl, ScLinkConfigItem&, void );
132 DECL_LINK( InputCommitHdl, ScLinkConfigItem&, void );
133 DECL_LINK( RevisionCommitHdl, ScLinkConfigItem&, void );
134 DECL_LINK( ContentCommitHdl, ScLinkConfigItem&, void );
135 DECL_LINK( SortListCommitHdl, ScLinkConfigItem&, void );
136 DECL_LINK( MiscCommitHdl, ScLinkConfigItem&, void );
137 DECL_LINK( CompatCommitHdl, ScLinkConfigItem&, void );
139 DECL_LINK( LayoutNotifyHdl, ScLinkConfigItem&, void );
140 DECL_LINK( InputNotifyHdl, ScLinkConfigItem&, void );
141 DECL_LINK( RevisionNotifyHdl, ScLinkConfigItem&, void );
142 DECL_LINK( ContentNotifyHdl, ScLinkConfigItem&, void );
143 DECL_LINK( SortListNotifyHdl, ScLinkConfigItem&, void );
144 DECL_LINK( MiscNotifyHdl, ScLinkConfigItem&, void );
145 DECL_LINK( CompatNotifyHdl, ScLinkConfigItem&, void );
147 static css::uno::Sequence<OUString> GetLayoutPropertyNames();
148 static css::uno::Sequence<OUString> GetInputPropertyNames();
149 static css::uno::Sequence<OUString> GetRevisionPropertyNames();
150 static css::uno::Sequence<OUString> GetContentPropertyNames();
151 static css::uno::Sequence<OUString> GetSortListPropertyNames();
152 static css::uno::Sequence<OUString> GetMiscPropertyNames();
153 static css::uno::Sequence<OUString> GetCompatPropertyNames();
155 public:
156 ScAppCfg();
158 const ScAppOptions& GetOptions() const { return *this; }
159 void SetOptions( const ScAppOptions& rNew );
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */