Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_UI_FLDUI_FLDPAGE_HXX
20 : #define INCLUDED_SW_SOURCE_UI_FLDUI_FLDPAGE_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 : #include <fldmgr.hxx>
24 :
25 : #define FIELD_COLUMN_WIDTH 76
26 :
27 : class ListBox;
28 :
29 : const int coLBCount = 3;
30 :
31 : class SwFieldPage : public SfxTabPage
32 : {
33 : OUString m_aLstStrArr[ coLBCount ];
34 : SwFieldMgr m_aMgr;
35 : SwField *m_pCurField;
36 : SwWrtShell* m_pWrtShell;
37 : sal_Int32 m_nTypeSel;
38 : sal_Int32 m_nSelectionSel;
39 : bool m_bFieldEdit;
40 : bool m_bInsert;
41 : bool m_bFieldDlgHtmlMode;
42 : bool m_bRefresh;
43 : bool m_bFirstHTMLInit;
44 :
45 : protected:
46 :
47 0 : sal_Int32 GetTypeSel() const { return m_nTypeSel;}
48 0 : void SetTypeSel(sal_Int32 nSet) { m_nTypeSel = nSet;}
49 0 : sal_Int32 GetSelectionSel() const { return m_nSelectionSel;}
50 0 : void SetSelectionSel(sal_Int32 nSet){ m_nSelectionSel = nSet;}
51 0 : bool IsFieldDlgHtmlMode() const { return m_bFieldDlgHtmlMode;}
52 0 : bool IsRefresh() const { return m_bRefresh;}
53 0 : SwField* GetCurField() { return m_pCurField;}
54 0 : SwWrtShell* GetWrtShell() { return m_pWrtShell;}
55 :
56 : DECL_LINK( InsertHdl, Button *pBtn = 0 );
57 : DECL_LINK(NumFormatHdl, void *);
58 :
59 : void Init();
60 : void SavePos( const ListBox* pLst1,
61 : const ListBox* pLst2 = 0,
62 : const ListBox* pLst3 = 0);
63 : void RestorePos( ListBox* pLst1, ListBox* pLst2 = 0,
64 : ListBox* pLst3 = 0 );
65 : void EnableInsert(bool bEnable = true);
66 0 : inline bool IsFieldEdit() const { return m_bFieldEdit; }
67 :
68 : // insert field
69 : bool InsertField( sal_uInt16 nTypeId,
70 : sal_uInt16 nSubType,
71 : const OUString& rPar1,
72 : const OUString& rPar2,
73 : sal_uLong nFormatId,
74 : sal_Unicode cDelim = ' ',
75 : bool bIsAutomaticLanguage = true);
76 :
77 : using SfxTabPage::ActivatePage;
78 :
79 : public:
80 : SwFieldPage(vcl::Window *pParent, const OString& rID,
81 : const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet);
82 :
83 : virtual ~SwFieldPage();
84 :
85 : virtual void ActivatePage() SAL_OVERRIDE;
86 :
87 0 : inline SwFieldMgr& GetFieldMgr() { return m_aMgr; }
88 : void SetWrtShell( SwWrtShell* m_pWrtShell );
89 : void EditNewField( bool bOnlyActivate = false );
90 : virtual sal_uInt16 GetGroup() = 0;
91 : };
92 :
93 : #endif
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|