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

#include <ISaveFileDialog.h>

Inheritance diagram for ISaveFileDialog:
IPMUnknown

Public Member Functions

virtual bool16 DoDialog (const IDFile *defaultFile, IDFile *resultFile, int32 *selectedIndex=nil, bool16 useSystemDefaultDir=kFalse, bool16 showTypeMenu=kTrue, const PMString *title=nil, const bool16 &isSaveACopy=kFalse)=0
 
virtual void AddFileTypeInfo (const PMString &description, 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

ISaveFileDialog is used to allow the user to specify where to save a file.

Typically you need to do the following steps:

  1. Create a object of kSaveFileDialogBoss.
  2. Call SetFileTypeInfo() to set the file type and extension of the file you are going to save.
  3. (Optional) Use other methods to change default settings.
  4. Call DoDialog() to display the dialog. To add a custom control, create a new boss and implement this interface. The implementation should inherit (W/M)SaveFilaDialogBase. See more comments in their headers.

Member Function Documentation

virtual void ISaveFileDialog::AddFileTypeInfo (const PMStringdescription,
const PMStringextension 
)
pure virtual

Add another creator, type, extension tuple to popup.

Parameters
description[in]-text description of the file type to be displayed in the types popup menu.
extension[in]-file extension
virtual bool16 ISaveFileDialog::DoDialog (const IDFiledefaultFile,
IDFileresultFile,
int32 * selectedIndex = nil,
bool16 useSystemDefaultDir = kFalse,
bool16 showTypeMenu = kTrue,
const PMStringtitle = nil,
const bool16 & isSaveACopy = kFalse 
)
pure virtual

Displays the save file dialog.

Parameters
defaultFile[in]-specifies the default file to use when saving. It should NOT be nil. On Windows, defaultFile can be a file name with full path, a file name without path, or a path name without a file name. When a path is given, it is used as the default directory. Otherwise the last used directory for save is used as the default one. On Mac, defaultFile always contains a path. To ignore the directory in defaultFile and use the system default directory (the last used save directory), set useSystemDefaultDir to be kTrue;
resultFile[out]-the file to save to
selectedIndex[inout]-optional parameter. may be nil. If not nil, it's used to select the default index in the list, and returns the index selected by the user
useSystemDefaultDir[in]-pass kTrue to ignore the directory in defaultFile and use the system default directory (the last used save directory)
showTypeMenu[in]-passing kFalse will hide the Type menu in the dialog.
title[in]-the title for the window. The default title is "Save As".
isSaveACopy[in]INTERNAL USE ONLY - to specify if the save call is "save a copy" or not.
Returns
false if user canceled, true otherwise.