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 43 void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; } 44 FieldUnit GetAppMetric() const { return eMetric; } 45 void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; } 46 sal_uInt16 GetZoom() const { return nZoom; } 47 void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; } 48 SvxZoomType GetZoomType() const { return eZoomType; } 49 void SetSynchronizeZoom( sal_Bool bNew ) { bSynchronizeZoom = bNew; } 50 sal_Bool GetSynchronizeZoom() const { return bSynchronizeZoom; } 51 sal_uInt16 GetLRUFuncListCount() const { return nLRUFuncCount; } 52 sal_uInt16* GetLRUFuncList() const { return pLRUList; } 53 void SetLRUFuncList( const sal_uInt16* pList, 54 const sal_uInt16 nCount ); 55 void SetStatusFunc( sal_uInt16 nNew ) { nStatusFunc = nNew; } 56 sal_uInt16 GetStatusFunc() const { return nStatusFunc; } 57 void SetAutoComplete( sal_Bool bNew ) { bAutoComplete = bNew; } 58 sal_Bool GetAutoComplete() const { return bAutoComplete; } 59 void SetDetectiveAuto( sal_Bool bNew ) { bDetectiveAuto = bNew; } 60 sal_Bool GetDetectiveAuto() const { return bDetectiveAuto; } 61 62 void SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; } 63 sal_uInt32 GetTrackContentColor() const { return nTrackContentColor; } 64 void SetTrackInsertColor(sal_uInt32 nNew) { nTrackInsertColor = nNew; } 65 sal_uInt32 GetTrackInsertColor() const { return nTrackInsertColor; } 66 void SetTrackDeleteColor(sal_uInt32 nNew) { nTrackDeleteColor = nNew; } 67 sal_uInt32 GetTrackDeleteColor() const { return nTrackDeleteColor; } 68 void SetTrackMoveColor(sal_uInt32 nNew) { nTrackMoveColor = nNew; } 69 sal_uInt32 GetTrackMoveColor() const { return nTrackMoveColor; } 70 71 ScLkUpdMode GetLinkMode() const { return eLinkMode ;} 72 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;} 73 74 void SetDefaultObjectSizeWidth(sal_Int32 nNew) { nDefaultObjectSizeWidth = nNew; } 75 sal_Int32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; } 76 void SetDefaultObjectSizeHeight(sal_Int32 nNew) { nDefaultObjectSizeHeight = nNew; } 77 sal_Int32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; } 78 79 void SetShowSharedDocumentWarning( sal_Bool bNew ) { mbShowSharedDocumentWarning = bNew; } 80 sal_Bool GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; } 81 82 83 const ScAppOptions& operator= ( const ScAppOptions& rOpt ); 84 85 private: 86 FieldUnit eMetric; 87 sal_uInt16 nLRUFuncCount; 88 sal_uInt16* pLRUList; 89 SvxZoomType eZoomType; 90 sal_uInt16 nZoom; 91 sal_Bool bSynchronizeZoom; 92 sal_uInt16 nStatusFunc; 93 sal_Bool bAutoComplete; 94 sal_Bool bDetectiveAuto; 95 sal_uInt32 nTrackContentColor; 96 sal_uInt32 nTrackInsertColor; 97 sal_uInt32 nTrackDeleteColor; 98 sal_uInt32 nTrackMoveColor; 99 ScLkUpdMode eLinkMode; 100 sal_Int32 nDefaultObjectSizeWidth; 101 sal_Int32 nDefaultObjectSizeHeight; 102 sal_Bool mbShowSharedDocumentWarning; 103 }; 104 105 106 //================================================================== 107 // Config Item containing app options 108 //================================================================== 109 110 class ScAppCfg : public ScAppOptions 111 { 112 // spread about 5 config paths 113 //! split ScAppOptions into different classes 114 115 ScLinkConfigItem aLayoutItem; 116 ScLinkConfigItem aInputItem; 117 ScLinkConfigItem aRevisionItem; 118 ScLinkConfigItem aContentItem; 119 ScLinkConfigItem aSortListItem; 120 ScLinkConfigItem aMiscItem; 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 129 com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames(); 130 com::sun::star::uno::Sequence<rtl::OUString> GetInputPropertyNames(); 131 com::sun::star::uno::Sequence<rtl::OUString> GetRevisionPropertyNames(); 132 com::sun::star::uno::Sequence<rtl::OUString> GetContentPropertyNames(); 133 com::sun::star::uno::Sequence<rtl::OUString> GetSortListPropertyNames(); 134 com::sun::star::uno::Sequence<rtl::OUString> GetMiscPropertyNames(); 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 144 #endif 145 146