1 /*
2  Copyright (C) 2010-2014 Kristian Duske
3 
4  This file is part of TrenchBroom.
5 
6  TrenchBroom is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  TrenchBroom is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef TrenchBroom_IssueBrowser
21 #define TrenchBroom_IssueBrowser
22 
23 #include "Model/ModelTypes.h"
24 #include "View/ViewTypes.h"
25 #include "View/TabBook.h"
26 
27 class wxCheckBox;
28 class wxCommandEvent;
29 class wxMouseEvent;
30 class wxSimplebook;
31 class wxSizeEvent;
32 class wxWindow;
33 
34 namespace TrenchBroom {
35     namespace Model {
36         class Issue;
37     }
38 
39     namespace View {
40         class FlagChangedCommand;
41         class FlagsPopupEditor;
42         class IssueBrowserView;
43 
44         class IssueBrowser : public TabBookPage {
45         private:
46             static const int SelectObjectsCommandId = 1;
47             static const int ShowIssuesCommandId = 2;
48             static const int HideIssuesCommandId = 3;
49             static const int FixObjectsBaseId = 4;
50 
51             MapDocumentWPtr m_document;
52             IssueBrowserView* m_view;
53             wxCheckBox* m_showHiddenIssuesCheckBox;
54             FlagsPopupEditor* m_filterEditor;
55         public:
56             IssueBrowser(wxWindow* parent, MapDocumentWPtr document);
57             ~IssueBrowser();
58 
59             wxWindow* createTabBarPage(wxWindow* parent);
60 
61             void OnShowHiddenIssuesChanged(wxCommandEvent& event);
62             void OnFilterChanged(FlagChangedCommand& command);
63         private:
64             void bindObservers();
65             void unbindObservers();
66             void documentWasNewedOrLoaded(MapDocument* document);
67             void documentWasSaved(MapDocument* document);
68             void nodesWereAdded(const Model::NodeList& nodes);
69             void nodesWereRemoved(const Model::NodeList& nodes);
70             void nodesDidChange(const Model::NodeList& nodes);
71             void brushFacesDidChange(const Model::BrushFaceList& faces);
72             void issueIgnoreChanged(Model::Issue* issue);
73 
74             void updateFilterFlags();
75         };
76     }
77 }
78 
79 #endif /* defined(TrenchBroom_IssueBrowser) */
80