TCP: Fixed RTO update and dup ACKs generation.
[haiku.git] / src / apps / poorman / PoorManWindow.h
blob20367ec78e9be7552e215897f79ac32a4895c775
1 /* PoorManWindow.h
3 * Philip Harrison
4 * Started: 4/25/2004
5 * Version: 0.1
6 */
8 #ifndef POOR_MAN_WINDOW_H
9 #define POOR_MAN_WINDOW_H
11 #include <pthread.h>
13 #include <SupportDefs.h>
14 #include <Window.h>
15 #include <String.h>
17 class BPoint;
18 class BFilePanel;
19 class BMessage;
20 class BMenuBar;
21 class BMenu;
22 class BTextView;
23 class BStringView;
24 class BScrollView;
25 class BRect;
26 class BFile;
27 class BFont;
29 class PoorManView;
30 class PoorManPreferencesWindow;
31 class PoorManServer;
33 class PoorManWindow: public BWindow
35 public:
36 PoorManWindow(BRect frame);
37 virtual ~PoorManWindow();
38 virtual void MessageReceived(BMessage* message);
40 virtual void FrameMoved(BPoint origin);
41 virtual void FrameResized(float width, float height);
42 virtual bool QuitRequested();
43 virtual void Zoom(BPoint origin, float width, float height);
45 // -------------------------------------------
46 // Public PoorMan Window Methods
47 void SetDirLabel(const char* name);
48 void SetHits(uint32 num);
49 uint32 GetHits() { return fHits; }
50 status_t SaveConsole(BMessage* message, bool);
52 status_t SaveSettings();
53 status_t ReadSettings();
54 void DefaultSettings();
56 status_t StartServer();
57 status_t StopServer();
59 PoorManServer* GetServer() const { return fServer;}
60 // -------------------------------------------
61 // Preferences and Settings
62 // Site Tab
63 bool DirListFlag()
65 return fDirListFlag;
68 void SetDirListFlag(bool flag)
70 fDirListFlag = flag;
73 const char* IndexFileName()
75 return fIndexFileName.String();
78 void SetIndexFileName(const char* str)
80 fIndexFileName.SetTo(str);
83 const char* WebDir()
85 return fWebDirectory.String();
88 void SetWebDir(const char* str)
90 fWebDirectory.SetTo(str);
93 // Logging Tab
95 bool LogConsoleFlag()
97 return fLogConsoleFlag;
100 void SetLogConsoleFlag(bool flag)
102 fLogConsoleFlag = flag;
105 bool LogFileFlag()
107 return fLogFileFlag;
110 void SetLogFileFlag(bool flag)
112 fLogFileFlag = flag;
115 const char* LogPath()
117 return fLogPath.String();
120 void SetLogPath(const char* str);
122 // Advanced Tab
123 int16 MaxConnections()
125 return fMaxConnections;
128 void SetMaxConnections(int16 num)
130 fMaxConnections = num;
133 private:
134 // -------------------------------------------
135 // PoorMan Window Methods
136 void UpdateStatusLabelAndMenuItem();
137 void UpdateHitsLabel();
139 private:
140 // -------------------------------------------
141 // Build Menu Methods
142 BMenu* BuildFileMenu() const;
143 BMenu* BuildEditMenu() const;
144 BMenu* BuildControlsMenu() const;
146 // --------------------------------------------
147 // MenuBar & Menu items
148 BMenuBar* fFileMenuBar;
149 BMenu* fFileMenu;
150 BMenu* fEditMenu;
151 BMenu* fControlsMenu;
153 // --------------------------------------------
154 // Status, Hits, Directory
155 BStringView* fStatusView;
156 BStringView* fHitsView;
157 BStringView* fDirView;
159 bool fStatus;
160 uint32 fHits;
161 char fHitsLabel[25];
163 // --------------------------------------------
164 // Logging View
165 BScrollView* fScrollView;
166 BTextView* fLoggingView;
167 // use asctime() for format of [Date/Time]:
170 // -------------------------------------------
171 // PoorMan Preference Window
172 PoorManPreferencesWindow * fPrefWindow;
174 // site tab
175 BString fWebDirectory;
176 BString fIndexFileName;
177 bool fDirListFlag;
179 // logging tab
180 bool fLogConsoleFlag;
181 bool fLogFileFlag;
182 BString fLogPath;
184 // advanced tab
185 int16 fMaxConnections;
187 bool fIsZoomed;
188 float fLastWidth;
189 float fLastHeight;
190 BRect fFrame;
191 BRect fSetwindowFrame;
193 // File Panels
194 BFilePanel* fSaveConsoleFilePanel;
195 BFilePanel* fSaveConsoleSelectionFilePanel;
197 BFile* fLogFile;
199 PoorManServer* fServer;
201 pthread_rwlock_t fLogFileLock;
204 #endif