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/.
10 #ifndef SC_CONDFORMATDLG_HXX
11 #define SC_CONDFORMATDLG_HXX
13 #include <vcl/button.hxx>
14 #include <vcl/dialog.hxx>
15 #include <vcl/lstbox.hxx>
16 #include <vcl/scrbar.hxx>
17 #include <vcl/fixed.hxx>
18 #include <vcl/edit.hxx>
19 #include <svx/fntctrl.hxx>
20 #include <svtools/ctrlbox.hxx>
22 #include "rangelst.hxx"
23 #include "condformathelper.hxx"
25 #include <boost/ptr_container/ptr_vector.hpp>
26 #include <boost/scoped_ptr.hpp>
27 #include "anyrefdg.hxx"
30 class ScConditionalFormat
;
32 class ScConditionalFormat
;
33 struct ScDataBarFormatData
;
34 class ScCondFrmtEntry
;
36 namespace condformat
{
40 enum ScCondFormatDialogType
54 class ScCondFormatList
: public Control
57 typedef boost::ptr_vector
<ScCondFrmtEntry
> EntryContainer
;
58 EntryContainer maEntries
;
61 boost::scoped_ptr
<ScrollBar
> mpScrollBar
;
67 void DoScroll(long nDiff
);
70 ScCondFormatList( Window
* pParent
, const ResId
& rResId
, ScDocument
* pDoc
, const ScConditionalFormat
* pFormat
,
71 const ScRangeList
& rRanges
, const ScAddress
& rPos
, condformat::dialog::ScCondFormatDialogType eType
);
73 ScConditionalFormat
* GetConditionalFormat() const;
76 DECL_LINK( AddBtnHdl
, void* );
77 DECL_LINK( RemoveBtnHdl
, void* );
78 DECL_LINK( ScrollHdl
, void* );
79 DECL_LINK( EntrySelectHdl
, ScCondFrmtEntry
* );
81 DECL_LINK( TypeListHdl
, ListBox
*);
82 DECL_LINK( ColFormatTypeHdl
, ListBox
*);
85 class ScCondFormatDlg
: public ScAnyRefModalDlg
89 PushButton maBtnRemove
;
91 formula::RefEdit maEdRange
;
92 formula::RefButton maRbRange
;
94 CancelButton maBtnCancel
;
96 ScCondFormatList maCondFormList
;
101 formula::RefEdit
* mpLastEdit
;
103 DECL_LINK( EdRangeModifyHdl
, Edit
* );
106 virtual void RefInputDone( sal_Bool bForced
= false );
110 SC_DLLPUBLIC
ScCondFormatDlg(Window
* pWindow
, ScDocument
* pDoc
, const ScConditionalFormat
* pFormat
,
111 const ScRangeList
& rRange
, const ScAddress
& rPos
, condformat::dialog::ScCondFormatDialogType eType
);
112 virtual ~ScCondFormatDlg();
114 SC_DLLPUBLIC ScConditionalFormat
* GetConditionalFormat() const;
116 virtual void SetReference(const ScRange
&, ScDocument
*);
117 virtual sal_Bool
IsRefInputMode() const;
118 virtual void SetActive();
119 virtual sal_Bool
IsTableLocked() const;
121 void InvalidateRefData();
123 DECL_LINK( RangeGetFocusHdl
, formula::RefEdit
* );
124 DECL_LINK( RangeLoseFocusHdl
, void* );
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */