Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : : *
5 : : * The contents of this file are subject to the Mozilla Public License Version
6 : : * 1.1 (the "License"); you may not use this file except in compliance with
7 : : * the License or as specified alternatively below. You may obtain a copy of
8 : : * the License at http://www.mozilla.org/MPL/
9 : : *
10 : : * Software distributed under the License is distributed on an "AS IS" basis,
11 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : : * for the specific language governing rights and limitations under the
13 : : * License.
14 : : *
15 : : * Major Contributor(s):
16 : : * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
17 : : *
18 : : * All Rights Reserved.
19 : : *
20 : : * For minor contributions see the git repository.
21 : : *
22 : : * Alternatively, the contents of this file may be used under the terms of
23 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : : * instead of those above.
27 : : */
28 : :
29 : : #include "sc.hrc"
30 : :
31 : : #include <vcl/dialog.hxx>
32 : : #include <svtools/svtabbx.hxx>
33 : : #include <vcl/button.hxx>
34 : : #include <vcl/fixed.hxx>
35 : : #include <svtools/headbar.hxx>
36 : :
37 : : #include "conditio.hxx"
38 : : #include "rangelst.hxx"
39 : : #include "document.hxx"
40 : :
41 : : #include <map>
42 : :
43 : : class ScDocument;
44 : :
45 : 0 : class ScCondFormatManagerWindow : public SvTabListBox
46 : : {
47 : : private:
48 : : void Init();
49 : : String createEntryString(const ScConditionalFormat& rFormat);
50 : :
51 : : HeaderBar maHeaderBar;
52 : : ScDocument* mpDoc;
53 : : ScConditionalFormatList* mpFormatList;
54 : : const ScAddress& mrPos;
55 : : std::map<SvLBoxEntry*, sal_Int32> maMapLBoxEntryToCondIndex;
56 : :
57 : : DECL_LINK( HeaderEndDragHdl, void* );
58 : :
59 : : public:
60 : : ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos );
61 : :
62 : : void DeleteSelection();
63 : : ScConditionalFormat* GetSelection();
64 : : void Update();
65 : : };
66 : :
67 : 0 : class ScCondFormatManagerCtrl : Control
68 : : {
69 : : public:
70 : : ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos);
71 : :
72 : : ScConditionalFormat* GetSelection();
73 : : void DeleteSelection();
74 : : void Update();
75 : :
76 : : private:
77 : : ScCondFormatManagerWindow maWdManager;
78 : : };
79 : :
80 : : class ScCondFormatManagerDlg : public ModalDialog
81 : : {
82 : : public:
83 : : ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScRangeList& rList, const ScAddress& rPos);
84 : : ~ScCondFormatManagerDlg();
85 : :
86 : : ScConditionalFormatList* GetConditionalFormatList();
87 : :
88 : : private:
89 : : PushButton maBtnAdd;
90 : : PushButton maBtnRemove;
91 : : PushButton maBtnEdit;
92 : :
93 : : OKButton maBtnOk;
94 : : CancelButton maBtnCancel;
95 : :
96 : : FixedLine maFlLine;
97 : :
98 : : ScConditionalFormatList* mpFormatList;
99 : :
100 : : ScCondFormatManagerCtrl maCtrlManager;
101 : :
102 : : ScDocument* mpDoc;
103 : : const ScRangeList& mrRangeList;
104 : : ScAddress maPos;
105 : :
106 : : DECL_LINK(RemoveBtnHdl, void*);
107 : : DECL_LINK(EditBtnHdl, void*);
108 : : };
109 : :
110 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|