Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SWFLDPAGE_HXX
29 : : #define _SWFLDPAGE_HXX
30 : :
31 : : #include <sfx2/tabdlg.hxx>
32 : : #include <fldmgr.hxx>
33 : :
34 : : class ListBox;
35 : :
36 : : const int coLBCount = 3;
37 : :
38 : : class SwFldPage : public SfxTabPage
39 : : {
40 : : String m_aLstStrArr[ coLBCount ];
41 : : SwFldMgr m_aMgr;
42 : : SwField *m_pCurFld;
43 : : SwWrtShell* m_pWrtShell;
44 : : sal_uInt16 m_nPageId;
45 : : sal_uInt16 m_nTypeSel;
46 : : sal_uInt16 m_nSelectionSel;
47 : : sal_Bool m_bFldEdit;
48 : : sal_Bool m_bInsert;
49 : : sal_Bool m_bFldDlgHtmlMode;
50 : : sal_Bool m_bRefresh;
51 : : sal_Bool m_bFirstHTMLInit;
52 : :
53 : : protected:
54 : :
55 : 0 : sal_uInt16 GetTypeSel() const { return m_nTypeSel;}
56 : 0 : void SetTypeSel(sal_uInt16 nSet) { m_nTypeSel = nSet;}
57 : 0 : sal_uInt16 GetSelectionSel() const { return m_nSelectionSel;}
58 : 0 : void SetSelectionSel(sal_uInt16 nSet){ m_nSelectionSel = nSet;}
59 : 0 : sal_Bool IsFldDlgHtmlMode() const { return m_bFldDlgHtmlMode;}
60 : 0 : sal_Bool IsRefresh() const { return m_bRefresh;}
61 : 0 : SwField* GetCurField() { return m_pCurFld;}
62 : 0 : SwWrtShell* GetWrtShell() { return m_pWrtShell;}
63 : :
64 : : DECL_LINK( InsertHdl, Button *pBtn = 0 );
65 : : DECL_LINK(NumFormatHdl, void *);
66 : :
67 : : void Init();
68 : : void SavePos( const ListBox* pLst1,
69 : : const ListBox* pLst2 = 0,
70 : : const ListBox* pLst3 = 0);
71 : : void RestorePos( ListBox* pLst1, ListBox* pLst2 = 0,
72 : : ListBox* pLst3 = 0 );
73 : : void EnableInsert(sal_Bool bEnable = sal_True);
74 : 0 : inline sal_Bool IsFldEdit() const { return m_bFldEdit; }
75 : :
76 : : // insert field
77 : : sal_Bool InsertFld( sal_uInt16 nTypeId,
78 : : sal_uInt16 nSubType,
79 : : const String& rPar1,
80 : : const String& rPar2,
81 : : sal_uLong nFormatId,
82 : : sal_Unicode cDelim = ' ',
83 : : sal_Bool bIsAutomaticLanguage = sal_True);
84 : :
85 : : using SfxTabPage::ActivatePage;
86 : :
87 : : public:
88 : : SwFldPage( Window *pParent,
89 : : const ResId &rId,
90 : : const SfxItemSet &rAttrSet );
91 : :
92 : : virtual ~SwFldPage();
93 : :
94 : : virtual void ActivatePage();
95 : :
96 : 0 : inline SwFldMgr& GetFldMgr() { return m_aMgr; }
97 : : void SetWrtShell( SwWrtShell* m_pWrtShell );
98 : : void EditNewField( sal_Bool bOnlyActivate = sal_False );
99 : : virtual sal_uInt16 GetGroup() = 0;
100 : : };
101 : :
102 : :
103 : : #endif
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|