1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SC_APPOPTIO_HXX 25 #define SC_APPOPTIO_HXX 26 27 #include <vcl/field.hxx> 28 #include <svx/zoomitem.hxx> 29 #include <unotools/configitem.hxx> 30 #include "scdllapi.h" 31 #include "global.hxx" 32 #include "optutil.hxx" 33 34 class SC_DLLPUBLIC ScAppOptions 35 { 36 public: 37 ScAppOptions(); 38 ScAppOptions( const ScAppOptions& rCpy ); 39 ~ScAppOptions(); 40 41 void SetDefaults(); 42 SetAppMetric(FieldUnit eUnit)43 void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; } GetAppMetric() const44 FieldUnit GetAppMetric() const { return eMetric; } SetZoom(sal_uInt16 nNew)45 void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; } GetZoom() const46 sal_uInt16 GetZoom() const { return nZoom; } SetZoomType(SvxZoomType eNew)47 void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; } GetZoomType() const48 SvxZoomType GetZoomType() const { return eZoomType; } SetSynchronizeZoom(sal_Bool bNew)49 void SetSynchronizeZoom( sal_Bool bNew ) { bSynchronizeZoom = bNew; } GetSynchronizeZoom() const50 sal_Bool GetSynchronizeZoom() const { return bSynchronizeZoom; } GetLRUFuncListCount() const51 sal_uInt16 GetLRUFuncListCount() const { return nLRUFuncCount; } GetLRUFuncList() const52 sal_uInt16* GetLRUFuncList() const { return pLRUList; } 53 void SetLRUFuncList( const sal_uInt16* pList, 54 const sal_uInt16 nCount ); SetStatusFunc(sal_uInt16 nNew)55 void SetStatusFunc( sal_uInt16 nNew ) { nStatusFunc = nNew; } GetStatusFunc() const56 sal_uInt16 GetStatusFunc() const { return nStatusFunc; } SetAutoComplete(sal_Bool bNew)57 void SetAutoComplete( sal_Bool bNew ) { bAutoComplete = bNew; } GetAutoComplete() const58 sal_Bool GetAutoComplete() const { return bAutoComplete; } SetDetectiveAuto(sal_Bool bNew)59 void SetDetectiveAuto( sal_Bool bNew ) { bDetectiveAuto = bNew; } GetDetectiveAuto() const60 sal_Bool GetDetectiveAuto() const { return bDetectiveAuto; } 61 SetTrackContentColor(sal_uInt32 nNew)62 void SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; } GetTrackContentColor() const63 sal_uInt32 GetTrackContentColor() const { return nTrackContentColor; } SetTrackInsertColor(sal_uInt32 nNew)64 void SetTrackInsertColor(sal_uInt32 nNew) { nTrackInsertColor = nNew; } GetTrackInsertColor() const65 sal_uInt32 GetTrackInsertColor() const { return nTrackInsertColor; } SetTrackDeleteColor(sal_uInt32 nNew)66 void SetTrackDeleteColor(sal_uInt32 nNew) { nTrackDeleteColor = nNew; } GetTrackDeleteColor() const67 sal_uInt32 GetTrackDeleteColor() const { return nTrackDeleteColor; } SetTrackMoveColor(sal_uInt32 nNew)68 void SetTrackMoveColor(sal_uInt32 nNew) { nTrackMoveColor = nNew; } GetTrackMoveColor() const69 sal_uInt32 GetTrackMoveColor() const { return nTrackMoveColor; } 70 GetLinkMode() const71 ScLkUpdMode GetLinkMode() const { return eLinkMode ;} SetLinkMode(ScLkUpdMode nSet)72 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;} 73 GetTabCountInNewSpreadsheet() const74 sal_uInt16 GetTabCountInNewSpreadsheet() const { return mnTabCountInNewSpreadsheet; } SetTabCountInNewSpreadsheet(sal_uInt16 nNew)75 void SetTabCountInNewSpreadsheet( sal_uInt16 nNew ) { mnTabCountInNewSpreadsheet = nNew; } 76 SetShowSharedDocumentWarning(sal_Bool bNew)77 void SetShowSharedDocumentWarning( sal_Bool bNew ) { mbShowSharedDocumentWarning = bNew; } GetShowSharedDocumentWarning() const78 sal_Bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; } 79 SetDefaultObjectSizeWidth(sal_Int32 nNew)80 void SetDefaultObjectSizeWidth(sal_Int32 nNew) { nDefaultObjectSizeWidth = nNew; } GetDefaultObjectSizeWidth() const81 sal_Int32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; } SetDefaultObjectSizeHeight(sal_Int32 nNew)82 void SetDefaultObjectSizeHeight(sal_Int32 nNew) { nDefaultObjectSizeHeight = nNew; } GetDefaultObjectSizeHeight() const83 sal_Int32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; } 84 85 const ScAppOptions& operator= ( const ScAppOptions& rOpt ); 86 87 private: 88 FieldUnit eMetric; 89 sal_uInt16 nLRUFuncCount; 90 sal_uInt16* pLRUList; 91 SvxZoomType eZoomType; 92 sal_uInt16 nZoom; 93 sal_Bool bSynchronizeZoom; 94 sal_uInt16 nStatusFunc; 95 sal_Bool bAutoComplete; 96 sal_Bool bDetectiveAuto; 97 sal_uInt32 nTrackContentColor; 98 sal_uInt32 nTrackInsertColor; 99 sal_uInt32 nTrackDeleteColor; 100 sal_uInt32 nTrackMoveColor; 101 ScLkUpdMode eLinkMode; 102 sal_Int32 nDefaultObjectSizeWidth; 103 sal_Int32 nDefaultObjectSizeHeight; 104 sal_Bool mbShowSharedDocumentWarning; 105 sal_uInt16 mnTabCountInNewSpreadsheet; 106 }; 107 108 109 //================================================================== 110 // Config Item containing app options 111 //================================================================== 112 113 class ScAppCfg : public ScAppOptions 114 { 115 // spread about 5 config paths 116 //! split ScAppOptions into different classes 117 118 ScLinkConfigItem aLayoutItem; 119 ScLinkConfigItem aInputItem; 120 ScLinkConfigItem aRevisionItem; 121 ScLinkConfigItem aContentItem; 122 ScLinkConfigItem aSortListItem; 123 ScLinkConfigItem aMiscItem; 124 125 DECL_LINK( LayoutCommitHdl, void* ); 126 DECL_LINK( InputCommitHdl, void* ); 127 DECL_LINK( RevisionCommitHdl, void* ); 128 DECL_LINK( ContentCommitHdl, void* ); 129 DECL_LINK( SortListCommitHdl, void* ); 130 DECL_LINK( MiscCommitHdl, void* ); 131 132 com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames(); 133 com::sun::star::uno::Sequence<rtl::OUString> GetInputPropertyNames(); 134 com::sun::star::uno::Sequence<rtl::OUString> GetRevisionPropertyNames(); 135 com::sun::star::uno::Sequence<rtl::OUString> GetContentPropertyNames(); 136 com::sun::star::uno::Sequence<rtl::OUString> GetSortListPropertyNames(); 137 com::sun::star::uno::Sequence<rtl::OUString> GetMiscPropertyNames(); 138 139 public: 140 ScAppCfg(); 141 142 void SetOptions( const ScAppOptions& rNew ); 143 void OptionsChanged(); // after direct access to ScAppOptions base class 144 }; 145 146 147 #endif 148