ImageEditorUtils Class Reference

class ImageEditorUtils

Static utility class

   ?good_class_usage_example(s)
ImageEditorUtils.lib
Since
S60 v5.0
Public Member Functions
IMPORT_C voidAddImageFileToAlbumL(const TDesC &, TInt)
IMPORT_C TIntCopyFile(RFs &, const TDesC &, const TDesC &, TBool)
IMPORT_C voidFindAlbumsForImageFileL(RArray< TInt > &, const TDesC &)
IMPORT_C TIntGenerateFilePathL(RFs &, const TDesC &, TDes &, ImageEditorUtils::TMemorySelection)
IMPORT_C TIntGenerateNewDocumentNameL(RFs &, const TDesC &, TDes &, RArray< TInt > *, const CDesCArray *, ImageEditorUtils::TMemorySelection)
IMPORT_C TIntGenerateNewFileNameL(RFs &, const TDesC &, TDes &, TFileName, const CDesCArray *)
IMPORT_C voidGetMakeAndModelL(TDes8 &, TDes8 &)
IMPORT_C TBoolImageFitsToDriveL(RFs &, const TDesC &, const TDesC &)
IMPORT_C TBoolImagesFitToDriveL(RFs &, const CDesCArray &, const CDesCArray &)
IMPORT_C voidNotifyNewMediaDocumentL(RFs &, const TDesC &)
IMPORT_C voidNotifyNewMediaDocumentL(RFs &, const MDesCArray &)
Private Member Functions
voidDoCopyL(RFs &, const TDesC &, const TDesC &, TUint)
TBool FileAlreadyExistsL(RFs &, const TDesC &, const CDesCArray *)
TInt FindSuffix(const TDesC &)
Public Member Enumerations
enumTMemoryLocation { EPhone, EMmc, EMixed }
enumTMemorySelection { ESelectAutomatic, ESelectPhone, ESelectMmc }

Member Functions Documentation

AddImageFileToAlbumL(const TDesC &, TInt)

IMPORT_C voidAddImageFileToAlbumL(const TDesC &aFileName,
TIntaAlbumId
)[static]

Adds the given image file to the given album (e.g. video album). If compiled without album support, this function does nothing.

Since
S60 v5.0

Parameters

const TDesC & aFileNamefile name to be added to the album
TInt aAlbumIdid of the album

CopyFile(RFs &, const TDesC &, const TDesC &, TBool)

IMPORT_C TIntCopyFile(RFs &aFsSession,
const TDesC &aSourceFileName,
const TDesC &aDestinationFileName,
TBoolaOverwrite = ETrue
)[static]

Copies file without opening it, using RFs::ReadFileSection. Synchronous.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFileNamesource file name
const TDesC & aDestinationFileNamedestination file name
TBool aOverwrite = ETrue

DoCopyL(RFs &, const TDesC &, const TDesC &, TUint)

voidDoCopyL(RFs &aFsSession,
const TDesC &aSourceFileName,
const TDesC &aDestinationFileName,
TUintaSourceFileSize
)[private, static]

Internal implementation of CopyFile

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFileNamesource file
const TDesC & aDestinationFileNamedestination file
TUint aSourceFileSizesource file size in bytes

FileAlreadyExistsL(RFs &, const TDesC &, const CDesCArray *)

TBool FileAlreadyExistsL(RFs &aFsSession,
const TDesC &aFileName,
const CDesCArray *aReservedFileNames
)[private, static]

Checks if a file with the specified name already exists in the system.

Since
S60 v5.0

Parameters

RFs & aFsSession
const TDesC & aFileNamefile name to be checked
const CDesCArray * aReservedFileNamesexplicitly recerved file names

FindAlbumsForImageFileL(RArray< TInt > &, const TDesC &)

IMPORT_C voidFindAlbumsForImageFileL(RArray< TInt > &aAlbumIdList,
const TDesC &aFilename
)[static]

Finds out in which Media Gallery Album the file belongs to. If compiled without album support, this function returns an empty array. Reset() is called for the array at the begining.

Since
S60 v5.0

Parameters

RArray< TInt > & aAlbumIdList
const TDesC & aFilename

FindSuffix(const TDesC &)

TInt FindSuffix(const TDesC &aName)[private, static]

Finds the offset of the edited image suffix of form "-NNN", where NNN is the edit sequence number.

Since
S60 v5.0

Parameters

const TDesC & aNameimage name without extension

GenerateFilePathL(RFs &, const TDesC &, TDes &, ImageEditorUtils::TMemorySelection)

IMPORT_C TIntGenerateFilePathL(RFs &aFsSession,
const TDesC &aSourceFileName,
TDes &aTargetFileName,
ImageEditorUtils::TMemorySelectionaMemoryInUse
)[static]

GenerateFilePath

Generates a path for an image file. The memory selection option is given as a parameter. ImageEditorUtilsImageFitsToDriveL is used to check the space.

