1 /*
2  * objectsdock.h
3  * Copyright 2012, Tim Baker <treectrl@hotmail.com>
4  *
5  * This file is part of Tiled.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 
23 #include <QDockWidget>
24 #include <QMap>
25 
26 class QMenu;
27 
28 namespace Tiled {
29 
30 class Document;
31 class FilterEdit;
32 class MapDocument;
33 class ObjectsView;
34 
35 class ObjectsDock : public QDockWidget
36 {
37     Q_OBJECT
38 
39 public:
40     ObjectsDock(QWidget *parent = nullptr);
41 
42     void setMapDocument(MapDocument *mapDoc);
43 
44 protected:
45     void changeEvent(QEvent *e) override;
46 
47 private:
48     void updateActions();
49     void aboutToShowMoveToMenu();
50     void triggeredMoveToMenu(QAction *action);
51     void objectProperties();
52     void documentAboutToClose(Document *document);
53     void moveObjectsUp();
54     void moveObjectsDown();
55 
56     void retranslateUi();
57 
58     QAction *mActionNewLayer;
59     QAction *mActionObjectProperties;
60     QAction *mActionMoveToGroup;
61     QAction *mActionMoveUp;
62     QAction *mActionMoveDown;
63 
64     FilterEdit *mFilterEdit;
65     ObjectsView *mObjectsView;
66     MapDocument *mMapDocument;
67     QMenu *mMoveToMenu;
68 };
69 
70 } // namespace Tiled
71