InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IOpenFileDialog Class Referenceabstract

#include <IOpenFileDialog.h>

Inheritance diagram for IOpenFileDialog:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IOPENFILEDIALOG }
 

Public Member Functions

virtual bool16 DoDialog (IDFile *defaultFile, SysFileList &resultFiles, bool16 allowMultipleFiles=kTrue, const PMString *title=nil, const PMString *infoMessage=nil)=0
 
virtual void AddExtension (const PMString *family, const PMString *extension)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface is used to display a dialog to open a single file or multiple files. Typically you need to do the following steps:

  1. Create a object of kOpenFileDialogBoss.
  2. Call AddExtension and AddType() to set the file filter info.
  3. (optional) Use other methods to change default settings.
  4. Call DoDialog() to open the dialog.

To add a custom control, create a new boss and implement this interface. The implementation should inherit (W/M)OpenFileDialogBase. See more comments in their headers.

Member Function Documentation

virtual void IOpenFileDialog::AddExtension (const PMStringfamily,
const PMStringextension 
)
pure virtual

Adds an extension to the file filter list.

Parameters
family[in]-the name of the filter. If the filter exists, the extension will be added to it's list. If the filter doesn't exist, a new one will be added to the bottom of the filter list.
extension[in]- extension associated with the filter.
virtual bool16 IOpenFileDialog::DoDialog (IDFiledefaultFile,
SysFileListresultFiles,
bool16 allowMultipleFiles = kTrue,
const PMStringtitle = nil,
const PMStringinfoMessage = nil 
)
pure virtual

Displays the file open dialog.

Parameters
defaultFile[in]-the file that the dialog should default to.
resultFiles[out]- will be filled with the file(s) the user selected.
allowMultipleFiles[in]-specifies if multiple selection is allowed.
title[in]-title for the dialog box. Default title is "Open a File".
infoMessage[in]-Mac only parameter. Descriptive text that will be displayed below the browser list.
Returns
bool16 kFalse if the user cancelled the dialog, kTrue otherwise.