![]() | InDesign SDK 20.5 |
#include <SDKFileHelper.h>

Public Member Functions | |
| void | ShowDialog () |
| int32 | GetFileCount () const |
| IDFile * | GetNthFile (int32 n) const |
Public Member Functions inherited from SDKFileOpenChooser | |
| SDKFileOpenChooser () | |
| virtual | ~SDKFileOpenChooser () |
| void | AddFilter (const FileTypeInfoID &fileTypeInfoID, const PMString &filterName) |
| void | AddFilter (const SysOSType &macFileType, const PMString &extension, const PMString &filterName) |
| void | AddAllFiles () |
| void | SetTitle (const PMString &title) |
| void | ShowDialog () |
Public Member Functions inherited from SDKFileHelper | |
| SDKFileHelper (const PMString &path) | |
| SDKFileHelper (const IDFile &file) | |
| virtual | ~SDKFileHelper () |
| bool16 | IsExisting () const |
| bool16 | IsChosen () const |
| PMString | GetPath () const |
| IDFile | GetIDFile () const |
| IDFile | GetAbsoluteFromRelative (const PMString &relativePath) const |
| PMString | GetParentFolderAsString () const |
Additional Inherited Members | |
Static Public Member Functions inherited from SDKFileHelper | |
| static bool16 | isMacPosixPathEnabled () |
Protected Types inherited from SDKFileOpenChooser | |
| typedef K2Vector< Filter > | Filters |
Protected Member Functions inherited from SDKFileHelper | |
| SDKFileHelper () | |
| void | initFromString () |
| void | initFromSysFile () |
| void | traceInitializeDiagnostics (int32 e) const |
| PMString | calcDefaultFileName () const |
| void | setChosen (bool16 chsen) |
| void | setIDFile (const IDFile &file) |
| void | setPath (const PMString &path) |
| PMString | absoluteFromRelative (const PMString &folder, const PMString &path) const |
| bool16 | isAbsolutePath (const PMString &path) const |
| bool16 | isUnixPath (const PMString &path) const |
| bool16 | isMacPath (const PMString &path) const |
| bool16 | isWinPath (const PMString &path) const |
| PMString | getMinusLastElement (const PMString &path) const |
| PMString | getMinusFirstElement (const PMString &path) const |
| PMString | getAsMacPath (const PMString &path) const |
| PMString | getAsWinPath (const PMString &path) const |
Protected Attributes inherited from SDKFileOpenChooser | |
| Filters | fFilters |
| PMString | fTitle |
| bool16 | fIsAllFilesEnabled |
| IOpenFileCmdData::OpenFlags | fOpenFlags |
Provides a mechanism for the user to choose multiple files to be opened and allows filtering of the files presented, note this class does not actually open the file, it just lets the user choose a file.
The code below pops a multipul files open chooser that shows jpg or gif files.
SDKFileOpenMultipleFileChooser multiFileChooser; multiFileChooser.AddFilter(kJPEGFileTypeInfoID, "JPEG files(jpg)"); multiFileChooser.AddFilter(kGIFFileTypeInfoID, "GIFf files(gif)"); multiFileChooser.ShowDialog(); if (multiFileChooser.IsChosen()) { int32 idFileCount = multiFileChooser.GetFileCount(); for(int32 i = 0; i < idFileCount; ++i) { chosenFileList.push_back(*(multiFileChooser.GetNthFile(i))); } }
| int32 SDKFileOpenMultipleFileChooser::GetFileCount | ( | ) | const |
Returns the number of files in the list.
| IDFile * SDKFileOpenMultipleFileChooser::GetNthFile | ( | int32 | n | ) | const |
Returns the n'th file in the list.
| n | IN Index of the file to return from the list. |
| void SDKFileOpenMultipleFileChooser::ShowDialog | ( | ) |
Pops a file browse dialog to allow the user to choose multiple files to be opened. If any filters have been specified by the caller (SDKFileOpenChooser::AddFilter, SDKFileOpenChooser::AddAllFiles), the user will be able to apply them to control the files shown in the chooser. Otherwise two default filters will be made available; the first filter will show publication documents (InDesign documents under InDesign, InCopy documents under InCopy); the second filter will show all files.