xref: /trunk/main/sw/source/ui/inc/optcomp.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _OPTCOMP_HXX
28 #define _OPTCOMP_HXX
29 
30 #include <sfx2/tabdlg.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <unotools/compatibility.hxx>
34 #include <svx/checklbx.hxx>
35 
36 // class SwCompatibilityOptPage ------------------------------------------
37 
38 class SwWrtShell;
39 struct SwCompatibilityOptPage_Impl;
40 
41 class SwCompatibilityOptPage : public SfxTabPage
42 {
43 private:
44     // controls
45     FixedLine               m_aMainFL;
46     FixedText               m_aFormattingFT;
47     ListBox                 m_aFormattingLB;
48     FixedText               m_aOptionsFT;
49     SvxCheckListBox         m_aOptionsLB;
50     PushButton              m_aResetPB;
51     PushButton              m_aDefaultPB;
52     // config item
53     SvtCompatibilityOptions m_aConfigItem;
54     // text of the user entry
55     String                  m_sUserEntry;
56     // text of the "use as default" querybox
57     String                  m_sUseAsDefaultQuery;
58     // shell of the current document
59     SwWrtShell*             m_pWrtShell;
60     // impl object
61     SwCompatibilityOptPage_Impl* m_pImpl;
62     // saved options after "Reset"; used in "FillItemSet" for comparison
63     sal_uLong                   m_nSavedOptions;
64 
65     // handler
66     DECL_LINK(              SelectHdl, ListBox* );
67     DECL_LINK(              UseAsDefaultHdl, PushButton* );
68 
69     // private methods
70     void                    InitControls( const SfxItemSet& rSet );
71     void                    ReplaceFormatName( String& rEntry );
72     void                    SetCurrentOptions( sal_uLong nOptions );
73     sal_uLong                   GetDocumentOptions() const;
74     void                    WriteOptions();
75 
76 public:
77     SwCompatibilityOptPage( Window* pParent, const SfxItemSet& rSet );
78     ~SwCompatibilityOptPage();
79 
80     static SfxTabPage*      Create( Window* pParent, const SfxItemSet& rAttrSet );
81 
82     virtual sal_Bool            FillItemSet( SfxItemSet& rSet );
83     virtual void            Reset( const SfxItemSet& rSet );
84 };
85 
86 #endif
87 
88