8 #ifndef POOR_MAN_WINDOW_H
9 #define POOR_MAN_WINDOW_H
13 #include <SupportDefs.h>
30 class PoorManPreferencesWindow
;
33 class PoorManWindow
: public BWindow
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
68 void SetDirListFlag(bool flag
)
73 const char* IndexFileName()
75 return fIndexFileName
.String();
78 void SetIndexFileName(const char* str
)
80 fIndexFileName
.SetTo(str
);
85 return fWebDirectory
.String();
88 void SetWebDir(const char* str
)
90 fWebDirectory
.SetTo(str
);
97 return fLogConsoleFlag
;
100 void SetLogConsoleFlag(bool flag
)
102 fLogConsoleFlag
= flag
;
110 void SetLogFileFlag(bool flag
)
115 const char* LogPath()
117 return fLogPath
.String();
120 void SetLogPath(const char* str
);
123 int16
MaxConnections()
125 return fMaxConnections
;
128 void SetMaxConnections(int16 num
)
130 fMaxConnections
= num
;
134 // -------------------------------------------
135 // PoorMan Window Methods
136 void UpdateStatusLabelAndMenuItem();
137 void UpdateHitsLabel();
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
;
151 BMenu
* fControlsMenu
;
153 // --------------------------------------------
154 // Status, Hits, Directory
155 BStringView
* fStatusView
;
156 BStringView
* fHitsView
;
157 BStringView
* fDirView
;
163 // --------------------------------------------
165 BScrollView
* fScrollView
;
166 BTextView
* fLoggingView
;
167 // use asctime() for format of [Date/Time]:
170 // -------------------------------------------
171 // PoorMan Preference Window
172 PoorManPreferencesWindow
* fPrefWindow
;
175 BString fWebDirectory
;
176 BString fIndexFileName
;
180 bool fLogConsoleFlag
;
185 int16 fMaxConnections
;
191 BRect fSetwindowFrame
;
194 BFilePanel
* fSaveConsoleFilePanel
;
195 BFilePanel
* fSaveConsoleSelectionFilePanel
;
199 PoorManServer
* fServer
;
201 pthread_rwlock_t fLogFileLock
;