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