Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / condformatmgr.hxx
blobee68af959c88698baddc587f4eae78a5f4fb58cf
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 SC_CONDFORMATMGR_HXX
11 #define SC_CONDFORMATMGR_HXX
13 #include "sc.hrc"
15 #include <vcl/dialog.hxx>
16 #include <svtools/svtabbx.hxx>
17 #include <vcl/button.hxx>
18 #include <vcl/fixed.hxx>
19 #include <svtools/headbar.hxx>
21 #include "conditio.hxx"
23 #include <map>
25 class ScDocument;
27 class ScCondFormatManagerWindow : public SvTabListBox
29 private:
30 void Init();
31 OUString createEntryString(const ScConditionalFormat& rFormat);
33 HeaderBar maHeaderBar;
34 ScDocument* mpDoc;
35 ScConditionalFormatList* mpFormatList;
36 std::map<SvTreeListEntry*, sal_Int32> maMapLBoxEntryToCondIndex;
38 DECL_LINK( HeaderEndDragHdl, void* );
40 public:
41 ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList );
43 void DeleteSelection();
44 ScConditionalFormat* GetSelection();
45 void Update();
48 class ScCondFormatManagerCtrl : Control
50 public:
51 ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList);
53 ScConditionalFormat* GetSelection();
54 void DeleteSelection();
55 void Update();
56 ScCondFormatManagerWindow &GetListControl() { return maWdManager; }
58 private:
59 ScCondFormatManagerWindow maWdManager;
62 class ScCondFormatManagerDlg : public ModalDialog
64 public:
65 ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos);
66 ~ScCondFormatManagerDlg();
68 ScConditionalFormatList* GetConditionalFormatList();
70 bool CondFormatsChanged();
72 virtual bool IsInRefMode() const;
74 private:
75 PushButton maBtnAdd;
76 PushButton maBtnRemove;
77 PushButton maBtnEdit;
79 OKButton maBtnOk;
80 CancelButton maBtnCancel;
82 FixedLine maFlLine;
84 ScConditionalFormatList* mpFormatList;
86 ScCondFormatManagerCtrl maCtrlManager;
88 ScDocument* mpDoc;
89 ScAddress maPos;
91 DECL_LINK(RemoveBtnHdl, void*);
92 DECL_LINK(EditBtnHdl, void*);
93 DECL_LINK(AddBtnHdl, void*);
95 bool mbModified;
98 #endif
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */