ASPiK SDK
|
New file selector class. More...
#include <cfileselector.h>
Public Types | |
enum | Style { kSelectFile, kSelectSaveFile, kSelectDirectory } |
Public Member Functions | |
CFileSelector setup | |
void | setTitle (const UTF8String &title) |
set title of file selector | |
void | setInitialDirectory (const UTF8String &path) |
set initial directory (UTF8 string) | |
void | setDefaultSaveName (const UTF8String &name) |
set initial save name (UTF8 string) | |
void | setDefaultExtension (const CFileExtension &extension) |
set default file extension | |
void | setAllowMultiFileSelection (bool state) |
set allow multi file selection (only valid for kSelectFile selector style) | |
void | addFileExtension (const CFileExtension &extension) |
add a file extension | |
void | addFileExtension (CFileExtension &&extension) |
add a file extension | |
CFileSelector result | |
uint32_t | getNumSelectedFiles () const |
get number of selected files | |
UTF8StringPtr | getSelectedFile (uint32_t index) const |
get selected file. Result is only valid as long as the instance of CNewFileSelector is valid. | |
![]() | |
CBaseObject (const CBaseObject &o) | |
CBaseObject & | operator= (const CBaseObject &obj) |
virtual CMessageResult | notify (CBaseObject *sender, IdStringPtr message) |
![]() | |
ReferenceCounted (const ReferenceCounted &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
void | forget () override |
decrease refcount and delete object if refcount == 0 | |
void | remember () override |
increase refcount | |
virtual int32_t | getNbReference () const |
get refcount | |
virtual void | beforeDelete () |
Static Public Member Functions | |
static const CFileExtension & | getAllFilesExtension () |
get the all files extension | |
Static Public Attributes | |
static IdStringPtr | kSelectEndMessage = "CNewFileSelector Select End Message" |
Protected Types | |
using | FileExtensionList = std::list< CFileExtension > |
Protected Member Functions | |
CNewFileSelector (CFrame *frame=nullptr) | |
virtual bool | runInternal (CBaseObject *delegate)=0 |
virtual void | cancelInternal ()=0 |
virtual bool | runModalInternal ()=0 |
Protected Attributes | |
CFrame * | frame |
UTF8String | title |
UTF8String | initialPath |
UTF8String | defaultSaveName |
const CFileExtension * | defaultExtension |
bool | allowMultiFileSelection |
FileExtensionList | extensions |
std::vector< UTF8String > | result |
CFileSelector running | |
using | CallbackFunc = std::function< void(CNewFileSelector *)> |
static CNewFileSelector * | create (CFrame *parent=nullptr, Style style=kSelectFile) |
create a new instance | |
bool | run (CallbackFunc &&callback) |
bool | run (CBaseObject *delegate) |
the delegate will get a kSelectEndMessage throu the notify method where the sender is this CNewFileSelector object | |
void | cancel () |
cancel running the file selector | |
bool | runModal () |
run as modal dialog | |
New file selector class.
Running the file selector
Getting results