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 SC_APPOPTIO_HXX
21 : #define SC_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 34 : void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
41 73 : FieldUnit GetAppMetric() const { return eMetric; }
42 34 : void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; }
43 211 : sal_uInt16 GetZoom() const { return nZoom; }
44 34 : void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; }
45 211 : SvxZoomType GetZoomType() const { return eZoomType; }
46 31 : void SetSynchronizeZoom( sal_Bool bNew ) { bSynchronizeZoom = bNew; }
47 1 : sal_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 34 : void SetStatusFunc( sal_uInt16 nNew ) { nStatusFunc = nNew; }
53 231 : sal_uInt16 GetStatusFunc() const { return nStatusFunc; }
54 34 : void SetAutoComplete( sal_Bool bNew ) { bAutoComplete = bNew; }
55 8 : sal_Bool GetAutoComplete() const { return bAutoComplete; }
56 33 : void SetDetectiveAuto( sal_Bool bNew ) { bDetectiveAuto = bNew; }
57 11 : sal_Bool GetDetectiveAuto() const { return bDetectiveAuto; }
58 :
59 31 : void SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; }
60 1 : sal_uInt32 GetTrackContentColor() const { return nTrackContentColor; }
61 31 : void SetTrackInsertColor(sal_uInt32 nNew) { nTrackInsertColor = nNew; }
62 1 : sal_uInt32 GetTrackInsertColor() const { return nTrackInsertColor; }
63 31 : void SetTrackDeleteColor(sal_uInt32 nNew) { nTrackDeleteColor = nNew; }
64 1 : sal_uInt32 GetTrackDeleteColor() const { return nTrackDeleteColor; }
65 31 : void SetTrackMoveColor(sal_uInt32 nNew) { nTrackMoveColor = nNew; }
66 1 : sal_uInt32 GetTrackMoveColor() const { return nTrackMoveColor; }
67 :
68 8 : ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
69 34 : void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
70 :
71 31 : void SetDefaultObjectSizeWidth(sal_Int32 nNew) { nDefaultObjectSizeWidth = nNew; }
72 1 : sal_Int32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; }
73 31 : void SetDefaultObjectSizeHeight(sal_Int32 nNew) { nDefaultObjectSizeHeight = nNew; }
74 1 : sal_Int32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; }
75 :
76 31 : void SetShowSharedDocumentWarning( sal_Bool bNew ) { mbShowSharedDocumentWarning = bNew; }
77 1 : sal_Bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; }
78 1 : ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; }
79 31 : 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 : sal_Bool bSynchronizeZoom;
90 : sal_uInt16 nStatusFunc;
91 : sal_Bool bAutoComplete;
92 : sal_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 : sal_Bool mbShowSharedDocumentWarning;
101 : ScOptionsUtil::KeyBindingType meKeyBindingType;
102 : };
103 :
104 :
105 : //==================================================================
106 : // Config Item containing app options
107 : //==================================================================
108 :
109 9 : class ScAppCfg : public ScAppOptions
110 : {
111 : // spread about 5 config paths
112 : //! split ScAppOptions into different classes
113 :
114 : ScLinkConfigItem aLayoutItem;
115 : ScLinkConfigItem aInputItem;
116 : ScLinkConfigItem aRevisionItem;
117 : ScLinkConfigItem aContentItem;
118 : ScLinkConfigItem aSortListItem;
119 : ScLinkConfigItem aMiscItem;
120 : ScLinkConfigItem aCompatItem;
121 :
122 : DECL_LINK( LayoutCommitHdl, void* );
123 : DECL_LINK( InputCommitHdl, void* );
124 : DECL_LINK( RevisionCommitHdl, void* );
125 : DECL_LINK( ContentCommitHdl, void* );
126 : DECL_LINK( SortListCommitHdl, void* );
127 : DECL_LINK( MiscCommitHdl, void* );
128 : DECL_LINK( CompatCommitHdl, void* );
129 :
130 : com::sun::star::uno::Sequence<OUString> GetLayoutPropertyNames();
131 : com::sun::star::uno::Sequence<OUString> GetInputPropertyNames();
132 : com::sun::star::uno::Sequence<OUString> GetRevisionPropertyNames();
133 : com::sun::star::uno::Sequence<OUString> GetContentPropertyNames();
134 : com::sun::star::uno::Sequence<OUString> GetSortListPropertyNames();
135 : com::sun::star::uno::Sequence<OUString> GetMiscPropertyNames();
136 : com::sun::star::uno::Sequence<OUString> GetCompatPropertyNames();
137 :
138 : public:
139 : ScAppCfg();
140 :
141 : void SetOptions( const ScAppOptions& rNew );
142 : void OptionsChanged(); // after direct access to ScAppOptions base class
143 : };
144 :
145 : #endif
146 :
147 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|