EPOC   SDK Home Glossary Indexes Previous Next Up

CWriteFaxFile class


Contents


CWriteFaxFile class — Open a fax file for writing

Section Contents


Overview

Derivation

CBase

Abstract: CBase behaviour.

Defined in

faxstore.h

Link against

faxst2.lib

Description

This class is used to create and open a fax file for writing.

The class provides the functionality to create a fax file, to commit pages to the fax file, to abort and delete the file, and to close the file. The ability to add individual fax pages to the store is provided through the CWriteFaxPages data member, which is created when the file is opened.

For more information about creating fax files see Storing a fax file and Using CWriteFaxFile.


Construction and destruction


NewL() — Static constructor for CWriteFaxFile object

static CWriteFaxFile* NewL();

Description

This function constructs a CWriteFaxFile object, which offers the public API for creating a fax store file.

Return value

CWriteFaxFile*

A pointer to the newly created object.

Note

~CWriteFaxFile() — Destructor

~CWriteFaxFile();

Description

The destructor closes the session with the file server, and frees all resources owned by the object, prior to its destruction.


Member functions


OpenL() — Open/create fax file

void OpenL(const TDesC& aFileName,TInt aMaxScanLinesInBand);

Description

This function creates and opens a fax file for writing.

The function also allocates memory to create a CWriteFaxPages object — which is pointed to by the class data member. This object defines the API for writing pages to the file store.

Fax files which have been opened should be paired with a Close() function.

Arguments

const TDesC& aFileName

The name of the new fax file.

TInt aMaxScanLinesInBand

The maximum number of scan lines in a band.

Fax pages are stored in bands for quick retrieval/display. If zero is passed then it will default to 64 — otherwise the passed value will take effect.


CommitL() — Commit fax page

void CommitL();

Description

This function commits the current fax page — created using the CWriteFaxPages API — to the fax file.

Committing a page writes it to the fax file, rather than storing it in temporary memory. The function should be called after each page is added, to ensure that only one fax page can be lost if there is an out of memory error.


Close() — Close fax file

void Close();

Description

This function closes the fax file, and deletes the resources owned by the object.

Although this function is called in the destructor, it is good programming practice to invoke it manually to pair previous OpenL() calls.


AbortWrite() — Abort fax file write

void AbortWrite();

Description

This function aborts the creation of the fax store file, and then deletes the file. It can be called by developer programs, and is called automatically if OpenL() leaves.


Data members

CWriteFaxPages* iWriteFaxPages

A pointer to the object which can be used to add pages to the file. Memory is allocated for the object when the file is opened.

EPOC       SDK Home Glossary Indexes Previous Next Up