1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
24 #include <vcl/field.hxx>
25 #include <sfx2/zoomitem.hxx>
26 #include <unotools/configitem.hxx>
30 #include "optutil.hxx"
32 class SC_DLLPUBLIC ScAppOptions
36 ScAppOptions( const ScAppOptions
& rCpy
);
41 void SetAppMetric( FieldUnit eUnit
) { eMetric
= eUnit
; }
42 FieldUnit
GetAppMetric() const { return eMetric
; }
43 void SetZoom( sal_uInt16 nNew
) { nZoom
= nNew
; }
44 sal_uInt16
GetZoom() const { return nZoom
; }
45 void SetZoomType( SvxZoomType eNew
) { eZoomType
= eNew
; }
46 SvxZoomType
GetZoomType() const { return eZoomType
; }
47 void SetSynchronizeZoom( bool bNew
) { bSynchronizeZoom
= bNew
; }
48 bool GetSynchronizeZoom() const { return bSynchronizeZoom
; }
49 sal_uInt16
GetLRUFuncListCount() const { return nLRUFuncCount
; }
50 sal_uInt16
* GetLRUFuncList() const { return pLRUList
.get(); }
51 void SetLRUFuncList( const sal_uInt16
* pList
,
52 const sal_uInt16 nCount
);
53 void SetStatusFunc( sal_uInt32 nNew
) { nStatusFunc
= nNew
; }
54 sal_uInt32
GetStatusFunc() const { return nStatusFunc
; }
55 void SetAutoComplete( bool bNew
) { bAutoComplete
= bNew
; }
56 bool GetAutoComplete() const { return bAutoComplete
; }
57 void SetDetectiveAuto( bool bNew
) { bDetectiveAuto
= bNew
; }
58 bool GetDetectiveAuto() const { return bDetectiveAuto
; }
60 void SetTrackContentColor(Color nNew
) { nTrackContentColor
= nNew
; }
61 Color
GetTrackContentColor() const { return nTrackContentColor
; }
62 void SetTrackInsertColor(Color nNew
) { nTrackInsertColor
= nNew
; }
63 Color
GetTrackInsertColor() const { return nTrackInsertColor
; }
64 void SetTrackDeleteColor(Color nNew
) { nTrackDeleteColor
= nNew
; }
65 Color
GetTrackDeleteColor() const { return nTrackDeleteColor
; }
66 void SetTrackMoveColor(Color nNew
) { nTrackMoveColor
= nNew
; }
67 Color
GetTrackMoveColor() const { return nTrackMoveColor
; }
69 ScLkUpdMode
GetLinkMode() const { return eLinkMode
;}
70 void SetLinkMode( ScLkUpdMode nSet
) { eLinkMode
= nSet
;}
72 void SetDefaultObjectSizeWidth(sal_Int32 nNew
) { nDefaultObjectSizeWidth
= nNew
; }
73 sal_Int32
GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth
; }
74 void SetDefaultObjectSizeHeight(sal_Int32 nNew
) { nDefaultObjectSizeHeight
= nNew
; }
75 sal_Int32
GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight
; }
77 void SetShowSharedDocumentWarning( bool bNew
) { mbShowSharedDocumentWarning
= bNew
; }
78 bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning
; }
79 ScOptionsUtil::KeyBindingType
GetKeyBindingType() const { return meKeyBindingType
; }
80 void SetKeyBindingType( ScOptionsUtil::KeyBindingType e
) { meKeyBindingType
= e
; }
82 ScAppOptions
& operator= ( const ScAppOptions
& rOpt
);
86 sal_uInt16 nLRUFuncCount
;
87 std::unique_ptr
<sal_uInt16
[]>
89 SvxZoomType eZoomType
;
91 bool bSynchronizeZoom
;
92 sal_uInt32 nStatusFunc
;
95 Color nTrackContentColor
;
96 Color nTrackInsertColor
;
97 Color nTrackDeleteColor
;
98 Color nTrackMoveColor
;
99 ScLkUpdMode eLinkMode
;
100 sal_Int32 nDefaultObjectSizeWidth
;
101 sal_Int32 nDefaultObjectSizeHeight
;
102 bool mbShowSharedDocumentWarning
;
103 ScOptionsUtil::KeyBindingType meKeyBindingType
;
106 // Config Item containing app options
108 class ScAppCfg
: public ScAppOptions
110 // spread about 5 config paths
111 //! split ScAppOptions into different classes
113 ScLinkConfigItem aLayoutItem
;
114 ScLinkConfigItem aInputItem
;
115 ScLinkConfigItem aRevisionItem
;
116 ScLinkConfigItem aContentItem
;
117 ScLinkConfigItem aSortListItem
;
118 ScLinkConfigItem aMiscItem
;
119 ScLinkConfigItem aCompatItem
;
121 DECL_LINK( LayoutCommitHdl
, ScLinkConfigItem
&, void );
122 DECL_LINK( InputCommitHdl
, ScLinkConfigItem
&, void );
123 DECL_LINK( RevisionCommitHdl
, ScLinkConfigItem
&, void );
124 DECL_LINK( ContentCommitHdl
, ScLinkConfigItem
&, void );
125 DECL_LINK( SortListCommitHdl
, ScLinkConfigItem
&, void );
126 DECL_LINK( MiscCommitHdl
, ScLinkConfigItem
&, void );
127 DECL_LINK( CompatCommitHdl
, ScLinkConfigItem
&, void );
129 static css::uno::Sequence
<OUString
> GetLayoutPropertyNames();
130 static css::uno::Sequence
<OUString
> GetInputPropertyNames();
131 static css::uno::Sequence
<OUString
> GetRevisionPropertyNames();
132 static css::uno::Sequence
<OUString
> GetContentPropertyNames();
133 static css::uno::Sequence
<OUString
> GetSortListPropertyNames();
134 static css::uno::Sequence
<OUString
> GetMiscPropertyNames();
135 static css::uno::Sequence
<OUString
> GetCompatPropertyNames();
140 void SetOptions( const ScAppOptions
& rNew
);
141 void OptionsChanged(); // after direct access to ScAppOptions base class
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */