Line data Source code
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 : #include "sc.hrc"
11 :
12 : #include <vcl/dialog.hxx>
13 : #include <svtools/svtabbx.hxx>
14 : #include <vcl/button.hxx>
15 : #include <vcl/fixed.hxx>
16 : #include <svtools/headbar.hxx>
17 :
18 : #include "conditio.hxx"
19 :
20 : #include <map>
21 :
22 : class ScDocument;
23 :
24 0 : class ScCondFormatManagerWindow : public SvTabListBox
25 : {
26 : private:
27 : void Init();
28 : String createEntryString(const ScConditionalFormat& rFormat);
29 :
30 : HeaderBar maHeaderBar;
31 : ScDocument* mpDoc;
32 : ScConditionalFormatList* mpFormatList;
33 : std::map<SvTreeListEntry*, sal_Int32> maMapLBoxEntryToCondIndex;
34 :
35 : DECL_LINK( HeaderEndDragHdl, void* );
36 :
37 : public:
38 : ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList );
39 :
40 : void DeleteSelection();
41 : ScConditionalFormat* GetSelection();
42 : void Update();
43 : };
44 :
45 0 : class ScCondFormatManagerCtrl : Control
46 : {
47 : public:
48 : ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList);
49 :
50 : ScConditionalFormat* GetSelection();
51 : void DeleteSelection();
52 : void Update();
53 0 : ScCondFormatManagerWindow &GetListControl() { return maWdManager; }
54 :
55 : private:
56 : ScCondFormatManagerWindow maWdManager;
57 : };
58 :
59 : class ScCondFormatManagerDlg : public ModalDialog
60 : {
61 : public:
62 : ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos);
63 : ~ScCondFormatManagerDlg();
64 :
65 : ScConditionalFormatList* GetConditionalFormatList();
66 :
67 : bool CondFormatsChanged();
68 :
69 : virtual bool IsInRefMode() const;
70 :
71 : private:
72 : PushButton maBtnAdd;
73 : PushButton maBtnRemove;
74 : PushButton maBtnEdit;
75 :
76 : OKButton maBtnOk;
77 : CancelButton maBtnCancel;
78 :
79 : FixedLine maFlLine;
80 :
81 : ScConditionalFormatList* mpFormatList;
82 :
83 : ScCondFormatManagerCtrl maCtrlManager;
84 :
85 : ScDocument* mpDoc;
86 : ScAddress maPos;
87 :
88 : DECL_LINK(RemoveBtnHdl, void*);
89 : DECL_LINK(EditBtnHdl, void*);
90 : DECL_LINK(AddBtnHdl, void*);
91 :
92 : bool mbModified;
93 : };
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|