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 .
22 #include "anyrefdg.hxx"
23 #include <rangelst.hxx>
25 #include <unordered_map>
30 class ScColRowNameRangesDlg
: public ScAnyRefDlgController
33 ScColRowNameRangesDlg(SfxBindings
* pB
, SfxChildWindow
* pCW
, weld::Window
* pParent
,
34 ScViewData
& rViewData
);
35 virtual ~ScColRowNameRangesDlg() override
;
37 virtual void SetReference( const ScRange
& rRef
, ScDocument
& rDoc
) override
;
39 virtual bool IsRefInputMode() const override
;
40 virtual void SetActive() override
;
41 virtual void Close() override
;
47 ScRangePairListRef xColNameRanges
;
48 ScRangePairListRef xRowNameRanges
;
50 typedef std::unordered_map
< OUString
, ScRange
> NameRangeMap
;
51 NameRangeMap aRangeMap
;
52 ScViewData
& m_rViewData
;
56 formula::RefEdit
* m_pEdActive
;
57 std::unique_ptr
<weld::TreeView
> m_xLbRange
;
59 std::unique_ptr
<formula::RefEdit
> m_xEdAssign
;
60 std::unique_ptr
<formula::RefButton
> m_xRbAssign
;
61 std::unique_ptr
<weld::RadioButton
> m_xBtnColHead
;
62 std::unique_ptr
<weld::RadioButton
> m_xBtnRowHead
;
63 std::unique_ptr
<formula::RefEdit
> m_xEdAssign2
;
64 std::unique_ptr
<formula::RefButton
> m_xRbAssign2
;
66 std::unique_ptr
<weld::Button
> m_xBtnOk
;
67 std::unique_ptr
<weld::Button
> m_xBtnCancel
;
68 std::unique_ptr
<weld::Button
> m_xBtnAdd
;
69 std::unique_ptr
<weld::Button
> m_xBtnRemove
;
71 std::unique_ptr
<weld::Frame
> m_xRangeFrame
;
72 std::unique_ptr
<weld::Label
> m_xRangeFT
;
73 std::unique_ptr
<weld::Label
> m_xDataFT
;
77 void UpdateRangeData ( const ScRange
& rRange
, bool bColName
);
78 void SetColRowData( const ScRange
& rLabelRange
, bool bRef
=false);
79 void AdjustColRowData( const ScRange
& rDataRange
, bool bRef
=false);
80 DECL_LINK( CancelBtnHdl
, weld::Button
&, void );
81 DECL_LINK( OkBtnHdl
, weld::Button
&, void );
82 DECL_LINK( AddBtnHdl
, weld::Button
&, void );
83 DECL_LINK( RemoveBtnHdl
, weld::Button
&, void );
84 DECL_LINK( Range1SelectHdl
, weld::TreeView
&, void );
85 DECL_LINK( Range1DataModifyHdl
, formula::RefEdit
&, void );
86 DECL_LINK( ColRowToggleHdl
, weld::Toggleable
&, void );
87 DECL_LINK( Range2DataModifyHdl
, formula::RefEdit
&, void );
88 DECL_LINK( GetEditFocusHdl
, formula::RefEdit
&, void );
89 DECL_LINK( LoseEditFocusHdl
, formula::RefEdit
&, void );
90 DECL_LINK( GetButtonFocusHdl
, formula::RefButton
&, void );
91 DECL_LINK( LoseButtonFocusHdl
, formula::RefButton
&, void );
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */