xref: /AOO41X/main/sc/inc/appoptio.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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 
SetDefaultObjectSizeWidth(sal_Int32 nNew)74     void        SetDefaultObjectSizeWidth(sal_Int32 nNew)   { nDefaultObjectSizeWidth = nNew; }
GetDefaultObjectSizeWidth() const75     sal_Int32       GetDefaultObjectSizeWidth() const       { return nDefaultObjectSizeWidth; }
SetDefaultObjectSizeHeight(sal_Int32 nNew)76     void        SetDefaultObjectSizeHeight(sal_Int32 nNew)  { nDefaultObjectSizeHeight = nNew; }
GetDefaultObjectSizeHeight() const77     sal_Int32       GetDefaultObjectSizeHeight() const      { return nDefaultObjectSizeHeight; }
78 
SetShowSharedDocumentWarning(sal_Bool bNew)79     void        SetShowSharedDocumentWarning( sal_Bool bNew )   { mbShowSharedDocumentWarning = bNew; }
GetShowSharedDocumentWarning() const80     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