class ContentAccess::CAgentResolver : public CActive |
Used to identify the Content Access Agent who handles a particular file.
CAgentResolver builds an array of CAgentInfo objects. Each CAgentInfo object holds metadata related to a particular agent implementation.
Content to the Agent which manages it
Supplier mime-types to the agent which imports files with that mime type.
Public Member Functions | |
---|---|
~CAgentResolver () | |
CAgentInfo & | AgentInfo ( TInt ) |
TInt | AgentInfoCount () |
CAgentInfo & | AgentInfoL (const TUid &) |
CAgentInfo & | AgentInfoL (const TDesC &) |
IMPORT_C const RArray < TPtrC8 > & | ConsumerMimeTypes () |
HBufC * | ConvertAgentFileNameL (const TDesC &) |
TUid | DefaultAgentUid () |
IMPORT_C TBool | DoRecognizeL (const TDesC &, const TDesC8 &, TDes8 &, TDes8 &) |
IMPORT_C CAgentResolver * | NewL (const TBool ) |
IMPORT_C CAgentResolver * | NewLC (const TBool ) |
IMPORT_C TInt | PreferredBufferSize () |
CAgentInfo & | ResolveConsumerMime (const TDesC8 &) |
TUid | ResolveDirectory (const TDesC &, TDes &, TBool &) |
CAgentInfo & | ResolveFileL ( RFile &) |
CAgentInfo & | ResolveFileL (const TDesC &, TDes &, TContentShareMode ) |
CAgentInfo & | ResolveSupplierMimeL (const TDesC8 &) |
IMPORT_C const RArray < TPtrC8 > & | SupplierMimeTypes () |
Private Member Functions | |
---|---|
CAgentResolver (const TBool ) | |
void | AddAgentL (const CImplementationInformation &) |
void | BuildListOfAgentsL () |
void | CleanImplArray ( TAny *) |
void | ConstructL () |
void | DestroyListOfAgents () |
void | DoCancel () |
TBool | IsF32Agent ( CAgentInfo &) |
void | RunL () |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
RPointerArray < CAgentInfo > | iAgentInfos |
RArray < TPtrC8 > | iConsumerMimeTypes |
CAgentInfo * | iDefaultAgent |
const TBool | iDynamicAgentUpdate |
REComSession * | iEcomSession |
RArray < TPtrC8 > | iSupplierMimeTypes |
Inherited Attributes | |
---|---|
CActive::iStatus |
CAgentResolver | ( | const TBool | aDynamicAgentUpdate | ) | [private] |
const TBool aDynamicAgentUpdate |
void | AddAgentL | ( | const CImplementationInformation & | aImplInfo | ) | [private] |
Add an agent to the list of agents
const CImplementationInformation & aImplInfo |
CAgentInfo & | AgentInfo | ( | TInt | aIndex | ) | const |
Reference an agent in the iAgentInfos array by index
TInt aIndex |
CAgentInfo & | AgentInfoL | ( | const TUid & | aUid | ) | const |
Find an agent by it's Uid
const TUid & aUid |
CAgentInfo & | AgentInfoL | ( | const TDesC & | aAgentName | ) | const |
Find an agent by it's name
const TDesC & aAgentName |
void | BuildListOfAgentsL | ( | ) | [private] |
Builds a list of all the Content Access Agents.
void | CleanImplArray | ( | TAny * | aArray | ) | [private, static] |
TAny * aArray |
IMPORT_C const RArray < TPtrC8 > & | ConsumerMimeTypes | ( | ) | const |
Accessor for the ConsumerMimeTypes array.
Planning to remove this from the CAF API
HBufC * | ConvertAgentFileNameL | ( | const TDesC & | aFileName | ) | const |
Converts a filename containing the agent SID to the filename containing the agent name.
const TDesC & aFileName | The filename in the form "c:\\private\\12345678\\" |
void | DoCancel | ( | ) | [private, virtual] |
Implements cancellation of an outstanding request.
This function is called as part of the active object's Cancel() .
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel() must not wait for event completion; this is handled by Cancel() .
IMPORT_C TBool | DoRecognizeL | ( | const TDesC & | aName, |
const TDesC8 & | aBuffer, | |||
TDes8 & | aFileMimeType, | |||
TDes8 & | aContentMimeType | |||
) |
Determines the MIME types of the a file and the mime type of its contents.
This function should only be used by the CAF recogizer DLL.
const TDesC & aName | The file name/URI to be investigated. |
const TDesC8 & aBuffer | A buffer containing bytes from the start of the file. |
TDes8 & aFileMimeType | If the file is recognized this will be populated with the mime type of the file. |
TDes8 & aContentMimeType | If the file is recognized this will be populated with the mime type of the content object within the file. |
TBool | IsF32Agent | ( | CAgentInfo & | aAgentInfo | ) | [private] |
Is this the F32 Agent
CAgentInfo & aAgentInfo | The agentinfo representing the agent |
IMPORT_C CAgentResolver * | NewL | ( | const TBool | aDynamicAgentUpdate | ) | [static] |
const TBool aDynamicAgentUpdate | ETrue if the CAgentResolver should update its list of agents when new agents appear. A CActiveScheduler must already be running when ETrue is supplied |
IMPORT_C CAgentResolver * | NewLC | ( | const TBool | aDynamicAgentUpdate | ) | [static] |
const TBool aDynamicAgentUpdate | ETrue if the CAgentResolver should update its list of agents when new agents appear. A CActiveScheduler must already be running when ETrue is supplied |
IMPORT_C TInt | PreferredBufferSize | ( | ) |
Gets the preferred buffer size for recognizing files using the RecognizeFile() function.
This function should only be used by the CAF recogizer DLL.
CAgentInfo & | ResolveConsumerMime | ( | const TDesC8 & | aMimeType | ) | const |
Finds the agent that handles the given consumer MIME type.
Planning to remove this from the CAF API
const TDesC8 & aMimeType | MIME type of the file |
TUid | ResolveDirectory | ( | const TDesC & | aPath, |
TDes & | aActualPath, | |||
TBool & | aThePrivateDir | |||
) | const |
Find the agent who owns a directory
This function also maps a path from the agent directory name to it's actual name in the file system.
ie. For example if an agent "x" has files stored in a private server directory "c:\\private\\12345678\\"
The file appear as "c:\\private\\x\\" to applications using CAF. This function converts "c:\\private\\x\\" back to "c:\\private\\12345678\\"
CAgentInfo & | ResolveFileL | ( | RFile & | aFile | ) | const |
Finds the agent that handles a file.
RFile & aFile | Handle of the file to be resolved. |
CAgentInfo & | ResolveFileL | ( | const TDesC & | aUri, |
TDes & | aActualUri, | |||
TContentShareMode | aShareMode = EContentShareReadOnly | |||
) | const |
Finds the agent that handles a file and returns the actual URI of the content.
If the aUri is of the form "c:\\private\\agent_name\\" it will be translated to the form "c:\\private\\SID\\" in aActualUri. Otherwise the aUri is just copied to aActualUri
CAgentInfo & | ResolveSupplierMimeL | ( | const TDesC8 & | aMimeType | ) | const |
Finds the agent that handles the given supplier MIME type.
const TDesC8 & aMimeType | MIME type from the supplier application. |
void | RunL | ( | ) | [private, virtual] |
Handles an active object's request completion event.
A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.
The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.
Before calling this active object's RunL() function, the active scheduler has:
1. decided that this is the highest priority active object with a completed request
2. marked this active object's request as complete (i.e. the request is no longer outstanding)
RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.
Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.
CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD
IMPORT_C const RArray < TPtrC8 > & | SupplierMimeTypes | ( | ) | const |
Accessor for the SupplierMimeTypes array.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.