LibreOffice Module sc (master) 1
condformatdlg.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
10#pragma once
11
12#include <rangelst.hxx>
13#include "condformatdlgitem.hxx"
15
16#include "anyrefdg.hxx"
17
18#include <memory>
19
20#define DLG_RET_ADD 8
21#define DLG_RET_EDIT 16
22
23class ScDocument;
25class ScViewData;
26
27class ScCondFormatDlg;
28
30{
31private:
32 std::unique_ptr<weld::ScrolledWindow> mxScrollWindow;
33 std::unique_ptr<weld::Container> mxGrid;
34
35 typedef std::vector<std::unique_ptr<ScCondFrmtEntry>> EntryContainer;
37
40
45
46public:
48 std::unique_ptr<weld::ScrolledWindow> xWindow,
49 std::unique_ptr<weld::Container> xGrid);
50 weld::Container* GetContainer() { return mxGrid.get(); }
52
53 void init(ScDocument& rDoc, const ScConditionalFormat* pFormat,
54 const ScRangeList& rRanges, const ScAddress& rPos,
56
57 void SetRange(const ScRangeList& rRange);
58
59 std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;
61 void Freeze() { mbFrozen = true; }
62 void Thaw() { mbFrozen = false; }
63 void RecalcAll();
64
65 DECL_LINK( AddBtnHdl, weld::Button&, void );
66 DECL_LINK( RemoveBtnHdl, weld::Button&, void );
67 DECL_LINK( UpBtnHdl, weld::Button&, void );
68 DECL_LINK( DownBtnHdl, weld::Button&, void );
69 DECL_LINK( EntrySelectHdl, ScCondFrmtEntry&, void );
70
71 DECL_LINK( TypeListHdl, weld::ComboBox&, void );
72 DECL_LINK( AfterTypeListHdl, void*, void );
73 DECL_LINK( ColFormatTypeHdl, weld::ComboBox&, void );
74 DECL_LINK( AfterColFormatTypeHdl, void*, void );
75};
76
78{
79private:
80 sal_Int32 mnKey;
81
84
85 std::shared_ptr<ScCondFormatDlgItem> mpDlgItem;
86
87 OUString msBaseTitle;
88
90 std::unique_ptr<weld::Button> mxBtnOk;
91 std::unique_ptr<weld::Button> mxBtnAdd;
92 std::unique_ptr<weld::Button> mxBtnRemove;
93 std::unique_ptr<weld::Button> mxBtnUp;
94 std::unique_ptr<weld::Button> mxBtnDown;
95 std::unique_ptr<weld::Button> mxBtnCancel;
96 std::unique_ptr<weld::Label> mxFtRange;
97 std::unique_ptr<formula::RefEdit> mxEdRange;
98 std::unique_ptr<formula::RefButton> mxRbRange;
99 std::unique_ptr<ScCondFormatList> mxCondFormList;
100
101 void updateTitle();
102 DECL_LINK( EdRangeModifyHdl, formula::RefEdit&, void );
103protected:
104
105 virtual void RefInputDone( bool bForced = false ) override;
106 void OkPressed();
107 void CancelPressed();
108
109public:
111 ScViewData* pViewData, const ScCondFormatDlgItem* pDlgItem);
112 virtual ~ScCondFormatDlg() override;
113
114 std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const;
115
116 virtual void SetReference(const ScRange&, ScDocument&) override;
117 virtual bool IsRefInputMode() const override;
118 virtual void SetActive() override;
119 virtual bool IsTableLocked() const override;
120 virtual void Close() override;
121
122 void InvalidateRefData();
123 void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected = true);
124
125 DECL_LINK( BtnPressedHdl, weld::Button&, void );
126 DECL_LINK( RangeGetFocusHdl, formula::RefEdit&, void );
127};
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScViewData * mpViewData
std::unique_ptr< ScConditionalFormat > GetConditionalFormat() const
std::unique_ptr< weld::Button > mxBtnCancel
std::unique_ptr< weld::Button > mxBtnRemove
std::unique_ptr< weld::Button > mxBtnDown
std::unique_ptr< weld::Label > mxFtRange
std::unique_ptr< formula::RefButton > mxRbRange
std::unique_ptr< ScCondFormatList > mxCondFormList
DECL_LINK(RangeGetFocusHdl, formula::RefEdit &, void)
std::unique_ptr< formula::RefEdit > mxEdRange
virtual void SetActive() override
virtual void RefInputDone(bool bForced=false) override
virtual bool IsTableLocked() const override
std::unique_ptr< weld::Button > mxBtnOk
std::shared_ptr< ScCondFormatDlgItem > mpDlgItem
OUString msBaseTitle
std::unique_ptr< weld::Button > mxBtnAdd
DECL_LINK(BtnPressedHdl, weld::Button &, void)
std::unique_ptr< weld::Button > mxBtnUp
DECL_LINK(EdRangeModifyHdl, formula::RefEdit &, void)
ScCondFormatDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pWindow, ScViewData *pViewData, const ScCondFormatDlgItem *pDlgItem)
virtual bool IsRefInputMode() const override
virtual void Close() override
formula::RefEdit * mpLastEdit
virtual void SetReference(const ScRange &, ScDocument &) override
virtual ~ScCondFormatDlg() override
void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected=true)
EntryContainer maEntries
DECL_LINK(AfterColFormatTypeHdl, void *, void)
DECL_LINK(DownBtnHdl, weld::Button &, void)
ScCondFormatList(ScCondFormatDlg *pParent, std::unique_ptr< weld::ScrolledWindow > xWindow, std::unique_ptr< weld::Container > xGrid)
DECL_LINK(TypeListHdl, weld::ComboBox &, void)
DECL_LINK(AddBtnHdl, weld::Button &, void)
DECL_LINK(AfterTypeListHdl, void *, void)
std::vector< std::unique_ptr< ScCondFrmtEntry > > EntryContainer
ScCondFormatDlg * mpDialogParent
weld::Window * GetFrameWeld()
ScDocument * mpDoc
DECL_LINK(UpBtnHdl, weld::Button &, void)
std::unique_ptr< weld::ScrolledWindow > mxScrollWindow
std::unique_ptr< weld::Container > mxGrid
DECL_LINK(RemoveBtnHdl, weld::Button &, void)
void init(ScDocument &rDoc, const ScConditionalFormat *pFormat, const ScRangeList &rRanges, const ScAddress &rPos, condformat::dialog::ScCondFormatDialogType eType)
std::unique_ptr< ScConditionalFormat > GetConditionalFormat() const
DECL_LINK(ColFormatTypeHdl, weld::ComboBox &, void)
void SetRange(const ScRangeList &rRange)
weld::Container * GetContainer()
DECL_LINK(EntrySelectHdl, ScCondFrmtEntry &, void)
ScRangeList maRanges