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 __TERMWINDOW_H 32 #define __TERMWINDOW_H 33 34 35 #include <String.h> 36 #include <Window.h> 37 38 class Arguments; 39 class BFont; 40 class BMenu; 41 class BMenuBar; 42 class FindWindow; 43 class PrefWindow; 44 class TermView; 45 class SmartTabView; 46 47 48 class TermWindow : public BWindow { 49 public: 50 TermWindow(BRect frame, const char* title, Arguments *args); 51 virtual ~TermWindow(); 52 53 protected: 54 virtual void MessageReceived(BMessage *message); 55 virtual void WindowActivated(bool); 56 virtual void MenusBeginning(); 57 58 private: 59 void _SetTermColors(TermView *termView); 60 void _InitWindow(); 61 void _SetupMenu(); 62 void _GetPreferredFont(BFont &font); 63 status_t _DoPageSetup(); 64 void _DoPrint(); 65 void _AddTab(Arguments *args); 66 void _RemoveTab(int32 index); 67 TermView* _ActiveTermView(); 68 int32 _IndexOfTermView(TermView* termView) const; 69 void _CheckChildren(); 70 void _ResizeView(TermView *view); 71 void _BuildWindowSizeMenu(BMenu *menu); 72 73 SmartTabView *fTabView; 74 TermView *fTermView; 75 76 BMenuBar *fMenubar; 77 BMenu *fFilemenu; 78 BMenu *fEditmenu; 79 BMenu *fEncodingmenu; 80 BMenu *fHelpmenu; 81 BMenu *fWindowSizeMenu; 82 83 BMessage *fPrintSettings; 84 PrefWindow *fPrefWindow; 85 FindWindow *fFindPanel; 86 BRect fSavedFrame; 87 window_look fSavedLook; 88 89 // Saved search parameters 90 BString fFindString; 91 BMenuItem *fFindForwardMenuItem; 92 BMenuItem *fFindBackwardMenuItem; 93 bool fFindSelection; 94 bool fForwardSearch; 95 bool fMatchCase; 96 bool fMatchWord; 97 }; 98 99 #endif // __TERMWINDOW_H 100