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