-
Notifications
You must be signed in to change notification settings - Fork 4
/
tibiaeditor.h
138 lines (112 loc) · 3.88 KB
/
tibiaeditor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef TIBIAEDITOR_H
#define TIBIAEDITOR_H
#include <QMainWindow>
#include <QFile>
#include <QItemSelectionModel>
#include <QUndoView>
#include <QUndoStack>
#include <QUndoCommand>
#include <QUndoGroup>
#include "undoframework.h"
#include "ui_tibiaeditor.h"
#include "spritemodel.h"
#include "tibiahandler.h"
class ItemFile;
class TibiaItem;
class ItemEditor;
class TibiaEditor : public QMainWindow
{
Q_OBJECT
public:
TibiaEditor( QWidget *parent = 0, Qt::WFlags flags = 0 );
virtual ~TibiaEditor( void );
static ItemList itemSelection( QItemSelectionModel * );
static ResourceList spriteSelection( QItemSelectionModel * );
private:
void setSelection( QAbstractItemView *itemView, const ItemList& items );
bool isFileOpened( const QWidget * ) const;
QPair<bool,bool> isOpenedClosed( const QWidget *widget );
bool isItemView( const QAbstractItemView *itemView ) const {
return ( itemView == ui->itemView || itemView == ui->outfitView || itemView == ui->effectView || itemView == ui->projectileView );
};
QList<ItemEditor *> itemEditors( void ) const;
ItemModel *itemModel;
ItemModel *outfitModel;
ItemModel *effectModel;
ItemModel *projectileModel;
SpriteModel *spriteModel;
SpriteModel *pictureModel;
QWidget *fillWidget;
QDockWidget *outputDock;
QUndoGroup *undoGroup;
QUndoStack *itemUndoStack;
QUndoStack *spriteUndoStack;
QUndoStack *pictureUndoStack;
Ui::TibiaEditorClass *ui;
protected:
virtual void closeEvent( QCloseEvent *event );
signals:
void invalidateSubWindows( void );
public slots:
// Error Slots
void onFileError( QString, QFile::FileError );
void onDocumentError( QString, QString, int );
// File Slots
void onFileNewDat( void );
void onFileNewSpr( void );
void onFileNewPic( void );
void onFileNewItem( void );
void onFileOpenDat( void );
void onFileOpenSpr( void );
void onFileOpenPic( void );
void onFileOpenItem( void );
void onFileCompileDat( void );
void onFileCompileSpr( void );
void onFileCompilePic( void );
void onFileCompileItem( void );
void onFileImport( void );
void onFileExport( void );
// File Save Slots
void onSaveStarted( void );
void onSaveComplete( void );
void onSaveSuccess( int );
// Edit Slots
void onEditInsert( void );
void onEditDelete( void );
void onEditCut( void );
void onEditCopy( void );
void onEditPaste( void );
void onEditSelectAll( void );
void onEditDeselect( void );
void onEditProperties( void );
void onEditItemProperties( void );
void onEditFind( void );
void onEditOpenItem( void );
void onEditCloseItem( void );
// UI Slots
void onFullScreen( bool );
void onTreeViewContextMenu( const QPoint& );
void onUpdateActions( const QWidget *widget );
void onFocusChanged( QWidget *, QWidget * );
// Display Slots
void onLoadItemFile( ItemFile *itemFile );
void onLoadSpriteFile( SpriteFile *spriteFile );
void onLoadPictureFile( PictureFile *pictureFile );
void onUnloadItemFile( void );
void onUnloadSpriteFile( void );
void onUnloadPictureFile( void );
void onInvalidateItems( void );
// Selection Slots
void onSelectionChanged ( const QItemSelection&, const QItemSelection& );
void onSelectItems( const ItemList&, const ItemList&, const ItemList&, const ItemList& );
// Item Change Slots
void onChangeItem( ItemFile *, TibiaItem *, PropertyList );
void onMoveItem( const QMimeData *, int, const QModelIndex& );
void onOpenItem( TibiaItem *, const ItemData& );
void onMoveSprite( const QMimeData *, int, const QModelIndex& );
void onMovePicture( const QMimeData *, int, const QModelIndex& );
// Import Slots
void onImportSprites( quint8, quint32, ResourceList );
void onImportItems( quint8, ItemList );
};
#endif // TIBIAEDITOR_H