1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optcomp.hxx,v $
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 ************************************************************************/
33 #include <sfx2/tabdlg.hxx>
34 #include <vcl/fixed.hxx>
35 #include <vcl/lstbox.hxx>
36 #include <svtools/compatibility.hxx>
37 #include <svx/checklbx.hxx>
39 // class SwCompatibilityOptPage ------------------------------------------
42 struct SwCompatibilityOptPage_Impl
;
44 class SwCompatibilityOptPage
: public SfxTabPage
49 FixedText m_aFormattingFT
;
50 ListBox m_aFormattingLB
;
51 FixedText m_aOptionsFT
;
52 SvxCheckListBox m_aOptionsLB
;
53 PushButton m_aResetPB
;
54 PushButton m_aDefaultPB
;
56 SvtCompatibilityOptions m_aConfigItem
;
57 // text of the user entry
59 // text of the "use as default" querybox
60 String m_sUseAsDefaultQuery
;
61 // shell of the current document
62 SwWrtShell
* m_pWrtShell
;
64 SwCompatibilityOptPage_Impl
* m_pImpl
;
65 // saved options after "Reset"; used in "FillItemSet" for comparison
66 ULONG m_nSavedOptions
;
69 DECL_LINK( SelectHdl
, ListBox
* );
70 DECL_LINK( UseAsDefaultHdl
, PushButton
* );
73 void InitControls( const SfxItemSet
& rSet
);
74 void ReplaceFormatName( String
& rEntry
);
75 void SetCurrentOptions( ULONG nOptions
);
76 ULONG
GetDocumentOptions() const;
80 SwCompatibilityOptPage( Window
* pParent
, const SfxItemSet
& rSet
);
81 ~SwCompatibilityOptPage();
83 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
85 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
86 virtual void Reset( const SfxItemSet
& rSet
);