LibreOffice Module sc (master)  1
crnrdlg.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 
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_CRNRDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_CRNRDLG_HXX
22 
23 #include "anyrefdg.hxx"
24 #include <rangelst.hxx>
25 
26 #include <unordered_map>
27 
28 class ScViewData;
29 class ScDocument;
30 
32 {
33 public:
35  ScViewData& rViewData);
36  virtual ~ScColRowNameRangesDlg() override;
37 
38  virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override;
39 
40  virtual bool IsRefInputMode() const override;
41  virtual void SetActive() override;
42  virtual void Close() override;
43 
44 private:
47 
50 
51  typedef std::unordered_map< OUString, ScRange > NameRangeMap;
52  NameRangeMap aRangeMap;
56 
58  std::unique_ptr<weld::TreeView> m_xLbRange;
59 
60  std::unique_ptr<formula::RefEdit> m_xEdAssign;
61  std::unique_ptr<formula::RefButton> m_xRbAssign;
62  std::unique_ptr<weld::RadioButton> m_xBtnColHead;
63  std::unique_ptr<weld::RadioButton> m_xBtnRowHead;
64  std::unique_ptr<formula::RefEdit> m_xEdAssign2;
65  std::unique_ptr<formula::RefButton> m_xRbAssign2;
66 
67  std::unique_ptr<weld::Button> m_xBtnOk;
68  std::unique_ptr<weld::Button> m_xBtnCancel;
69  std::unique_ptr<weld::Button> m_xBtnAdd;
70  std::unique_ptr<weld::Button> m_xBtnRemove;
71 
72  std::unique_ptr<weld::Frame> m_xRangeFrame;
73  std::unique_ptr<weld::Label> m_xRangeFT;
74  std::unique_ptr<weld::Label> m_xDataFT;
75 
76  void Init ();
77  void UpdateNames ();
78  void UpdateRangeData ( const ScRange& rRange, bool bColName );
79  void SetColRowData( const ScRange& rLabelRange, bool bRef=false);
80  void AdjustColRowData( const ScRange& rDataRange, bool bRef=false);
81  DECL_LINK( CancelBtnHdl, weld::Button&, void );
82  DECL_LINK( OkBtnHdl, weld::Button&, void );
83  DECL_LINK( AddBtnHdl, weld::Button&, void );
84  DECL_LINK( RemoveBtnHdl, weld::Button&, void );
85  DECL_LINK( Range1SelectHdl, weld::TreeView&, void );
86  DECL_LINK( Range1DataModifyHdl, formula::RefEdit&, void );
87  DECL_LINK( ColClickHdl, weld::Button&, void );
88  DECL_LINK( RowClickHdl, weld::Button&, void );
89  DECL_LINK( Range2DataModifyHdl, formula::RefEdit&, void );
90  DECL_LINK( GetEditFocusHdl, formula::RefEdit&, void );
91  DECL_LINK( LoseEditFocusHdl, formula::RefEdit&, void );
92  DECL_LINK( GetButtonFocusHdl, formula::RefButton&, void );
93  DECL_LINK( LoseButtonFocusHdl, formula::RefButton&, void );
94 };
95 
96 #endif // INCLUDED_SC_SOURCE_UI_INC_CRNRDLG_HXX
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Frame > m_xRangeFrame
Definition: crnrdlg.hxx:72
formula::RefEdit * m_pEdActive
Definition: crnrdlg.hxx:57
ScColRowNameRangesDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData &rViewData)
Definition: crnrdlg.cxx:57
ScViewData & m_rViewData
Definition: crnrdlg.hxx:53
ScDocument & rDoc
Definition: crnrdlg.hxx:54
std::unique_ptr< weld::RadioButton > m_xBtnRowHead
Definition: crnrdlg.hxx:63
std::unique_ptr< weld::Button > m_xBtnOk
Definition: crnrdlg.hxx:67
std::unique_ptr< weld::Label > m_xDataFT
Definition: crnrdlg.hxx:74
std::unique_ptr< formula::RefEdit > m_xEdAssign2
Definition: crnrdlg.hxx:64
std::unique_ptr< weld::Label > m_xRangeFT
Definition: crnrdlg.hxx:73
void SetColRowData(const ScRange &rLabelRange, bool bRef=false)
Definition: crnrdlg.cxx:150
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: crnrdlg.cxx:295
virtual bool IsRefInputMode() const override
Definition: crnrdlg.cxx:471
std::unordered_map< OUString, ScRange > NameRangeMap
Definition: crnrdlg.hxx:51
std::unique_ptr< weld::TreeView > m_xLbRange
Definition: crnrdlg.hxx:58
ScRangePairListRef xColNameRanges
Definition: crnrdlg.hxx:48
std::unique_ptr< formula::RefButton > m_xRbAssign2
Definition: crnrdlg.hxx:65
ScRangePairListRef xRowNameRanges
Definition: crnrdlg.hxx:49
virtual void SetActive() override
Definition: crnrdlg.cxx:318
std::unique_ptr< weld::RadioButton > m_xBtnColHead
Definition: crnrdlg.hxx:62
DECL_LINK(CancelBtnHdl, weld::Button &, void)
virtual ~ScColRowNameRangesDlg() override
Definition: crnrdlg.cxx:92
void AdjustColRowData(const ScRange &rDataRange, bool bRef=false)
Definition: crnrdlg.cxx:234
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: crnrdlg.hxx:68
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: crnrdlg.hxx:69
virtual void Close() override
Definition: crnrdlg.cxx:313
std::unique_ptr< formula::RefEdit > m_xEdAssign
Definition: crnrdlg.hxx:60
std::unique_ptr< weld::Button > m_xBtnRemove
Definition: crnrdlg.hxx:70
NameRangeMap aRangeMap
Definition: crnrdlg.hxx:52
std::unique_ptr< formula::RefButton > m_xRbAssign
Definition: crnrdlg.hxx:61
void UpdateRangeData(const ScRange &rRange, bool bColName)
Definition: crnrdlg.cxx:437