#include <remoteview.h>
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. | |
Server * | GetServer () |
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 | |
Server * | m_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. |
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.
void FTPRemoteView::SetPath | ( | const String & | zPath | ) |
Set Path to the given path. Sets the path to zPath and updates the window.
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.
void FTPRemoteView::HideMessage | ( | ) |
Hide Message. This is used to hide the on screen message shown by ShowMessage(). Currently it only prints a debugging statement.
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.
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.
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.
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.
pcNode | The item from the remote view that needs an icon. | |
bSmall | If true, the icon should be 24x24. Otherwise it should be 48x48. |
int FTPRemoteView::m_nUpdateCookie [private] |
Passed to ServerConnection::RequestDirListing(), so we don't get confused by late updates.