xref: /AOO41X/main/sw/source/ui/inc/optcomp.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328) !
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 #ifndef _OPTCOMP_HXX
24 #define _OPTCOMP_HXX
25 
26 #include <sfx2/tabdlg.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <unotools/compatibility.hxx>
30 #include <svx/checklbx.hxx>
31 
32 // class SwCompatibilityOptPage ------------------------------------------
33 
34 class SwWrtShell;
35 struct SwCompatibilityOptPage_Impl;
36 
37 class SwCompatibilityOptPage : public SfxTabPage
38 {
39 private:
40     // controls
41     FixedLine               m_aMainFL;
42     FixedText               m_aFormattingFT;
43     ListBox                 m_aFormattingLB;
44     FixedText               m_aOptionsFT;
45     SvxCheckListBox         m_aOptionsLB;
46     PushButton              m_aResetPB;
47     PushButton              m_aDefaultPB;
48     // config item
49     SvtCompatibilityOptions m_aConfigItem;
50     // text of the user entry
51     String                  m_sUserEntry;
52     // text of the "use as default" querybox
53     String                  m_sUseAsDefaultQuery;
54     // shell of the current document
55     SwWrtShell*             m_pWrtShell;
56     // impl object
57     SwCompatibilityOptPage_Impl* m_pImpl;
58     // saved options after "Reset"; used in "FillItemSet" for comparison
59     sal_uLong                   m_nSavedOptions;
60 
61     // handler
62     DECL_LINK(              SelectHdl, ListBox* );
63     DECL_LINK(              UseAsDefaultHdl, PushButton* );
64 
65     // private methods
66     void                    InitControls( const SfxItemSet& rSet );
67     void                    ReplaceFormatName( String& rEntry );
68     void                    SetCurrentOptions( sal_uLong nOptions );
69     sal_uLong                   GetDocumentOptions() const;
70     void                    WriteOptions();
71 
72 public:
73     SwCompatibilityOptPage( Window* pParent, const SfxItemSet& rSet );
74     ~SwCompatibilityOptPage();
75 
76     static SfxTabPage*      Create( Window* pParent, const SfxItemSet& rAttrSet );
77 
78     virtual sal_Bool            FillItemSet( SfxItemSet& rSet );
79     virtual void            Reset( const SfxItemSet& rSet );
80 };
81 
82 #endif
83 
84