update dev300-m58
[ooovba.git] / sw / source / ui / inc / optcomp.hxx
blobb9daacb46af8bb3620744f41b2e49a34ec43a800
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optcomp.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
30 #ifndef _OPTCOMP_HXX
31 #define _OPTCOMP_HXX
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 ------------------------------------------
41 class SwWrtShell;
42 struct SwCompatibilityOptPage_Impl;
44 class SwCompatibilityOptPage : public SfxTabPage
46 private:
47 // controls
48 FixedLine m_aMainFL;
49 FixedText m_aFormattingFT;
50 ListBox m_aFormattingLB;
51 FixedText m_aOptionsFT;
52 SvxCheckListBox m_aOptionsLB;
53 PushButton m_aResetPB;
54 PushButton m_aDefaultPB;
55 // config item
56 SvtCompatibilityOptions m_aConfigItem;
57 // text of the user entry
58 String m_sUserEntry;
59 // text of the "use as default" querybox
60 String m_sUseAsDefaultQuery;
61 // shell of the current document
62 SwWrtShell* m_pWrtShell;
63 // impl object
64 SwCompatibilityOptPage_Impl* m_pImpl;
65 // saved options after "Reset"; used in "FillItemSet" for comparison
66 ULONG m_nSavedOptions;
68 // handler
69 DECL_LINK( SelectHdl, ListBox* );
70 DECL_LINK( UseAsDefaultHdl, PushButton* );
72 // private methods
73 void InitControls( const SfxItemSet& rSet );
74 void ReplaceFormatName( String& rEntry );
75 void SetCurrentOptions( ULONG nOptions );
76 ULONG GetDocumentOptions() const;
77 void WriteOptions();
79 public:
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 );
89 #endif