InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SDKFilePlaceChooser Class Reference

#include <SDKFileHelper.h>

Inheritance diagram for SDKFilePlaceChooser:
SDKFileHelper

Public Member Functions

 SDKFilePlaceChooser ()
 
virtual ~SDKFilePlaceChooser ()
 
void ShowDialog ()
 
void SetShowFilterPrefs (bool16 showFilterPrefs)
 
void SetRetainFormat (bool16 retainFormat)
 
void SetConvertQuotes (bool16 convertQuotes)
 
void SetReplaceSelectedItem (bool16 replaceSelectedItem)
 
void SetApplyCJKGrid (bool16 applyGrid)
 
void SetShowPreview (bool16 showPreview)
 
bool16 GetShowFilterPrefs () const
 
bool16 GetRetainFormat () const
 
bool16 GetConvertQuotes () const
 
bool16 GetReplaceSelectedItem () const
 
bool16 GetApplyCJKGrid () const
 
bool16 GetShowPreview () const
 
- 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
 

Protected Member Functions

IImportManagerqueryImportManager ()
 
IImportManagerOptionsqueryImportManagerOptions ()
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from SDKFileHelper
static bool16 isMacPosixPathEnabled ()
 

Detailed Description

Provides a mechanism for the user to choose a file to be placed, note this class does not actually place the file, it just lets the user choose a file.

The code below pops a file place chooser dialog for all importable files.


SDKFilePlaceChooser fileChooser;

fileChooser.ShowDialog();

if (fileChooser.IsChosen()) {

    IDFile chosenFile = fileChooser.GetIDFile();

}

The options available on the file place chooser dialog can be set by the caller before the dialog is opened. For example call SDKFilePlaceChooser::SetShowPreview to control the state of the preview checkbox. Once the dialog has been dismissed the options given by the user can be obtained, for example call SDKFilePlaceChooser::SetShowFilterPrefs to see if the import provider's option dialog should be shown when the file is actually imported.

See Also
IImportManager
IImportManagerOptions.

Constructor & Destructor Documentation

SDKFilePlaceChooser::SDKFilePlaceChooser ()

Constructor.

SDKFilePlaceChooser::~SDKFilePlaceChooser ()
virtual

Destructor.

Member Function Documentation

bool16 SDKFilePlaceChooser::GetApplyCJKGrid () const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
bool16 SDKFilePlaceChooser::GetConvertQuotes () const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
bool16 SDKFilePlaceChooser::GetReplaceSelectedItem () const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
bool16 SDKFilePlaceChooser::GetRetainFormat () const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
bool16 SDKFilePlaceChooser::GetShowFilterPrefs () const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
bool16 SDKFilePlaceChooser::GetShowPreview (void ) const
Returns
kTrue if this option's checkbox on the place file dialog was checked, kFalse unchecked.
IImportManager * SDKFilePlaceChooser::queryImportManager ()
protected

Query the service registry for the IImportManager service.

Returns
IImportManager interface on success, nil otherwise.
Postcondition
the caller is responsible for releasing the interface reference.
IImportManagerOptions * SDKFilePlaceChooser::queryImportManagerOptions ()
protected

Query the service registry for the import manager service's options.

Returns
IImportManagerOptions interface on success, nil otherwise.
Postcondition
the caller is responsible for releasing the interface reference.
void SDKFilePlaceChooser::SetApplyCJKGrid (bool16 applyGrid)

Set state of IImportManagerOption's applyCJKGrid option.

Parameters
applyGridIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::SetConvertQuotes (bool16 convertQuotes)

Set state of IImportManagerOption's convertQuotes option.

Parameters
convertQuotesIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::SetReplaceSelectedItem (bool16 replaceSelectedItem)

Set state of IImportManagerOption's replaceSelectedItem option.

Parameters
replaceSelectedItemIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::SetRetainFormat (bool16 retainFormat)

Set state of IImportManagerOption's retainFormatoption.

Parameters
retainFormatIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::SetShowFilterPrefs (bool16 showFilterPrefs)

Set state of IImportManagerOption's showFilterPrefs option.

Parameters
showFilterPrefsIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::SetShowPreview (bool16 showPreview)

Set state of IImportManagerOption's showPreview option.

Parameters
showPreviewIN kTrue if dialog checkbox should be checked, kFalse unchecked.
void SDKFilePlaceChooser::ShowDialog ()

Pops a file browse dialog to allow the user to choose a file to be placed.

Postcondition
SDKFileHelper::IsChosen is kTrue if a file was chosen, kFalse otherwise.
SDKFileHelper::GetIDFile contains the chosen file if SDKFileHelper::IsChosen is kTrue.
SDKFileHelper::GetPath contains the path to the chosen file if SDKFileHelper::IsChosen is kTrue.
SDKFilePlaceChooser contains the state of the IImportManagerOptions entered by the user, for example call SDKFilePlaceChooser::GetShowFilterPrefs to determine if the import filter's options dialog should be shown when the file is imported.
See Also
IImportManager
IImportManagerOptions