os::IconDirectoryView Class Reference
[The Syllable Graphical User Interface API]

Directory view suitable for file-requesters and other file browsers. More...

Inheritance diagram for os::IconDirectoryView:

os::IconView os::Control os::View os::Invoker os::Handler List of all members.

Public Member Functions

 IconDirectoryView (const Rect &cFrame, const String &cPath, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP)
 Creates a new directory view.
 ~IconDirectoryView ()
void ReRead ()
 Rereads the directory content.
void SetPath (const String &cPath)
 Sets the current path.
String GetPath () const
 Returns the current path.
ImageGetDirIcon () const
 Returns the icon of the current directory.
bool JobsPending () const
 Returns whether there are still pending jobs.
void SetDirChangeMsg (Message *pcMsg)
 Sets the message that is sent when the directory changes.
void SetDirectoryLocked (bool bLocked)
 Sets whether the current directory is locked.
void SetAutoLaunch (bool bAutoLaunch)
 Sets whether invoked files are automatically launched.
virtual void DirChanged (const String &cNewPath)
virtual void Invoked (uint nIcon, os::IconData *pcData)
 Called when an icon is invoked.
virtual void DragSelection (os::Point cStartPoint)
 Called when an icon should be dragged.
virtual void OpenContextMenu (os::Point cPosition, bool bMouseOverIcon)
 Called when the context menu of one icon should be opened.
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler.
virtual void AttachedToWindow ()
virtual void DetachedFromWindow ()
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release.
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved.
virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is pressed while the view has focus.

Friends

class os_priv::DirKeeper

Classes

class  Private

Detailed Description

Description:
See also:
os::FileRequester
Author:
Arno Klenke ([email protected])


Constructor & Destructor Documentation

IconDirectoryView::IconDirectoryView ( const Rect cFrame,
const String cPath,
uint32  nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP 
)

Description:
Creates a new directory view.
Parameters:
cFrame - Frame.
cPath - The start path. Can be set afterwards with SetPath().
nResizeMask - ResizeMask.
Author:
Arno Klenke ([email protected])

IconDirectoryView::~IconDirectoryView (  ) 


Member Function Documentation

void IconDirectoryView::ReRead (  ) 

Description:
Rereads the directory content. Necessary after adding the view to a window or after a SetPath() call.
Note:
Changes in the directory will automatically cause an update.
Author:
Arno Klenke ([email protected])

void IconDirectoryView::SetPath ( const String cPath  ) 

Description:
Sets the current path. After this call you have to call the ReRead() method.
Parameters:
cPath - The new path. Please make sure that is is valid.
Author:
Arno Klenke ([email protected])

os::String IconDirectoryView::GetPath (  )  const

Description:
Returns the current path.
Returns:
The current path.
Author:
Arno Klenke ([email protected])

os::Image * IconDirectoryView::GetDirIcon (  )  const

Description:
Returns the icon of the current directory. The iconsize is 24x24 pixels.
Returns:
The icon.
Author:
Arno Klenke ([email protected])

bool IconDirectoryView::JobsPending (  )  const

Description:
Returns whether there are still pending jobs like copying, deleting, etc... The view should not be deleted before false is returned.
Returns:
Whether there are pending jobs.
Author:
Arno Klenke ([email protected])

void IconDirectoryView::SetDirChangeMsg ( Message pcMsg  ) 

Description:
Sets the message that is sent when the directory changes.
Parameters:
pcMsg - The message.
Author:
Arno Klenke ([email protected])

void IconDirectoryView::SetDirectoryLocked ( bool  bLocked  ) 

Description:
Sets whether the current directory is locked. When the user tries to access another directory, the message set by SetDirChangeMsg() is sent, but the directory is not changed.
Parameters:
bLocked - Enables/Disables this feature.
Author:
Arno Klenke ([email protected])

void IconDirectoryView::SetAutoLaunch ( bool  bAutoLaunch  ) 

Description:
Sets whether invoked files are automatically launched when they are invoked.
Parameters:
bAutoLaunch - Enables/Disables this feature.
Author:
Arno Klenke ([email protected])

void IconDirectoryView::DirChanged ( const String cNewPath  )  [virtual]

void IconDirectoryView::Invoked ( uint  nIcon,
os::IconData pcData 
) [virtual]

Description:
Called when an icon is invoked. The default action is to send the message set by SetInvokeMsg()
Parameters:
nIcon - Index of the invoked icon.
pcData - Data of the invoked icon.
Author:
Arno Klenke ([email protected])

Reimplemented from os::IconView.

