]> Shamusworld >> Repos - guemap/blob - src/guemapapp.h
Initial commit of GUEmap v3.
[guemap] / src / guemapapp.h
1 //
2 // GUEmap
3 // Copyright 1997-2007 by Christopher J. Madsen
4 // (C) 2019 James Hammons
5 //
6 // GUEmap is licensed under either version 2 of the GPL, or (at your option)
7 // any later version.  See LICENSE file for details.
8 //
9 // GUEmap.h: main header file for the GUEmap application
10 //
11
12 #ifndef __GUEMAPAPP_H__
13 #define __GUEMAPAPP_H__
14
15 #include <QtWidgets>
16
17 // Forward declarations
18 //class CharWindow;
19 class MainWin;
20
21 class GUEMapApp: public QApplication
22 {
23         public:
24                 GUEMapApp(int & argc, char * argv[]);
25
26         public:
27 //              CharWindow * charWnd;
28                 MainWin * mainWindow;
29 };
30
31
32 //#ifndef __AFXWIN_H__
33 //      #error include 'stdafx.h' before including this file for PCH
34 //#endif
35
36 //#include "resource.h"       // main symbols
37
38 /////////////////////////////////////////////////////////////////////////////
39 // Miscellaneous functions:
40 #if 0
41 void copyToOneLine(String & dest, const String & source);
42 void fillParagraphs(String & s);
43 void trimLeft(String & s);
44 void trimRight(String & s);
45
46 /////////////////////////////////////////////////////////////////////////////
47 // CMapApp:
48 // See GUEmap.cpp for the implementation of this class
49 //
50
51 class CAboutDlg;
52 class CCommentDlg;
53 class CFindDlg;
54 class CMapView;
55 class MapRoom;
56 class RoomScrap;
57
58 extern bool GUEmapEatClicks;
59 extern const char * const iniMainWin;
60 extern HCURSOR handCursor;
61 extern String mapWinClass;
62
63 class CMapApp: public CWinApp
64 {
65         protected:
66                 bool autoEdit;
67                 bool preferUnexplored;
68                 bool initialized;
69                 bool naviCopy;
70                 bool naviCRLF;
71                 CString username;
72                 CString password;
73                 RoomScrap * clipboard;
74                 CCommentDlg * commentDlg;
75                 CFindDlg * findDlg;
76
77         public:
78                 CMapApp();
79                 ~CMapApp();
80
81                 void adjustCommentPos(LPCRECT r);
82                 void closingView(const CMapView * view);
83                 void editComment();
84                 void editOptions();
85                 const RoomScrap * getClipboard() const { return clipboard; };
86                 void loadWindowPos(CRect & pos, LPCTSTR section);
87                 bool navigationCopy() const { return naviCopy; };
88                 bool navigationCRLF() const { return naviCRLF; };
89                 bool editAfterAdd()   const { return autoEdit; };
90                 bool stub1Unexplored()const { return preferUnexplored; };
91                 void saveWindowPos(LPCRECT pos, LPCTSTR section);
92                 void setClipboard(RoomScrap * newScrap);
93                 void setComment(CMapView * fromView, const MapRoom * room,
94                         bool takeFocus=true) const;
95                 void setLandscape();
96                 void setupAbout(CAboutDlg & dlg) const;
97
98         // Overrides
99         // ClassWizard generated virtual function overrides
100         //{{AFX_VIRTUAL(CMapApp)
101         public:
102                 virtual BOOL InitInstance();
103                 virtual int ExitInstance();
104         //}}AFX_VIRTUAL
105
106   // Implementation
107
108         //{{AFX_MSG(CMapApp)
109                 void OnAppAbout();
110                 void OnEditFind();
111                 void OnUpdateViewComments(CCmdUI* pCmdUI);
112                 void OnViewComments();
113                 void OnViewSettings();
114         //}}AFX_MSG
115
116         DECLARE_MESSAGE_MAP();
117 };
118
119 inline CMapApp * gueApp() { return static_cast<CMapApp *>(AfxGetApp()); }
120 #endif
121
122 #endif  // __GUEMAP_H__
123