xref: /haiku/src/apps/terminal/TermWindow.h (revision 1e36cfc2721ef13a187c6f7354dc9cbc485e89d3)
1 /*
2  * Copyright 2001-2007, Haiku.
3  * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
4  * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files or portions
8  * thereof (the "Software"), to deal in the Software without restriction,
9  * including without limitation the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject
12  * to the following conditions:
13  *
14  *  * Redistributions of source code must retain the above copyright notice,
15  *    this list of conditions and the following disclaimer.
16  *
17  *  * Redistributions in binary form must reproduce the above copyright notice
18  *    in the  binary, as well as this list of conditions and the following
19  *    disclaimer in the documentation and/or other materials provided with
20  *    the distribution.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28  * THE SOFTWARE.
29  *
30  */
31 #ifndef TERMWIN_H
32 #define TERMWIN_H
33 
34 
35 #include "PrefHandler.h"
36 
37 #include <Menu.h>
38 #include <Window.h>
39 #include <MessageRunner.h>
40 #include <String.h>
41 
42 class BFont;
43 class TermView;
44 class TermParse;
45 class CodeConv;
46 class PrefWindow;
47 class FindWindow;
48 
49 
50 class TermWindow : public BWindow {
51 	public:
52 		TermWindow(BRect frame, const char* title, int gPfd);
53 		virtual ~TermWindow();
54 
55 		void			TermWinActivate();
56 
57 	protected:
58 		virtual void	MessageReceived(BMessage *message);
59 		virtual void	WindowActivated(bool);
60 		virtual void	MenusBeginning(void);
61 		virtual bool	QuitRequested();
62 
63 		status_t		GetSupportedSuites(BMessage *msg);
64 		BHandler*		ResolveSpecifier(BMessage *msg, int32 index,
65 							BMessage *specifier, int32 form,
66 							const char *property);
67 
68 	private:
69 		void			InitWindow();
70 		void			SetupMenu();
71 		int				GetTimeZone();
72 		status_t		DoPageSetup();
73 		void			DoPrint();
74 
75   /*
76    * data member
77    */
78   int		fPfd;
79   TermParse	*fTermParse;
80   BMenuBar	*fMenubar;
81   BMenu		*fFilemenu, *fEditmenu, *fEncodingmenu, *fHelpmenu, *fFontMenu, *fWindowSizeMenu, *fNewFontMenu;
82   TermView	*fTermView;
83   BView		*fBaseView;
84   CodeConv	*fCodeConv;
85   BMessage	*fPrintSettings;
86   PrefWindow	*fPrefWindow;
87   FindWindow	*fFindPanel;
88   BMessageRunner *fWindowUpdate;
89 
90   BRect		fSavedFrame;
91   window_look	fSavedLook;
92   //Saved search parameters
93   BString	fFindString;
94   BMenuItem	*fFindForwardMenuItem;
95   BMenuItem 	*fFindBackwardMenuItem;
96   bool		fFindSelection;
97   bool		fForwardSearch;
98   bool		fMatchCase;
99   bool		fMatchWord;
100 };
101 
102 #endif // TERMWIN_H
103