LibreOffice Module sc (master)  1
appoptio.hxx
Go to the documentation of this file.
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 <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>
30 
32 {
33 public:
34  ScAppOptions();
35  ScAppOptions( const ScAppOptions& rCpy );
36  ~ScAppOptions();
37 
38  void SetDefaults();
39 
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; }
58 
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; }
67 
68  ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
69  void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
70 
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; }
75 
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; }
80 
81  ScAppOptions& operator= ( const ScAppOptions& rOpt );
82 
83 private:
85  sal_uInt16 nLRUFuncCount;
86  std::unique_ptr<sal_uInt16[]>
89  sal_uInt16 nZoom;
91  sal_uInt32 nStatusFunc;
103 };
104 
105 // Config Item containing app options
106 
107 class ScAppCfg : public ScAppOptions
108 {
109  // spread about 5 config paths
111 
119 
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 );
127 
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();
135 
136 public:
137  ScAppCfg();
138 
139  void SetOptions( const ScAppOptions& rNew );
140  void OptionsChanged(); // after direct access to ScAppOptions base class
141 };
142 
143 #endif
144 
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScOptionsUtil::KeyBindingType meKeyBindingType
Definition: appoptio.hxx:102
void SetAutoComplete(bool bNew)
Definition: appoptio.hxx:54
ScLkUpdMode eLinkMode
Definition: appoptio.hxx:98
FieldUnit
DECL_LINK(LayoutCommitHdl, ScLinkConfigItem &, void)
bool GetAutoComplete() const
Definition: appoptio.hxx:55
SvxZoomType eZoomType
Definition: appoptio.hxx:88
ScLinkConfigItem aMiscItem
Definition: appoptio.hxx:117
ScLinkConfigItem aSortListItem
Definition: appoptio.hxx:116
ScLkUpdMode GetLinkMode() const
Definition: appoptio.hxx:68
Color nTrackDeleteColor
Definition: appoptio.hxx:96
ScLinkConfigItem aContentItem
Definition: appoptio.hxx:115
sal_uInt16 GetLRUFuncListCount() const
Definition: appoptio.hxx:48
bool GetSynchronizeZoom() const
Definition: appoptio.hxx:47
void SetStatusFunc(sal_uInt32 nNew)
Definition: appoptio.hxx:52
ScOptionsUtil::KeyBindingType GetKeyBindingType() const
Definition: appoptio.hxx:78
static css::uno::Sequence< OUString > GetSortListPropertyNames()
Definition: appoptio.cxx:297
static css::uno::Sequence< OUString > GetRevisionPropertyNames()
Definition: appoptio.cxx:284
Color nTrackMoveColor
Definition: appoptio.hxx:97
sal_uInt16 nLRUFuncCount
Definition: appoptio.hxx:85
SvxZoomType GetZoomType() const
Definition: appoptio.hxx:45
void SetTrackDeleteColor(Color nNew)
Definition: appoptio.hxx:63
void OptionsChanged()
Definition: appoptio.cxx:711
Color GetTrackContentColor() const
Definition: appoptio.hxx:60
FieldUnit GetAppMetric() const
Definition: appoptio.hxx:41
Color GetTrackMoveColor() const
Definition: appoptio.hxx:66
void SetTrackContentColor(Color nNew)
Definition: appoptio.hxx:59
sal_uInt16 GetZoom() const
Definition: appoptio.hxx:43
ScLkUpdMode
Definition: global.hxx:419
sal_uInt16 * GetLRUFuncList() const
Definition: appoptio.hxx:49
bool bDetectiveAuto
Definition: appoptio.hxx:93
Color nTrackInsertColor
Definition: appoptio.hxx:95
bool bAutoComplete
Definition: appoptio.hxx:92
void SetTrackMoveColor(Color nNew)
Definition: appoptio.hxx:65
sal_Int32 nDefaultObjectSizeHeight
Definition: appoptio.hxx:100
Color GetTrackInsertColor() const
Definition: appoptio.hxx:62
void SetDefaultObjectSizeHeight(sal_Int32 nNew)
Definition: appoptio.hxx:73
bool GetDetectiveAuto() const
Definition: appoptio.hxx:57
void SetKeyBindingType(ScOptionsUtil::KeyBindingType e)
Definition: appoptio.hxx:79
void SetDetectiveAuto(bool bNew)
Definition: appoptio.hxx:56
ScLinkConfigItem aCompatItem
Definition: appoptio.hxx:118
void SetSynchronizeZoom(bool bNew)
Definition: appoptio.hxx:46
bool GetShowSharedDocumentWarning() const
Definition: appoptio.hxx:77
void SetShowSharedDocumentWarning(bool bNew)
Definition: appoptio.hxx:76
void SetZoom(sal_uInt16 nNew)
Definition: appoptio.hxx:42
bool bSynchronizeZoom
Definition: appoptio.hxx:90
void SetTrackInsertColor(Color nNew)
Definition: appoptio.hxx:61
sal_Int32 nDefaultObjectSizeWidth
Definition: appoptio.hxx:99
static css::uno::Sequence< OUString > GetMiscPropertyNames()
Definition: appoptio.cxx:302
Color GetTrackDeleteColor() const
Definition: appoptio.hxx:64
ScLinkConfigItem aInputItem
Definition: appoptio.hxx:113
Color nTrackContentColor
Definition: appoptio.hxx:94
static css::uno::Sequence< OUString > GetCompatPropertyNames()
Definition: appoptio.cxx:309
static css::uno::Sequence< OUString > GetContentPropertyNames()
Definition: appoptio.cxx:292
sal_uInt16 nZoom
Definition: appoptio.hxx:89
ScLinkConfigItem aLayoutItem
split ScAppOptions into different classes
Definition: appoptio.hxx:112
void SetZoomType(SvxZoomType eNew)
Definition: appoptio.hxx:44
std::unique_ptr< sal_uInt16[]> pLRUList
Definition: appoptio.hxx:87
sal_uInt32 GetStatusFunc() const
Definition: appoptio.hxx:53
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
Definition: appoptio.cxx:264
bool mbShowSharedDocumentWarning
Definition: appoptio.hxx:101
SvxZoomType
void SetDefaultObjectSizeWidth(sal_Int32 nNew)
Definition: appoptio.hxx:71
sal_uInt32 nStatusFunc
Definition: appoptio.hxx:91
static css::uno::Sequence< OUString > GetInputPropertyNames()
Definition: appoptio.cxx:277
FieldUnit eMetric
Definition: appoptio.hxx:84
void SetLinkMode(ScLkUpdMode nSet)
Definition: appoptio.hxx:69
sal_Int32 GetDefaultObjectSizeWidth() const
Definition: appoptio.hxx:72
void SetOptions(const ScAppOptions &rNew)
Definition: appoptio.cxx:705
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
sal_Int32 GetDefaultObjectSizeHeight() const
Definition: appoptio.hxx:74
ScLinkConfigItem aRevisionItem
Definition: appoptio.hxx:114
void SetAppMetric(FieldUnit eUnit)
Definition: appoptio.hxx:40