Media gallery album id list is no longer supported due to Media Gallery removal. If an invalid album list is passed the behaviour is undefined.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFileNamesource file name
TDes & aTargetFileNametarget file name
ImageEditorUtils::TMemorySelection aMemoryInUsewhere the target file is created

GenerateNewDocumentNameL(RFs &, const TDesC &, TDes &, RArray< TInt > *, const CDesCArray *, ImageEditorUtils::TMemorySelection)

IMPORT_C TIntGenerateNewDocumentNameL(RFs &aFsSession,
const TDesC &aSourceFileName,
TDes &aTargetFileName,
RArray< TInt > *aMgAlbumIdList = NULL,
const CDesCArray *aReservedFileNames = NULL,
ImageEditorUtils::TMemorySelectionaMemoryInUse = ImageEditorUtils::ESelectAutomatic
)[static]

Generates a new name for the loaded document at the startup. If automatic memory selection is used, the generated file is located on the MMC dy default. If the MMC is full or not present, the file will be in phone memory. Optionally the file can be forced onto either drive. Internally, ImageFitsToDriveL is used to check the space.

Media gallery album id list is no longer supported due to Media Gallery removal. If an invalid album list is passed the behaviour is undefined.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFileNamesource file name
TDes & aTargetFileNametarget file name
RArray< TInt > * aMgAlbumIdList = NULLlist of the albums the source image belongs to
const CDesCArray * aReservedFileNames = NULLadditional list of already reserved file names
ImageEditorUtils::TMemorySelection aMemoryInUse = ImageEditorUtils::ESelectAutomaticwhere the target file is created

GenerateNewFileNameL(RFs &, const TDesC &, TDes &, TFileName, const CDesCArray *)

IMPORT_C TIntGenerateNewFileNameL(RFs &aFsSession,
const TDesC &aSourceFileName,
TDes &aTargetFileName,
TFileNameaDrive,
const CDesCArray *aReservedFileNames = NULL
)[static]

Generates a new name for the loaded document in filename query. A unique filename is generated by adding running number after source filename until unique name is found. e.g. if image name is "Image", first attempt for new filename is "Image-001". If that is already in use, "Image-002" is tried and so on. First unused filename is then proposed for the user. ImageFitsToDriveL is used to check the space.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFileNamesource file name
TDes & aTargetFileNametarget file name
TFileName aDrivethe drive where the target file is to be created
const CDesCArray * aReservedFileNames = NULLadditional list of already reserved file names

GetMakeAndModelL(TDes8 &, TDes8 &)

IMPORT_C voidGetMakeAndModelL(TDes8 &aMake,
TDes8 &aModel
)[static]

Helper function to get the manufacturer and model of the device. Uses Shared Data client to retrieve the information. If compiled on a public SDKs, which do not contain shared data, this returns empty descriptors.

Since
S60 v5.0

Parameters

TDes8 & aMakemanufacturer of the device
TDes8 & aModelmodel of the device

ImageFitsToDriveL(RFs &, const TDesC &, const TDesC &)

IMPORT_C TBoolImageFitsToDriveL(RFs &aFsSession,
const TDesC &aSourceFile,
const TDesC &aTargetPath
)[static]

Checks whether there is enough disk space to save the given file.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aSourceFilethe file that would be saved
const TDesC & aTargetPaththe path to save (only drive part needed)

ImagesFitToDriveL(RFs &, const CDesCArray &, const CDesCArray &)

IMPORT_C TBoolImagesFitToDriveL(RFs &aFsSession,
const CDesCArray &aSourceFileList,
const CDesCArray &aTargetFileList
)[static]

Checks whether there is enough disk space to save the given list of files.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const CDesCArray & aSourceFileListthe files that would be saved
const CDesCArray & aTargetFileListthe paths to save (only drive part needed)

NotifyNewMediaDocumentL(RFs &, const TDesC &)

IMPORT_C voidNotifyNewMediaDocumentL(RFs &aFsSession,
const TDesC &aFileName
)[static]

Notifies the system that a new image has been saved, This is depreciated now and not used after MediaGallery removal.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const TDesC & aFileNamename of the new file

NotifyNewMediaDocumentL(RFs &, const MDesCArray &)

IMPORT_C voidNotifyNewMediaDocumentL(RFs &aFsSession,
const MDesCArray &aFileNameArray
)[static]

Notifies the system that new images have been saved, making them visible in the Media Gallery. This is depreciated now and not used after MediaGallery removal.

Since
S60 v5.0

Parameters

RFs & aFsSessionfile server session handle
const MDesCArray & aFileNameArraynew file names

Member Enumerations Documentation

Enum TMemoryLocation

Memory location

Enumerators

EPhone
EMmc
EMixed

Enum TMemorySelection

Memory location selection options

Enumerators

ESelectAutomatic
ESelectPhone
ESelectMmc