void IconDirectoryView::DragSelection ( os::Point  cStartPoint  )  [virtual]

Description:
Called when an icon should be dragged.
Parameters:
cStartPoint - Start position of the drag.
Author:
Arno Klenke ([email protected])

Reimplemented from os::IconView.

void IconDirectoryView::OpenContextMenu ( os::Point  cPosition,
bool  bMouseOverIcon 
) [virtual]

Description:
Called when the context menu of one icon should be opened.
Parameters:
cPosition - Position.
bMouseOverIcon - Whether the contextmenu of an icon should be opened.
Author:
Arno Klenke ([email protected])

Reimplemented from os::IconView.

void IconDirectoryView::HandleMessage ( Message pcMessage  )  [virtual]

Description:
Overload this member to dispatch messages sendt to this handler. When a looper receives a message for one of it's handlers it will call the taget handlers HandleMessage() to allow the handler to dispatch the message.
The message passed in pcMessage is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage().
The looper will be locked when this member is called. The default implementation of this member will pass the message on to the next handler if one was set with SetNextHandler().
Note:
Never do any lenthy operations in any hook members that are called from the looper thread if the looper is involved with the GUI (for example if the looper is a os::Window). The looper will not be able to dispatch messages until the hook returns so spending a long time in this members will make the GUI feel unresponsive.
Parameters:
pcMessage The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(),
See also:
os::Looper::DispatchMessage(), os::Looper::DetachCurrentMessage()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Handler.

void IconDirectoryView::AttachedToWindow (  )  [virtual]

Reimplemented from os::Control.

void IconDirectoryView::DetachedFromWindow (  )  [virtual]

Reimplemented from os::Control.

void IconDirectoryView::MouseUp ( const Point cPosition,
uint32  nButtons,
Message pcData 
) [virtual]

Description:
This member is called from the window thread whenever a mouse button is released above the view. You can overload this member if your view need to know about mouse-up events or if your view support drag and drop.
If mouse-up was the result of ending a drag and drop operation the pcData member will point to a Message containing the dragged data. Look at BeginDrag() for a more detailed description of the drag and drop system.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters:
cPosition Mouse position in the views coordinate system at the time the mouse was pressed.
nButtons Index of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
pcData Pointer to a Message object containing the dragged data if this mouse-up was the end of a drag and drop operation. If no data was dragged it will be NULL.
See also:
MouseDown(), MouseMove(), WheelMoved()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void IconDirectoryView::MouseMove ( const Point cNewPos,
int  nCode,
uint32  nButtons,
Message pcData 
) [virtual]

Description:
This member is called from the window thread whenever the mouse is moved above the view or if the view has focus.
Oveload this member if your view need to handle mouse-move events.
The default implementation of this member will call MouseMove() on it's parent view if one exists.
Parameters:
cNewPos New mouse position given in the views coordinate system.
nCode Enter/exit code. This is MOUSE_ENTERED when the mouse first enter the view, MOUSE_EXITED when the mouse leaves the view, MOUSE_INSIDE whenever the mouse move withing the boundary of the view and MOUSE_OUTSIDE when the mouse move outside the view (will only happen if the view has focus).
nButtons Bitmask telling which buttons that are currently pressed. Bit 0 is button 1 (left), bit 1 is button 2 (right), and bit 2 is button 3 (middle), and so on.
pcData Pointer to a Message object containing the dragged data if the user is in the middle of a drag and drop operation. Otherwise this pointer is NULL. Look at BeginDrag() for a more detailed description of the drag and drop system.
See also:
MouseDown(), MouseUp(), WheelMoved(), BeginDrag()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.

void IconDirectoryView::KeyDown ( const char *  pzString,
const char *  pzRawString,
uint32  nQualifiers 
) [virtual]

Description:
Overload this member if your view need to handle keyboard input. This member is called to allow the view to handle M_KEY_DOWN messages. The most common members are exctracted from the message and passed as parameters but you might need to obtain the raw message with os::Looper::GetCurrentMessage() and find some members yourself if you the data you needed are not passed in.
For example if you need the raw key-code for the pressed key you will have to lookup the "_raw_key" member from the message.
Parameters:
pzString String containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed.
pzRawString Same as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'.
nQualifiers Bitmask describing which qualifiers that was active when the key was pressed.
See also:
KeyUp(), os::Looper::GetCurrentMessage()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::View.


Friends And Related Function Documentation

friend class os_priv::DirKeeper [friend]


Generated on Sat May 9 22:51:28 2009 for Syllable higlevel API by  doxygen 1.5.1