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