LibreOffice Module sw (master)  1
inputwin.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_UIBASE_INC_INPUTWIN_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_INPUTWIN_HXX
21 
22 #include <vcl/edit.hxx>
23 #include <vcl/menu.hxx>
24 #include <vcl/toolbox.hxx>
25 
26 #include <sfx2/childwin.hxx>
27 
28 class SwFieldMgr;
29 class SwWrtShell;
30 class SwView;
31 class SfxDispatcher;
32 
33 class InputEdit : public Edit
34 {
35 public:
36  InputEdit(vcl::Window* pParent, WinBits nStyle) :
37  Edit(pParent , nStyle){}
38 
39  void UpdateRange(const OUString& aSel,
40  const OUString& aTableName );
41 
42 protected:
43  virtual void KeyInput( const KeyEvent& ) override;
44 };
45 
46 class SwInputWindow final : public ToolBox
47 {
48 friend class InputEdit;
49 
52  std::unique_ptr<SwFieldMgr> pMgr;
56 
57  bool bFirst : 1; // initialisations at first call
58  bool bIsTable : 1;
59  bool bDelSel : 1;
60  bool m_bDoesUndo : 1;
61  bool m_bResetUndo : 1;
62  bool m_bCallUndo : 1;
63 
65 
66  void DelBoxContent();
67  DECL_LINK( ModifyHdl, Edit&, void );
68 
69  using Window::IsActive;
70 
71  virtual void Resize() override;
72  virtual void Click() override;
73  DECL_LINK( MenuHdl, Menu *, bool );
74  DECL_LINK( DropdownClickHdl, ToolBox*, void );
75  void ApplyFormula();
76  void CancelFormula();
77 
78 public:
79  SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispatcher);
80  virtual ~SwInputWindow() override;
81  virtual void dispose() override;
82 
83  void ShowWin();
84 
85  DECL_LINK( SelTableCellsNotify, SwWrtShell&, void );
86 
87  void SetFormula( const OUString& rFormula );
88  const SwView* GetView() const{return pView;}
89 };
90 
92 {
94 public:
96  sal_uInt16 nId,
97  SfxBindings const *,
98  SfxChildWinInfo* );
99  virtual ~SwInputChild() override;
101  void SetFormula( const OUString& rFormula )
102  { static_cast<SwInputWindow*>(GetWindow())->SetFormula( rFormula ); }
103  const SwView* GetView() const
104  { return static_cast<SwInputWindow*>(GetWindow())->GetView();}
105 
106 };
107 
108 #endif
109 
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Resize() override
Definition: inputwin.cxx:174
bool m_bCallUndo
Definition: inputwin.hxx:62
virtual void dispose() override
Definition: inputwin.cxx:138
SwWrtShell * pWrtShell
Definition: inputwin.hxx:53
VclPtr< Edit > aPos
Definition: inputwin.hxx:50
void ApplyFormula()
Definition: inputwin.cxx:331
void DelBoxContent()
Definition: inputwin.cxx:443
SwView * pView
Definition: inputwin.hxx:54
SwInputWindow(vcl::Window *pParent, SfxDispatcher const *pDispatcher)
Definition: inputwin.cxx:64
void CancelFormula()
Definition: inputwin.cxx:352
vcl::Window * GetWindow() const
virtual void Click() override
Definition: inputwin.cxx:312
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
sal_Int64 WinBits
InputEdit(vcl::Window *pParent, WinBits nStyle)
Definition: inputwin.hxx:36
void CleanupUglyHackWithUndo()
Definition: inputwin.cxx:157
SFX_DECL_CHILDWINDOW_WITHID(SwInputChild)
DECL_LINK(ModifyHdl, Edit &, void)
SwInputChild(vcl::Window *, sal_uInt16 nId, SfxBindings const *, SfxChildWinInfo *)
Definition: inputwin.cxx:565
void SetFormula(const OUString &rFormula)
Definition: inputwin.hxx:101
virtual ~SwInputChild() override
Definition: inputwin.cxx:577
OUString aCurrentTableName
Definition: inputwin.hxx:55
void UpdateRange(const OUString &aSel, const OUString &aTableName)
Definition: inputwin.cxx:470
void ShowWin()
Definition: inputwin.cxx:187
std::unique_ptr< SwFieldMgr > pMgr
Definition: inputwin.hxx:52
SfxDispatcher * pDispatch
Definition: inputwin.hxx:93
virtual ~SwInputWindow() override
Definition: inputwin.cxx:133
OUString sOldFormula
Definition: inputwin.hxx:55
bool m_bDoesUndo
Definition: inputwin.hxx:60
virtual void KeyInput(const KeyEvent &) override
Definition: inputwin.cxx:459
VclPtr< InputEdit > aEdit
Definition: inputwin.hxx:51
const SwView * GetView() const
Definition: inputwin.hxx:88
const SwView * GetView() const
Definition: inputwin.hxx:103
Definition: view.hxx:146
bool m_bResetUndo
Definition: inputwin.hxx:61
void SetFormula(const OUString &rFormula)
Definition: inputwin.cxx:413