Bump version to 6.4-15
[LibreOffice.git] / sc / inc / appoptio.hxx
blobebadb6e329fd0dd1469301b099d9fd2670e6d0f3
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 #ifndef INCLUDED_SC_INC_APPOPTIO_HXX
21 #define INCLUDED_SC_INC_APPOPTIO_HXX
23 #include <sfx2/zoomitem.hxx>
24 #include "scdllapi.h"
25 #include "global.hxx"
26 #include "optutil.hxx"
27 #include <tools/fldunit.hxx>
28 #include <tools/color.hxx>
29 #include <tools/link.hxx>
31 class SC_DLLPUBLIC ScAppOptions
33 public:
34 ScAppOptions();
35 ScAppOptions( const ScAppOptions& rCpy );
36 ~ScAppOptions();
38 void SetDefaults();
40 void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
41 FieldUnit GetAppMetric() const { return eMetric; }
42 void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; }
43 sal_uInt16 GetZoom() const { return nZoom; }
44 void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; }
45 SvxZoomType GetZoomType() const { return eZoomType; }
46 void SetSynchronizeZoom( bool bNew ) { bSynchronizeZoom = bNew; }
47 bool GetSynchronizeZoom() const { return bSynchronizeZoom; }
48 sal_uInt16 GetLRUFuncListCount() const { return nLRUFuncCount; }
49 sal_uInt16* GetLRUFuncList() const { return pLRUList.get(); }
50 void SetLRUFuncList( const sal_uInt16* pList,
51 const sal_uInt16 nCount );
52 void SetStatusFunc( sal_uInt32 nNew ) { nStatusFunc = nNew; }
53 sal_uInt32 GetStatusFunc() const { return nStatusFunc; }
54 void SetAutoComplete( bool bNew ) { bAutoComplete = bNew; }
55 bool GetAutoComplete() const { return bAutoComplete; }
56 void SetDetectiveAuto( bool bNew ) { bDetectiveAuto = bNew; }
57 bool GetDetectiveAuto() const { return bDetectiveAuto; }
59 void SetTrackContentColor(Color nNew) { nTrackContentColor = nNew; }
60 Color GetTrackContentColor() const { return nTrackContentColor; }
61 void SetTrackInsertColor(Color nNew) { nTrackInsertColor = nNew; }
62 Color GetTrackInsertColor() const { return nTrackInsertColor; }
63 void SetTrackDeleteColor(Color nNew) { nTrackDeleteColor = nNew; }
64 Color GetTrackDeleteColor() const { return nTrackDeleteColor; }
65 void SetTrackMoveColor(Color nNew) { nTrackMoveColor = nNew; }
66 Color GetTrackMoveColor() const { return nTrackMoveColor; }
68 ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
69 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
71 void SetDefaultObjectSizeWidth(sal_Int32 nNew) { nDefaultObjectSizeWidth = nNew; }
72 sal_Int32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; }
73 void SetDefaultObjectSizeHeight(sal_Int32 nNew) { nDefaultObjectSizeHeight = nNew; }
74 sal_Int32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; }
76 void SetShowSharedDocumentWarning( bool bNew ) { mbShowSharedDocumentWarning = bNew; }
77 bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; }
78 ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; }
79 void SetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { meKeyBindingType = e; }
81 ScAppOptions& operator= ( const ScAppOptions& rOpt );
83 private:
84 FieldUnit eMetric;
85 sal_uInt16 nLRUFuncCount;
86 std::unique_ptr<sal_uInt16[]>
87 pLRUList;
88 SvxZoomType eZoomType;
89 sal_uInt16 nZoom;
90 bool bSynchronizeZoom;
91 sal_uInt32 nStatusFunc;
92 bool bAutoComplete;
93 bool bDetectiveAuto;
94 Color nTrackContentColor;
95 Color nTrackInsertColor;
96 Color nTrackDeleteColor;
97 Color nTrackMoveColor;
98 ScLkUpdMode eLinkMode;
99 sal_Int32 nDefaultObjectSizeWidth;
100 sal_Int32 nDefaultObjectSizeHeight;
101 bool mbShowSharedDocumentWarning;
102 ScOptionsUtil::KeyBindingType meKeyBindingType;
105 // Config Item containing app options
107 class ScAppCfg : public ScAppOptions
109 // spread about 5 config paths
110 //! split ScAppOptions into different classes
112 ScLinkConfigItem aLayoutItem;
113 ScLinkConfigItem aInputItem;
114 ScLinkConfigItem aRevisionItem;
115 ScLinkConfigItem aContentItem;
116 ScLinkConfigItem aSortListItem;
117 ScLinkConfigItem aMiscItem;
118 ScLinkConfigItem aCompatItem;
120 DECL_LINK( LayoutCommitHdl, ScLinkConfigItem&, void );
121 DECL_LINK( InputCommitHdl, ScLinkConfigItem&, void );
122 DECL_LINK( RevisionCommitHdl, ScLinkConfigItem&, void );
123 DECL_LINK( ContentCommitHdl, ScLinkConfigItem&, void );
124 DECL_LINK( SortListCommitHdl, ScLinkConfigItem&, void );
125 DECL_LINK( MiscCommitHdl, ScLinkConfigItem&, void );
126 DECL_LINK( CompatCommitHdl, ScLinkConfigItem&, void );
128 static css::uno::Sequence<OUString> GetLayoutPropertyNames();
129 static css::uno::Sequence<OUString> GetInputPropertyNames();
130 static css::uno::Sequence<OUString> GetRevisionPropertyNames();
131 static css::uno::Sequence<OUString> GetContentPropertyNames();
132 static css::uno::Sequence<OUString> GetSortListPropertyNames();
133 static css::uno::Sequence<OUString> GetMiscPropertyNames();
134 static css::uno::Sequence<OUString> GetCompatPropertyNames();
136 public:
137 ScAppCfg();
139 void SetOptions( const ScAppOptions& rNew );
140 void OptionsChanged(); // after direct access to ScAppOptions base class
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */