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 SmartTabView; 45 class TermView; 46 class TermViewContainerView; 47 48 49 class TermWindow : public BWindow { 50 public: 51 TermWindow(BRect frame, const char* title, Arguments *args); 52 virtual ~TermWindow(); 53 54 void SetSessionWindowTitle(TermView* termView, 55 const char* title); 56 void SessionChanged(); 57 58 protected: 59 virtual void MessageReceived(BMessage *message); 60 virtual void WindowActivated(bool); 61 virtual void MenusBeginning(); 62 63 private: 64 struct Session; 65 class TabView; 66 friend class TabView; 67 68 void _SetTermColors(TermViewContainerView *termView); 69 void _InitWindow(); 70 void _SetupMenu(); 71 void _GetPreferredFont(BFont &font); 72 status_t _DoPageSetup(); 73 void _DoPrint(); 74 void _AddTab(Arguments *args); 75 void _RemoveTab(int32 index); 76 TermViewContainerView* _ActiveTermViewContainerView() const; 77 TermViewContainerView* _TermViewContainerViewAt(int32 index) const; 78 TermView* _ActiveTermView() const; 79 TermView* _TermViewAt(int32 index) const; 80 int32 _IndexOfTermView(TermView* termView) const; 81 void _CheckChildren(); 82 void _ResizeView(TermView *view); 83 void _BuildWindowSizeMenu(BMenu *menu); 84 int32 _NewSessionID(); 85 86 BString fInitialTitle; 87 BList fSessions; 88 89 TabView *fTabView; 90 TermView *fTermView; 91 92 BMenuBar *fMenubar; 93 BMenu *fFilemenu; 94 BMenu *fEditmenu; 95 BMenu *fEncodingmenu; 96 BMenu *fHelpmenu; 97 BMenu *fWindowSizeMenu; 98 99 BMessage *fPrintSettings; 100 PrefWindow *fPrefWindow; 101 FindWindow *fFindPanel; 102 BRect fSavedFrame; 103 window_look fSavedLook; 104 105 // Saved search parameters 106 BString fFindString; 107 BMenuItem *fFindForwardMenuItem; 108 BMenuItem *fFindBackwardMenuItem; 109 bool fFindSelection; 110 bool fForwardSearch; 111 bool fMatchCase; 112 bool fMatchWord; 113 }; 114 115 #endif // __TERMWINDOW_H 116