LibreOffice Module sw (master)  1
fldpage.hxx
Go to the documentation of this file.
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 19
26 
27 const int coLBCount = 3;
28 
29 class SwFieldPage : public SfxTabPage
30 {
31  OUString m_aLstStrArr[ coLBCount ];
35  sal_Int32 m_nTypeSel;
36  sal_Int32 m_nSelectionSel;
38  bool m_bInsert;
40  bool m_bRefresh;
42 
43 protected:
44 
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;}
53 
54  DECL_LINK( TreeViewInsertHdl, weld::TreeView&, bool );
55  DECL_LINK( NumFormatHdl, weld::TreeView&, bool );
56  void InsertHdl(weld::Widget*);
57 
58  void Init();
59  void SavePos( const weld::TreeView& rLst1);
60  void RestorePos( weld::TreeView& rLst1 );
61  void EnableInsert(bool bEnable);
62  bool IsFieldEdit() const { return m_bFieldEdit; }
63 
64  // insert field
65  void InsertField(SwFieldTypesEnum nTypeId,
66  sal_uInt16 nSubType,
67  const OUString& rPar1,
68  const OUString& rPar2,
69  sal_uInt32 nFormatId,
70  sal_Unicode cDelim = ' ',
71  bool bIsAutomaticLanguage = true);
72 
73 public:
74  SwFieldPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription,
75  const OString& rID, const SfxItemSet *pAttrSet);
76 
77  virtual ~SwFieldPage() override;
78 
79  virtual void Activate() override;
80 
81  SwFieldMgr& GetFieldMgr() { return m_aMgr; }
82  void SetWrtShell( SwWrtShell* m_pWrtShell );
83  void EditNewField( bool bOnlyActivate = false );
84  virtual sal_uInt16 GetGroup() = 0;
85 };
86 
87 #endif
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void RestorePos(weld::TreeView &rLst1)
Definition: fldpage.cxx:294
bool m_bFirstHTMLInit
Definition: fldpage.hxx:41
Base class of all fields.
Definition: fldbas.hxx:280
bool m_bRefresh
Definition: fldpage.hxx:40
sal_Int32 m_nSelectionSel
Definition: fldpage.hxx:36
virtual sal_uInt16 GetGroup()=0
bool m_bFieldEdit
Definition: fldpage.hxx:37
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
sal_uInt16 sal_Unicode
SwFieldMgr & GetFieldMgr()
Definition: fldpage.hxx:81
void SetSelectionSel(sal_Int32 nSet)
Definition: fldpage.hxx:48
bool IsFieldDlgHtmlMode() const
Definition: fldpage.hxx:49
DECL_LINK(TreeViewInsertHdl, weld::TreeView &, bool)
bool m_bInsert
Definition: fldpage.hxx:38
virtual ~SwFieldPage() override
Definition: fldpage.cxx:60
void EnableInsert(bool bEnable)
Definition: fldpage.cxx:326
void SavePos(const weld::TreeView &rLst1)
Definition: fldpage.cxx:284
sal_Int32 GetSelectionSel() const
Definition: fldpage.hxx:47
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:87
void Init()
Definition: fldpage.cxx:65
bool IsRefresh() const
Definition: fldpage.hxx:50
void InsertField(SwFieldTypesEnum nTypeId, sal_uInt16 nSubType, const OUString &rPar1, const OUString &rPar2, sal_uInt32 nFormatId, sal_Unicode cDelim= ' ', bool bIsAutomaticLanguage=true)
Definition: fldpage.cxx:117
sal_Int32 GetTypeSel() const
Definition: fldpage.hxx:45
SwField * GetCurField()
Definition: fldpage.hxx:51
OUString m_aLstStrArr[coLBCount]
Definition: fldpage.hxx:31
SwFieldPage(weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OString &rID, const SfxItemSet *pAttrSet)
Definition: fldpage.cxx:45
SwFieldMgr m_aMgr
Definition: fldpage.hxx:32
SwWrtShell * m_pWrtShell
Definition: fldpage.hxx:34
void EditNewField(bool bOnlyActivate=false)
Definition: fldpage.cxx:106
SwWrtShell * GetWrtShell()
Definition: fldpage.hxx:52
virtual void Activate() override
Definition: fldpage.cxx:100
void SetWrtShell(SwWrtShell *m_pWrtShell)
Definition: fldpage.cxx:348
SwField * m_pCurField
Definition: fldpage.hxx:33
bool m_bFieldDlgHtmlMode
Definition: fldpage.hxx:39
bool IsFieldEdit() const
Definition: fldpage.hxx:62
sal_Int32 m_nTypeSel
Definition: fldpage.hxx:35
void InsertHdl(weld::Widget *)
Definition: fldpage.cxx:309
const int coLBCount
Definition: fldpage.hxx:27
void SetTypeSel(sal_Int32 nSet)
Definition: fldpage.hxx:46