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);
48 // Stuff that needs implementation
50 void UpdateAllViews(void *, int, void *) { /* SORRY, NOTHING */ }
58 virtual CFile * GetFile(const char * fileName, unsigned int openFlags, CFileException * error);
61 virtual bool DoSave(const char * pathName, bool replace = TRUE);
63 // ClassWizard generated virtual function overrides
64 //{{AFX_VIRTUAL(MapDoc)
66 virtual bool OnNewDocument();
67 virtual void ReportSaveLoadException(const char * lpszPathName, CException * e, bool bSaving, unsigned int nIDPDefault);
68 virtual void Serialize(CArchive & ar);
71 void DeleteContents(void);
74 void getGridRect(QRect & rect);
75 void getGridSize(QSize & size);
76 void setUndoData(UndoRec * newUndo);
77 int addCorner(RoomNum r, int e);
78 void addEdge(const MapEdge & newEdge);
80 void deleteCorner(RoomNum r);
81 void deleteEdge(int n);
82 int findEdge(RoomNum n, RoomCorner corner, MapEdge & newEdge) const;
83 int findOtherEnd(EdgeConstItr start, RoomNumVec * cornerRooms = NULL) const;
84 int findOtherEnd(int n) const;
85 void getEdgePoints(const MapEdge & e, QPoint & p1, QPoint & p2) const;
86 void getEdgePoints(int n, QPoint & p1, QPoint & p2) const;
87 void getEdgeRect(const MapEdge & e, QRect & r) const;
88 void addPage(int n, const MapPage & newPage);
90 void addPages(const PageVec & newPages);
91 void deletePage(int n);
92 QRect getPageRect(int p);
93 QRect getPageRect(const MapPage & p);
95 void movePage(int n, const QSize & offset);
96 bool needRepaginate();
97 int pageBorderHit(const QPoint & pos);
99 int addRoom(const QPoint & pos);
100 void addRoom(int n, MapRoom * newRoom);
101 void addRooms(int n);
102 MapRoom * extractRoom(int n);
103 void deleteRoom(int n);
104 int findRoom(const QPoint & pos) const;
105 void moveRoom(int n, const QSize & offset);
106 int roomHit(const QPoint & pos, RoomCorner * corner = NULL);
107 RoomCorner CornerHit(const QPoint & pos);
108 void setName(const char * newName);
109 void setNote(const char * newNote);
110 void setRoomFlags(int n, RoomFlags set, RoomFlags clear = 0);
111 void setRoomName(int n, const char * newName);
112 void setRoomNote(int n, const char * newNote);
113 void shortestPath(string & path, RoomNum start, RoomNum end) const;
116 // Generated message map functions
119 afx_msg void OnNavigationMode();
120 // afx_msg void OnEditUndo();
121 afx_msg void OnFileExport();
122 // afx_msg void OnUpdateEditUndo(CCmdUI * pCmdUI);
123 afx_msg void OnUpdateNavigationMode(CCmdUI * pCmdUI);
124 afx_msg void OnEditMoveMap(unsigned int cmd);
125 afx_msg void OnUpdateEditMoveMap(CCmdUI * pCmdUI);
139 RoomScrap(const MapDoc & doc, int numSelected, const ByteVec & selectedRooms, int numSelectedPages, const ByteVec & selectedPages);
141 UndoRec * paste(MapDoc & doc) const;
145 #endif // __MAPDOC_H__