3 // (C) 1997-2007 by Christopher J. Madsen
4 // (C) 2019 James Hammons
6 // GUEmap is licensed under either version 2 of the GPL, or (at your option)
7 // any later version. See LICENSE file for details.
9 // mapdoc.h: interface of the MapDoc class
22 dupNavigationMode = 2,
26 extern const RoomCorner oppositeCorner[rcNumCorners];
28 const QSize defaultRoomSize(roomWidth, roomHeight);
50 // Stuff that needs implementation
52 void UpdateAllViews(void *, int, void *) { /* SORRY, NOTHING */ }
60 virtual CFile * GetFile(const char * fileName, unsigned int openFlags, CFileException * error);
63 virtual bool DoSave(const char * pathName, bool replace = TRUE);
65 // ClassWizard generated virtual function overrides
66 //{{AFX_VIRTUAL(MapDoc)
68 virtual bool OnNewDocument();
69 virtual void ReportSaveLoadException(const char * lpszPathName, CException * e, bool bSaving, unsigned int nIDPDefault);
70 virtual void Serialize(CArchive & ar);
73 void DeleteContents(void);
76 void getGridRect(QRect & rect);
77 void getGridSize(QSize & size);
78 void setUndoData(UndoRec * newUndo);
79 int addCorner(RoomNum r, int e);
80 void addEdge(const MapEdge & newEdge);
82 void deleteCorner(RoomNum r);
83 void deleteEdge(int n);
84 int findEdge(RoomNum n, RoomCorner corner, MapEdge & newEdge) const;
85 int findOtherEnd(EdgeConstItr start, RoomNumVec * cornerRooms = NULL) const;
86 int findOtherEnd(int n) const;
87 void getEdgePoints(const MapEdge & e, QPoint & p1, QPoint & p2) const;
88 void getEdgePoints(int n, QPoint & p1, QPoint & p2) const;
89 void getEdgeRect(const MapEdge & e, QRect & r) const;
90 void addPage(int n, const MapPage & newPage);
92 void addPages(const PageVec & newPages);
93 void deletePage(int n);
94 QRect getPageRect(int p);
95 QRect getPageRect(const MapPage & p);
97 void movePage(int n, const QSize & offset);
98 bool needRepaginate();
99 int pageBorderHit(const QPoint & pos);
101 int addRoom(const QPoint & pos);
102 void addRoom(int n, MapRoom * newRoom);
103 void addRooms(int n);
104 MapRoom * extractRoom(int n);
105 void deleteRoom(int n);
106 int findRoom(const QPoint & pos) const;
107 void moveRoom(int n, const QSize & offset);
108 int roomHit(const QPoint & pos, RoomCorner * corner = NULL);
109 RoomCorner CornerHit(const QPoint & pos);
110 void setName(const char * newName);
111 void setNote(const char * newNote);
112 void setRoomFlags(int n, RoomFlags set, RoomFlags clear = 0);
113 void setRoomName(int n, const char * newName);
114 void setRoomNote(int n, const char * newNote);
115 void shortestPath(string & path, RoomNum start, RoomNum end) const;
118 // Generated message map functions
121 afx_msg void OnNavigationMode();
122 // afx_msg void OnEditUndo();
123 afx_msg void OnFileExport();
124 // afx_msg void OnUpdateEditUndo(CCmdUI * pCmdUI);
125 afx_msg void OnUpdateNavigationMode(CCmdUI * pCmdUI);
126 afx_msg void OnEditMoveMap(unsigned int cmd);
127 afx_msg void OnUpdateEditMoveMap(CCmdUI * pCmdUI);
142 RoomScrap(const MapDoc & doc, int numSelected, const ByteVec & selectedRooms, int numSelectedPages, const ByteVec & selectedPages);
144 UndoRec * paste(MapDoc & doc) const;
148 #endif // __MAPDOC_H__