FTPRemoteView Class Reference

FTPRemoteView This class provides functionality for request directory information from the remote server and to copy items from the remote directory into the local directory. More...

#include <remoteview.h>

List of all members.

Public Member Functions

 FTPRemoteView (const Rect &cFrame, const String &zName)
 FTP Remote View Constructor. Initializes all the information necessary for the view.
 ~FTPRemoteView ()
 FTP Remote View deconstructor. This removes the m_pcDirChangedMsg object before destruction.
void SetServer (Server *pcServer)
 SetServer This sets the server for the current view and sets the path to the root of this server. It then updates the view.
ServerGetServer ()
 Retrieve the current server. Returns the current Server object for this view.
void SetPath (const String &zPath)
 Set Path to the given path. Sets the path to zPath and updates the window.
String GetPath ()
 Retrieve the current path. This returns the current path for the remote view.
void ShowMessage (const String &zMsg)
 Show Message. This is used to show a message on the screen. Currently it doesn't do anything.
void HideMessage ()
 Hide Message. This is used to hide the on screen message shown by ShowMessage(). Currently it only prints a debugging statement.
void Update ()
 Update the current directory listing. Request the Server to download a directory listing and send it to us asynchronously. When the listing is downloaded, it is sent back to us via a M_REMOTE_DIRLISTING message and SetContents() is called.
void SetContents (std::vector< RemoteNode > *pacContents, bool bInitial, bool bFinal)
 Create and display icons for each of the RemoteNodes. in pacNodes. This sets the remote view contents and updates the layout when necessary.
void AttachedToWindow ()
 AttachedToWindow Overloaded Method. This updates the current view once the object is attached to a window.
void SetDirChangeMsg (Message *pcMsg)
 Set Director Change Message. This removes the old directory changed message and replaces it with the new one.
void Invoked (uint nIcon, IconData *pcData)
 Invoked Handles when an icon within the view is invoked. If it is a directory it should, the current directory should move into it. If it is a file it should be opened if possible and otherwise it should be downloaded.
void MouseUp (const Point &cPoint, uint32 nButtons, Message *pcData)
 MouseUp Callback. This handles the situation where someone does a drag and drop of an item. In this case we should copy it to the desired location.
void DragSelection (Point cStartPoint)
 DragSelection callback. Handles the results of a drag selection.
void HandleMessage (Message *pcMessage)
 Message Handling Callback. This handles all callbacks to the remote view window.
Image * GetNodeImage (RemoteNode *pcNode, bool bSmall)
 Get a suitable icon for the file. This should retrieve a suitable icon for the file to display and return an Image pointer to it.

Private Attributes

Serverm_pcServer
 Server object that the remote view connects to. Server object provides GetChildren(), StartTransfer(), PauseTransfer(), CancelTransfer() etc.
String m_zPath
 Path of current directory. This contains the absolute path from remote server root (eg /home/user ).
bool m_bUpdatePending
 Flag for whether an update is pending or not. If true, we are waiting for the server to give a directory listing.
int m_nUpdateCookie
 Passed to ServerConnection::RequestDirListing(), so we don't get confused by late updates.
Message * m_pcDirChangedMsg
 Sent to the target when user changes directory.


Detailed Description

FTPRemoteView This class provides functionality for request directory information from the remote server and to copy items from the remote directory into the local directory.

Todo:
Once this is under CVS all ifdef 0 code should be removed.
Todo:
This should be renamed so that it doesn't sound like it's unique to FTP servers only.


Member Function Documentation

void FTPRemoteView::SetServer ( Server pcServer  ) 

SetServer This sets the server for the current view and sets the path to the root of this server. It then updates the view.

Todo:
Find out from the server what the current dir is via PWD.

void FTPRemoteView::SetPath ( const String &  zPath  ) 

Set Path to the given path. Sets the path to zPath and updates the window.

Parameters:
zPath The path to set to.

void FTPRemoteView::ShowMessage ( const String &  zMsg  ) 

Show Message. This is used to show a message on the screen. Currently it doesn't do anything.

Todo:
Currently this doesn't have any functional purpose. It should do something besides output a message in the console.

void FTPRemoteView::HideMessage (  ) 

Hide Message. This is used to hide the on screen message shown by ShowMessage(). Currently it only prints a debugging statement.

Todo:
Should change this so that it hides the message created by ShowMessage() or remove it if ShowMessage() is no longer used.

void FTPRemoteView::SetContents ( std::vector< RemoteNode > *  pacNodes,
bool  bInitial,
bool  bFinal 
)

Create and display icons for each of the RemoteNodes. in pacNodes. This sets the remote view contents and updates the layout when necessary.

Todo:
Perform periodic layouts while downloading large dirlisting.
Todo:
Display file sizes in a human readable format?
Parameters:
pacNodes List of RemoteNodes that should be updated for the remote view contents.
bInitial Set this to true if this is the first of several messages and we should clear the iconview first.
bFinal Set this to true if this is the last of the directory listing. and should Layout() when done.

void FTPRemoteView::Invoked ( uint  nIcon,
IconData *  pcData 
)

Invoked Handles when an icon within the view is invoked. If it is a directory it should, the current directory should move into it. If it is a file it should be opened if possible and otherwise it should be downloaded.

Bug:
Should attempt to open the remote file if it's not a directory?
Todo:
What should be the default action when the file type is unknown?

void FTPRemoteView::MouseUp ( const Point &  cPoint,
uint32  nButtons,
Message *  pcData 
)

MouseUp Callback. This handles the situation where someone does a drag and drop of an item. In this case we should copy it to the desired location.

Todo:
Implement recursive transfer when a folder is dropped.

Image * FTPRemoteView::GetNodeImage ( RemoteNode pcNode,
bool  bSmall 
)

Get a suitable icon for the file. This should retrieve a suitable icon for the file to display and return an Image pointer to it.

Parameters:
pcNode The item from the remote view that needs an icon.
bSmall If true, the icon should be 24x24. Otherwise it should be 48x48.
Todo:
Ask the registrar for a suitable icon, based on the file extension.


Member Data Documentation

int FTPRemoteView::m_nUpdateCookie [private]

Passed to ServerConnection::RequestDirListing(), so we don't get confused by late updates.

Note:
AWM: Is this necessary?


The documentation for this class was generated from the following files:
Generated on Sun Oct 26 21:16:41 2008 for Transferrer by  doxygen 1.5.1