fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / condformatdlg.hxx
blob5d8391c0cd1735e409c3a8d833dd57a5713db798
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLG_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_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"
24 #include "viewdata.hxx"
26 #include "anyrefdg.hxx"
28 #define DLG_RET_ADD 8
29 #define DLG_RET_EDIT 16
31 class ScDocument;
32 class ScConditionalFormat;
33 class ScFormatEntry;
34 class ScConditionalFormat;
35 struct ScDataBarFormatData;
36 class ScCondFrmtEntry;
38 namespace condformat {
40 namespace dialog {
42 enum ScCondFormatDialogType
44 NONE,
45 CONDITION,
46 COLORSCALE,
47 DATABAR,
48 ICONSET,
49 DATE
56 class ScCondFormatDlg;
58 class ScCondFormatList : public Control
60 private:
61 typedef std::vector<VclPtr<ScCondFrmtEntry>> EntryContainer;
62 EntryContainer maEntries;
64 bool mbHasScrollBar;
65 VclPtr<ScrollBar> mpScrollBar;
67 ScDocument* mpDoc;
68 ScAddress maPos;
69 ScRangeList maRanges;
70 VclPtr<ScCondFormatDlg> mpDialogParent;
72 void DoScroll(long nDiff);
74 public:
75 ScCondFormatList(vcl::Window* pParent, WinBits nStyle);
76 virtual ~ScCondFormatList();
77 virtual void dispose() SAL_OVERRIDE;
79 void init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScConditionalFormat* pFormat,
80 const ScRangeList& rRanges, const ScAddress& rPos,
81 condformat::dialog::ScCondFormatDialogType eType);
83 virtual Size GetOptimalSize() const SAL_OVERRIDE;
84 virtual void Resize() SAL_OVERRIDE;
86 ScConditionalFormat* GetConditionalFormat() const;
87 void RecalcAll();
89 DECL_LINK( AddBtnHdl, void* );
90 DECL_LINK( RemoveBtnHdl, void* );
91 DECL_LINK( ScrollHdl, void* );
92 DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* );
94 DECL_LINK( TypeListHdl, ListBox*);
95 DECL_LINK( AfterTypeListHdl, ListBox*);
96 DECL_LINK( ColFormatTypeHdl, ListBox*);
99 class ScCondFormatDlg : public ScAnyRefDlg
101 private:
102 VclPtr<PushButton> mpBtnOk;
103 VclPtr<PushButton> mpBtnAdd;
104 VclPtr<PushButton> mpBtnRemove;
105 VclPtr<PushButton> mpBtnCancel;
106 VclPtr<FixedText> mpFtRange;
107 VclPtr<formula::RefEdit> mpEdRange;
108 VclPtr<formula::RefButton> mpRbRange;
110 VclPtr<ScCondFormatList> mpCondFormList;
111 sal_Int32 maKey;
113 bool mbManaged;
114 ScAddress maPos;
115 ScViewData* mpViewData;
117 VclPtr<formula::RefEdit> mpLastEdit;
119 DECL_LINK( EdRangeModifyHdl, Edit* );
120 protected:
122 virtual void RefInputDone( bool bForced = false ) SAL_OVERRIDE;
123 void OkPressed();
124 void CancelPressed();
126 public:
127 SC_DLLPUBLIC ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pWindow,
128 ScViewData* pViewData, const ScConditionalFormat* pFormat,
129 const ScRangeList& rRange, const ScAddress& rPos,
130 condformat::dialog::ScCondFormatDialogType eType, bool bManaged);
131 virtual ~ScCondFormatDlg();
132 virtual void dispose() SAL_OVERRIDE;
134 SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const;
136 static OUString GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, bool bManaged);
137 static bool ParseXmlString(const OUString& sXMLString, sal_uInt32& nIndex,
138 sal_uInt8& nType, bool& bManaged);
139 virtual void SetReference(const ScRange&, ScDocument*) SAL_OVERRIDE;
140 virtual bool IsRefInputMode() const SAL_OVERRIDE;
141 virtual void SetActive() SAL_OVERRIDE;
142 virtual bool IsTableLocked() const SAL_OVERRIDE;
143 virtual bool Close() SAL_OVERRIDE;
145 void InvalidateRefData();
147 DECL_LINK( BtnPressedHdl, Button* );
148 DECL_LINK( RangeGetFocusHdl, formula::RefEdit* );
149 DECL_STATIC_LINK( ScCondFormatDlg, RangeLoseFocusHdl, void* );
152 #endif
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */