00001 #ifndef __REMOTEICONVIEW_H__ 00002 #define __REMOTEICONVIEW_H__ 00003 00004 #include <gui/iconview.h> 00005 #include <util/datetime.h> 00006 #include <gui/image.h> 00007 #include <gui/bitmap.h> 00008 #include <gui/stringview.h> 00009 00010 #include <vector> 00011 00012 #include "application.h" 00013 #include "messages.h" 00014 #include "remotenode.h" 00015 #include "server.h" 00016 00017 00018 00019 using namespace os; 00020 00021 00025 class RemoteIconData : public IconData { 00026 public: 00027 RemoteNode m_cNode; 00028 }; 00029 00038 class FTPRemoteView : public IconView 00039 { 00040 public: 00041 FTPRemoteView( const Rect& cFrame, const String& zName ); 00042 ~FTPRemoteView(); 00043 00044 void SetServer( Server* pcServer ); 00045 Server* GetServer(); 00046 void SetPath( const String& zPath ); 00047 String GetPath(); 00048 void ShowMessage( const String& zMsg ); 00049 void HideMessage(); 00050 00051 void Update(); 00052 void SetContents( std::vector< RemoteNode >* pacContents, bool bInitial, bool bFinal ); 00053 00054 00055 void AttachedToWindow(); 00056 void SetDirChangeMsg( Message* pcMsg ); 00057 void Invoked( uint nIcon, IconData* pcData ); 00058 void MouseUp( const Point& cPoint, uint32 nButtons, Message* pcData ); 00059 00060 void DragSelection( Point cStartPoint ); 00061 // void OpenContextMenu( Point cPosition, bool bMouseOverIcon ); /* Context menu includes 'transfer', 'view', 'rename', 'delete' etc */ 00062 00063 void HandleMessage( Message* pcMessage ); 00064 00065 Image* GetNodeImage( RemoteNode* pcNode, bool bSmall ); 00066 00067 private: 00068 00073 Server* m_pcServer; 00074 00077 String m_zPath; 00078 00082 bool m_bUpdatePending; 00083 00088 int m_nUpdateCookie; 00089 00091 Message* m_pcDirChangedMsg; 00092 00093 // StringView* m_pcStringView; /* Used for displaying "Not connected" message, etc */ /* TODO: crashes when quitting !? */ 00094 }; 00095 00096 00097 #endif /* __REMOTEICONVIEW_H__ */ 00098 00099 00100