bump product version to 4.1.6.2
[LibreOffice.git] / sc / source / ui / inc / condformatdlgentry.hxx
blob77054ab06a2123391efdfea6e3ed6d1cf035b825
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 #include "colorscale.hxx"
11 #include "conditio.hxx"
12 #include <formula/funcutl.hxx>
14 #include <svl/lstner.hxx>
16 class ScIconSetFrmtDataEntry;
18 namespace condformat {
20 namespace entry {
22 enum ScCondFrmtEntryType
24 CONDITION,
25 FORMULA,
26 COLORSCALE2,
27 COLORSCALE3,
28 DATABAR,
29 ICONSET,
30 DATE
37 class ScCondFrmtEntry : public Control
39 private:
40 bool mbActive;
42 Link maClickHdl;
44 //general ui elements
45 FixedText maFtCondNr;
46 FixedText maFtCondition;
48 sal_Int32 mnIndex;
49 OUString maStrCondition;
50 protected:
51 ListBox maLbType;
53 ScDocument* mpDoc;
54 ScAddress maPos;
56 DECL_LINK( EdModifyHdl, Edit* );
58 void Select();
59 void Deselect();
61 virtual OUString GetExpressionString() = 0;
63 public:
64 ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos );
65 virtual ~ScCondFrmtEntry();
67 virtual long Notify( NotifyEvent& rNEvt );
69 bool IsSelected() const;
70 void SetIndex(sal_Int32 nIndex);
71 sal_Int32 GetIndex() const { return mnIndex; }
72 void SetHeight();
74 virtual ScFormatEntry* GetEntry() const = 0;
75 virtual void SetActive() = 0;
76 virtual void SetInactive() = 0;
78 virtual condformat::entry::ScCondFrmtEntryType GetType() = 0;
81 class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener
83 //cond format ui elements
84 ListBox maLbCondType;
85 formula::RefEdit maEdVal1;
86 formula::RefEdit maEdVal2;
87 FixedText maFtStyle;
88 ListBox maLbStyle;
89 SvxFontPrevWindow maWdPreview;
90 bool mbIsInStyleCreate;
92 ScFormatEntry* createConditionEntry() const;
94 virtual OUString GetExpressionString();
95 void Init();
96 DECL_LINK( StyleSelectHdl, void* );
97 DECL_LINK( ConditionTypeSelectHdl, void* );
99 public:
100 ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
102 virtual ScFormatEntry* GetEntry() const;
103 virtual void SetActive();
104 virtual void SetInactive();
106 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
107 using ScCondFrmtEntry::Notify;
109 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::CONDITION; }
112 class ScFormulaFrmtEntry : public ScCondFrmtEntry
114 FixedText maFtStyle;
115 ListBox maLbStyle;
116 SvxFontPrevWindow maWdPreview;
117 formula::RefEdit maEdFormula;
119 ScFormatEntry* createFormulaEntry() const;
120 virtual OUString GetExpressionString();
121 void Init();
123 DECL_LINK( StyleSelectHdl, void* );
125 public:
126 ScFormulaFrmtEntry( Window* pParent, ScDocument* PDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
128 virtual ScFormatEntry* GetEntry() const;
129 virtual void SetActive();
130 virtual void SetInactive();
131 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::FORMULA; }
134 class ScColorScale2FrmtEntry : public ScCondFrmtEntry
137 //color format ui elements
138 ListBox maLbColorFormat;
140 //color scale ui elements
141 ListBox maLbEntryTypeMin;
142 ListBox maLbEntryTypeMax;
144 Edit maEdMin;
145 Edit maEdMax;
147 ColorListBox maLbColMin;
148 ColorListBox maLbColMax;
150 ScFormatEntry* createColorscaleEntry() const;
152 virtual OUString GetExpressionString();
153 void Init();
155 DECL_LINK( EntryTypeHdl, ListBox* );
156 public:
157 ScColorScale2FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
158 virtual ScFormatEntry* GetEntry() const;
159 virtual void SetActive();
160 virtual void SetInactive();
161 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::COLORSCALE2; }
164 class ScColorScale3FrmtEntry : public ScCondFrmtEntry
167 //color format ui elements
168 ListBox maLbColorFormat;
170 //color scale ui elements
171 ListBox maLbEntryTypeMin;
172 ListBox maLbEntryTypeMiddle;
173 ListBox maLbEntryTypeMax;
175 Edit maEdMin;
176 Edit maEdMiddle;
177 Edit maEdMax;
179 ColorListBox maLbColMin;
180 ColorListBox maLbColMiddle;
181 ColorListBox maLbColMax;
183 ScFormatEntry* createColorscaleEntry() const;
185 virtual OUString GetExpressionString();
186 void Init();
188 DECL_LINK( EntryTypeHdl, ListBox* );
189 public:
190 ScColorScale3FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
191 virtual ScFormatEntry* GetEntry() const;
192 virtual void SetActive();
193 virtual void SetInactive();
194 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::COLORSCALE3; }
197 class ScDataBarFrmtEntry : public ScCondFrmtEntry
199 //color format ui elements
200 ListBox maLbColorFormat;
202 //data bar ui elements
203 ListBox maLbDataBarMinType;
204 ListBox maLbDataBarMaxType;
205 Edit maEdDataBarMin;
206 Edit maEdDataBarMax;
208 PushButton maBtOptions;
210 boost::scoped_ptr<ScDataBarFormatData> mpDataBarData;
212 ScFormatEntry* createDatabarEntry() const;
214 virtual OUString GetExpressionString();
215 void Init();
217 DECL_LINK( OptionBtnHdl, void* );
218 DECL_LINK( DataBarTypeSelectHdl, void* );
219 public:
220 ScDataBarFrmtEntry( Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL );
221 virtual ScFormatEntry* GetEntry() const;
222 virtual void SetActive();
223 virtual void SetInactive();
225 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::DATABAR; }
228 class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener
230 public:
231 ScDateFrmtEntry( Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = NULL );
232 virtual ScFormatEntry* GetEntry() const;
233 virtual void SetActive();
234 virtual void SetInactive();
235 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::DATE; }
237 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
238 using ScCondFrmtEntry::Notify;
239 protected:
240 virtual OUString GetExpressionString();
242 private:
243 void Init();
245 DECL_LINK( StyleSelectHdl, void* );
247 ListBox maLbDateEntry;
248 FixedText maFtStyle;
249 ListBox maLbStyle;
250 SvxFontPrevWindow maWdPreview;
252 bool mbIsInStyleCreate;
255 class ScIconSetFrmtEntry : public ScCondFrmtEntry
257 //color format ui elements
258 ListBox maLbColorFormat;
260 // icon set ui elements
261 ListBox maLbIconSetType;
263 typedef boost::ptr_vector<ScIconSetFrmtDataEntry> ScIconSetFrmtDataEntriesType;
264 ScIconSetFrmtDataEntriesType maEntries;
266 virtual OUString GetExpressionString();
268 void Init();
270 DECL_LINK( IconSetTypeHdl, void* );
272 public:
273 ScIconSetFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = NULL );
274 virtual ScFormatEntry* GetEntry() const;
275 virtual void SetActive();
276 virtual void SetInactive();
277 virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::ICONSET; }
280 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */