1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_SOURCE_UI_FLDUI_FLDPAGE_HXX
20 #define INCLUDED_SW_SOURCE_UI_FLDUI_FLDPAGE_HXX
22 #include <sfx2/tabdlg.hxx>
25 #define FIELD_COLUMN_WIDTH 19
27 const int coLBCount
= 3;
29 class SwFieldPage
: public SfxTabPage
31 OUString m_aLstStrArr
[ coLBCount
];
34 SwWrtShell
* m_pWrtShell
;
36 sal_Int32 m_nSelectionSel
;
39 bool m_bFieldDlgHtmlMode
;
41 bool m_bFirstHTMLInit
;
45 sal_Int32
GetTypeSel() const { return m_nTypeSel
;}
46 void SetTypeSel(sal_Int32 nSet
) { m_nTypeSel
= nSet
;}
47 sal_Int32
GetSelectionSel() const { return m_nSelectionSel
;}
48 void SetSelectionSel(sal_Int32 nSet
){ m_nSelectionSel
= nSet
;}
49 bool IsFieldDlgHtmlMode() const { return m_bFieldDlgHtmlMode
;}
50 bool IsRefresh() const { return m_bRefresh
;}
51 SwField
* GetCurField() { return m_pCurField
;}
52 SwWrtShell
* GetWrtShell() { return m_pWrtShell
;}
54 DECL_LINK( TreeViewInsertHdl
, weld::TreeView
&, bool );
55 DECL_LINK( NumFormatHdl
, weld::TreeView
&, bool );
56 void InsertHdl(weld::Widget
*);
59 void SavePos( const weld::TreeView
& rLst1
);
60 void RestorePos( weld::TreeView
& rLst1
);
61 bool IsCurrentPage() const;
62 void EnableInsert(bool bEnable
, bool bIsCurrentPage
);
63 bool IsFieldEdit() const { return m_bFieldEdit
; }
66 void InsertField(SwFieldTypesEnum nTypeId
,
68 const OUString
& rPar1
,
69 const OUString
& rPar2
,
71 sal_Unicode cDelim
= ' ',
72 bool bIsAutomaticLanguage
= true);
75 SwFieldPage(weld::Container
* pPage
, weld::DialogController
* pController
, const OUString
& rUIXMLDescription
,
76 const OUString
& rID
, const SfxItemSet
*pAttrSet
);
78 virtual ~SwFieldPage() override
;
80 virtual void Activate() override
;
82 SwFieldMgr
& GetFieldMgr() { return m_aMgr
; }
83 void SetWrtShell( SwWrtShell
* m_pWrtShell
);
84 void EditNewField( bool bOnlyActivate
= false );
85 virtual sal_uInt16
GetGroup() = 0;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */