#include <remoteview.h>
Public Member Functions | |
RemoteIconView (const Rect &cFrame, const String &zName) | |
FTP Remote View Constructor. Initializes all the information necessary for the view. | |
~RemoteIconView () | |
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 a message on the (blank) remote view. This is used to show a message on the remoteview, eg while waiting for the server to send directory data. Currently it doesn't work - the code is ifdef'd out since it crashes. It just printfs the message to the terminal. | |
void | HideMessage () |
Hide Message. This is used to hide the on screen message shown by ShowMessage(). | |
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. It also gets the initial path the first time it is called. | |
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. | |
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 | KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers) |
KeyDown method - used to capture shortcut keys. | |
void | DragSelection (Point cStartPoint) |
DragSelection callback. Handles the results of a drag selection. | |
void | OpenContextMenu (Point cPosition, bool bMouseOverIcon) |
Create & open a context menu. This code is similar to os::IconDirectoryView::OpenContextMenu(). | |
void | HandleMessage (Message *pcMessage) |
Message Handling Callback. This handles all callbacks to the remote view window. | |
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. | |
Menu * | m_pcFileContextMenu |
The context menu that is displayed when the user right-clicks on an icon. Created in OpenContextMenu(). | |
Menu * | m_pcDirContextMenu |
The context menu that is displayed when the user right-clicks on blank background. Created in OpenContextMenu(). |
void RemoteIconView::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 RemoteIconView::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 RemoteIconView::ShowMessage | ( | const String & | zMsg | ) |
Show a message on the (blank) remote view. This is used to show a message on the remoteview, eg while waiting for the server to send directory data. Currently it doesn't work - the code is ifdef'd out since it crashes. It just printfs the message to the terminal.
void RemoteIconView::HideMessage | ( | ) |
Hide Message. This is used to hide the on screen message shown by ShowMessage().
void RemoteIconView::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. It also gets the initial path the first time it is called.
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. |
Image * RemoteIconView::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. |
void RemoteIconView::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 RemoteIconView::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.
int RemoteIconView::m_nUpdateCookie [private] |
Passed to ServerConnection::RequestDirListing(), so we don't get confused by late updates.