xref: /aoo41x/main/sw/source/ui/fldui/fldpage.hxx (revision cdf0e10c)
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 _SWFLDPAGE_HXX
28 #define _SWFLDPAGE_HXX
29 
30 #include <sfx2/tabdlg.hxx>
31 #include <fldmgr.hxx>
32 
33 class ListBox;
34 
35 /*--------------------------------------------------------------------
36    Beschreibung:
37  --------------------------------------------------------------------*/
38 
39 const int coLBCount = 3;
40 
41 class SwFldPage : public SfxTabPage
42 {
43     String              m_aLstStrArr[ coLBCount ];
44     SwFldMgr            m_aMgr;
45     SwField             *m_pCurFld;
46     SwWrtShell*         m_pWrtShell;
47     sal_uInt16              m_nPageId;
48     sal_uInt16              m_nTypeSel;
49     sal_uInt16              m_nSelectionSel;
50     sal_Bool                m_bFldEdit;
51     sal_Bool                m_bInsert;
52     sal_Bool                m_bFldDlgHtmlMode;
53     sal_Bool                m_bRefresh;
54     sal_Bool                m_bFirstHTMLInit;
55 
56 protected:
57 
58     sal_uInt16              GetTypeSel() const          { return m_nTypeSel;}
59     void                SetTypeSel(sal_uInt16 nSet)     { m_nTypeSel = nSet;}
60     sal_uInt16              GetSelectionSel() const     { return m_nSelectionSel;}
61     void                SetSelectionSel(sal_uInt16 nSet){ m_nSelectionSel = nSet;}
62     sal_Bool                IsFldDlgHtmlMode() const    { return m_bFldDlgHtmlMode;}
63     sal_Bool                IsRefresh() const           { return m_bRefresh;}
64     SwField*            GetCurField()               { return m_pCurFld;}
65     SwWrtShell*         GetWrtShell() { return m_pWrtShell;}
66 
67 	DECL_LINK( InsertHdl, Button *pBtn = 0 );
68 	DECL_LINK( NumFormatHdl, ListBox *pBtn = 0 );
69 
70 	void				Init();
71 	void				SavePos( const ListBox* pLst1,
72 								 const ListBox* pLst2 = 0,
73 								 const ListBox* pLst3 = 0);
74 	void				RestorePos( ListBox* pLst1, ListBox* pLst2 = 0,
75 									ListBox* pLst3 = 0 );
76 	void				EnableInsert(sal_Bool bEnable = sal_True);
77     inline sal_Bool         IsFldEdit() const   { return m_bFldEdit; }
78 
79 	// Feld einfuegen
80 	sal_Bool 				InsertFld( 	sal_uInt16 nTypeId,
81 									sal_uInt16 nSubType,
82 									const String& rPar1,
83 									const String& rPar2,
84 									sal_uLong nFormatId,
85                                     sal_Unicode cDelim = ' ',
86                                     sal_Bool bIsAutomaticLanguage = sal_True);
87 
88     using SfxTabPage::ActivatePage;
89 
90 public:
91 						SwFldPage(	Window *pParent,
92 									const ResId &rId,
93 									const SfxItemSet &rAttrSet );
94 
95 						virtual ~SwFldPage();
96 
97 	virtual void		ActivatePage();
98 
99     inline SwFldMgr&    GetFldMgr()         { return m_aMgr; }
100     void                SetWrtShell( SwWrtShell* m_pWrtShell );
101 	void				EditNewField( sal_Bool bOnlyActivate = sal_False );
102 	virtual sal_uInt16		GetGroup() = 0;
103 };
104 
105 
106 #endif
107 
108