merge the formfield patch from ooo-build
[ooovba.git] / sc / inc / appoptio.hxx
blobed04546b0ec210fc48bbd4df89aabc7b7a8441ef
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: appoptio.hxx,v $
10 * $Revision: 1.10.32.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_APPOPTIO_HXX
32 #define SC_APPOPTIO_HXX
34 #include <vcl/field.hxx>
35 #include <svx/zoomitem.hxx>
36 #include <unotools/configitem.hxx>
37 #include "scdllapi.h"
38 #include "global.hxx"
39 #include "optutil.hxx"
41 class SC_DLLPUBLIC ScAppOptions
43 public:
44 ScAppOptions();
45 ScAppOptions( const ScAppOptions& rCpy );
46 ~ScAppOptions();
48 void SetDefaults();
50 void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
51 FieldUnit GetAppMetric() const { return eMetric; }
52 void SetZoom( USHORT nNew ) { nZoom = nNew; }
53 USHORT GetZoom() const { return nZoom; }
54 void SetZoomType( SvxZoomType eNew ) { eZoomType = eNew; }
55 SvxZoomType GetZoomType() const { return eZoomType; }
56 void SetSynchronizeZoom( BOOL bNew ) { bSynchronizeZoom = bNew; }
57 BOOL GetSynchronizeZoom() const { return bSynchronizeZoom; }
58 USHORT GetLRUFuncListCount() const { return nLRUFuncCount; }
59 USHORT* GetLRUFuncList() const { return pLRUList; }
60 void SetLRUFuncList( const USHORT* pList,
61 const USHORT nCount );
62 void SetStatusFunc( USHORT nNew ) { nStatusFunc = nNew; }
63 USHORT GetStatusFunc() const { return nStatusFunc; }
64 void SetAutoComplete( BOOL bNew ) { bAutoComplete = bNew; }
65 BOOL GetAutoComplete() const { return bAutoComplete; }
66 void SetDetectiveAuto( BOOL bNew ) { bDetectiveAuto = bNew; }
67 BOOL GetDetectiveAuto() const { return bDetectiveAuto; }
69 void SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; }
70 sal_uInt32 GetTrackContentColor() const { return nTrackContentColor; }
71 void SetTrackInsertColor(sal_uInt32 nNew) { nTrackInsertColor = nNew; }
72 sal_uInt32 GetTrackInsertColor() const { return nTrackInsertColor; }
73 void SetTrackDeleteColor(sal_uInt32 nNew) { nTrackDeleteColor = nNew; }
74 sal_uInt32 GetTrackDeleteColor() const { return nTrackDeleteColor; }
75 void SetTrackMoveColor(sal_uInt32 nNew) { nTrackMoveColor = nNew; }
76 sal_uInt32 GetTrackMoveColor() const { return nTrackMoveColor; }
78 ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
79 void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
81 void SetDefaultObjectSizeWidth(INT32 nNew) { nDefaultObjectSizeWidth = nNew; }
82 INT32 GetDefaultObjectSizeWidth() const { return nDefaultObjectSizeWidth; }
83 void SetDefaultObjectSizeHeight(INT32 nNew) { nDefaultObjectSizeHeight = nNew; }
84 INT32 GetDefaultObjectSizeHeight() const { return nDefaultObjectSizeHeight; }
86 void SetShowSharedDocumentWarning( BOOL bNew ) { mbShowSharedDocumentWarning = bNew; }
87 BOOL GetShowSharedDocumentWarning() const { return mbShowSharedDocumentWarning; }
90 const ScAppOptions& operator= ( const ScAppOptions& rOpt );
92 private:
93 FieldUnit eMetric;
94 USHORT nLRUFuncCount;
95 USHORT* pLRUList;
96 SvxZoomType eZoomType;
97 USHORT nZoom;
98 BOOL bSynchronizeZoom;
99 USHORT nStatusFunc;
100 BOOL bAutoComplete;
101 BOOL bDetectiveAuto;
102 sal_uInt32 nTrackContentColor;
103 sal_uInt32 nTrackInsertColor;
104 sal_uInt32 nTrackDeleteColor;
105 sal_uInt32 nTrackMoveColor;
106 ScLkUpdMode eLinkMode;
107 INT32 nDefaultObjectSizeWidth;
108 INT32 nDefaultObjectSizeHeight;
109 BOOL mbShowSharedDocumentWarning;
113 //==================================================================
114 // Config Item containing app options
115 //==================================================================
117 class ScAppCfg : public ScAppOptions
119 // spread about 5 config paths
120 //! split ScAppOptions into different classes
122 ScLinkConfigItem aLayoutItem;
123 ScLinkConfigItem aInputItem;
124 ScLinkConfigItem aRevisionItem;
125 ScLinkConfigItem aContentItem;
126 ScLinkConfigItem aSortListItem;
127 ScLinkConfigItem aMiscItem;
129 DECL_LINK( LayoutCommitHdl, void* );
130 DECL_LINK( InputCommitHdl, void* );
131 DECL_LINK( RevisionCommitHdl, void* );
132 DECL_LINK( ContentCommitHdl, void* );
133 DECL_LINK( SortListCommitHdl, void* );
134 DECL_LINK( MiscCommitHdl, void* );
136 com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
137 com::sun::star::uno::Sequence<rtl::OUString> GetInputPropertyNames();
138 com::sun::star::uno::Sequence<rtl::OUString> GetRevisionPropertyNames();
139 com::sun::star::uno::Sequence<rtl::OUString> GetContentPropertyNames();
140 com::sun::star::uno::Sequence<rtl::OUString> GetSortListPropertyNames();
141 com::sun::star::uno::Sequence<rtl::OUString> GetMiscPropertyNames();
143 public:
144 ScAppCfg();
146 void SetOptions( const ScAppOptions& rNew );
147 void OptionsChanged(); // after direct access to ScAppOptions base class
151 #endif