00001 #ifndef MAINWINDOW_H 00002 #define MAINWINDOW_H 00003 00004 #include <util/application.h> 00005 #include <gui/window.h> 00006 #include <gui/image.h> 00007 #include <util/message.h> 00008 #include <util/resources.h> 00009 #include <gui/toolbar.h> 00010 #include <gui/menu.h> 00011 #include <gui/statusbar.h> 00012 00013 00014 #include "connectbar.h" 00015 #include "view.h" 00016 #include "server.h" 00017 #include "settings.h" 00018 #include "settingsmenu.h" 00019 00023 class MainWindow : public os::Window 00024 { 00025 public: 00026 MainWindow(); 00027 ~MainWindow(); 00028 void HandleMessage( os::Message* ); 00029 void OpenConnection(const String& zScheme, const String& zHost, const String& nPort, const String& zUser, const String& zPassword ); 00030 00031 private: 00032 bool OkToQuit(); 00033 void Layout(); 00034 void SetupMenus(); 00035 void SetupToolBar(); 00036 void SetupStatusBar(); 00037 00038 String ConstructURL( const String& zHost, int nPort, const String& zUser, const String& zPassword ); 00039 bool isValidHost(const String& zHost); 00040 bool isValidUser(const String& zUser); 00041 bool isValidPassword(const String& zPassword); 00042 bool isValidPort(int nPort); 00043 00044 private: 00045 00047 os::Menu* m_pcMainMenu; 00048 00050 os::ToolBar* m_pcToolBar; 00051 00053 os::StatusBar* m_pcStatusBar; 00054 00056 FTPView* m_pcView; 00057 00059 ConnectBar* m_pcConnectBar; 00060 00062 Server* m_pcServer; 00063 00065 FTPSettings* m_pcSettings; 00066 00068 SettingsMenu* m_pcSettingsMenu; 00069 00070 // These were created for ease of syntax checking. 00071 // They correspond to the grammar for URI's expressed 00072 // in RFC 3986. 00073 static const os::String sUnreserved; 00074 static const os::String sPctEncoded; 00075 static const os::String sSubDelims; 00076 static const os::String sUserinfo_nc; 00077 static const os::String sDecOctet; 00078 static const os::String sIPv4address; 00079 static const os::String sH16; 00080 static const os::String sLS32; 00081 static const os::String sIPvFuture; 00082 static const os::String sIPv6address; 00083 static const os::String sIP_literal; 00085 }; 00086 00087 #endif 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107