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

Generic file requester. More...

Inheritance diagram for os::FileRequester:

os::Window os::Looper os::Handler List of all members.

Public Types

enum  file_req_mode_t {
  LOAD_REQ,
  SAVE_REQ
}
enum  {
  NODE_FILE = 0x01,
  NODE_DIR = 0x02
}

Public Member Functions

 FileRequester (file_req_mode_t nMode=LOAD_REQ, Messenger *pcTarget=NULL, String cStartPath="", uint32 nNodeType=NODE_FILE, bool bMultiSelect=true, Message *pcMessage=NULL, FileFilter *pcFilter=NULL, bool bModal=false, bool bHideWhenDone=true, String cOkLabel="", String cCancelLabel="")
 Constructor.
virtual ~FileRequester ()
void Show (bool bMakeVisible=true)
 Hide/Unhide the window.
virtual void HandleMessage (Message *pcMessage)
 Handle a message targeted at this handler.
virtual void FrameSized (const Point &cDelta)
virtual bool OkToQuit (void)
 Check if it is ok to break the loop.
void SetPath (const String &cPath)
 Sets a new path.
String GetPath () const
 Returns the current path.

Classes

class  Private

Detailed Description

Description:
The filerequester is a seperate window that lets the user select files that should be opened/saved. Please note that reading the selected directory starts when the window is first shown. The following messages are sent to the given message target: M_FILE_REQUESTER_CANCELED - If the filerequester is closed without any action. M_LOAD_REQUESTED - If a file has been selected to be loaded. M_SAVE_REQUESTED - If a file has been selected to be saved.
See also:
os::IconDirectoryView
Author:
Kurt Skauen ([email protected])


Member Enumeration Documentation

enum os::FileRequester::file_req_mode_t

Enumerator:
LOAD_REQ 
SAVE_REQ 

anonymous enum

Enumerator:
NODE_FILE 
NODE_DIR 


Constructor & Destructor Documentation

FileRequester::FileRequester ( file_req_mode_t  nMode = LOAD_REQ,
Messenger pcTarget = NULL,
String  cStartPath = "",
uint32  nNodeType = NODE_FILE,
bool  bMultiSelect = true,
Message pcMessage = NULL,
FileFilter pcFilter = NULL,
bool  bModal = false,
bool  bHideWhenDone = true,
String  cOkLabel = "",
String  cCancelLabel = "" 
)

Description:
Filerequester constructure.
Parameters:
nMode - Whether the filerequester is used to load or save files.
zName - The target of the messages.
pzStartPath - The start path. Default is the home directory of the user.
nNodeType - When NODE_DIR is given, also directories can be opened.
bMultiSelect - Whether multiple files can be selected.
pcMessage - A message which overrieds M_LOAD_REQUESTED/M_SAVE_REQUESTED.
pcFilter - A file filter. NOT SUPPORTED YET.
bModal - NOT SUPPORTED YET.
bHideWhenDone - NOT SUPPORTED YET.
cOKLabel - Overrides "Load" or "Save".
cCancelLabel - Overrides "Cancel".
Author:
Arno Klenke ([email protected])

FileRequester::~FileRequester (  )  [virtual]


Member Function Documentation

void FileRequester::Show ( bool  bMakeVisible = true  ) 

Description:
When a window is first constructed, it is not made visible on the screen. You must first call Show(true), The first time Show() is called it will also unlock the window, and start the looper thread if it is not done already by calling Start().

You can nest calls to Show(false). It will then require the same numbers of Show(true) calls to make the window visible.

Note:
The Window visibility state is global across all desktops.
Parameters:
bMakeVisible - Set to true to make the window visible, and false to hide it.
See also:
Start(), Window::Window()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Window.

void FileRequester::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 FileRequester::FrameSized ( const Point cDelta  )  [virtual]

Reimplemented from os::Window.

bool FileRequester::OkToQuit ( void   )  [virtual]

Description:
You can overload this function to affect how the looper will react to M_QUIT messages. When an M_QUIT message arrive the looper will call this function to figure out what to do. If it returns false the message is ignored. If it returns true the loop is terminated, the looper object deleted and the looper thread will exit.
Returns:
true if it is ok to terminate the looper, false otherwise.
See also:
Quit(), PostMessage()
Author:
Kurt Skauen ([email protected])

Reimplemented from os::Looper.

void FileRequester::SetPath ( const String cNewPath  ) 

Description:
Sets a new path.
Parameters:
cNewPath - The new path.
Author:
Arno Klenke ([email protected])

String FileRequester::GetPath (  )  const

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


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