Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

AIW Generic Parameters API

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: ltomuta (16 Jun 2007)
Last edited: hamishwillee (30 May 2013)

Note.pngNote: This API is not part of the public SDK. It can be found in the SDK API Plug-in.

The AIW Generic Parameter API can be used to provide the means for handling AIW generic parameters to the AIW consumer applications. The generic parameters are used for transferring data between AIW consumers and providers.

Use cases

The main uses of AIW Generic parameter API are the following:

Creating a generic parameter list with basic types

Creating a generic parameter list with provider specific objects.

Example code

Creating a generic parameter list with basic types

The example code here demonstrates how to create a generic parameter list and fill it with file name (descriptor) and error code (integer) items. This is the way how to pass the most common types of parameters to the AIW providers that do not need provider specific objects.

Header files

#include <AiwGenericParam.h>
// Create a list and put it into the cleanup stack.
CAiwGenericParamList* list = CAiwGenericParamList::NewLC();
// Set up and append file name parameter.
_LIT(KMyFileName, "c:\\data\\testfile.txt");
TFileName filename(KMyFileName);
TAiwGenericParam param(EGenericParamFile);
// Set up and append error code parameter.
// The list can now be passed e.g. by calling Service Handler's
// ExecuteMenuCmdL() or ExecuteServiceCmdL().
// Pop and destroy the list when it is not needed anymore.

There may be as many items as required on the list with the same semantic id. The receiving application uses iterator methods in the CAiwGenericParamList class for accessing data items on the list.

The AIW framework contains convenience methods for creating input and output lists. By using the lists, the consumer application does not have to take care of allocating the list from a heap or deleting it afterwards. The only limitation is that only one input and one output list can be requested simultaneously. If more are required, the consumer application must create and delete them by itself. The methods for creating input and output lists are defined as follows:

CAiwGenericParamList& CAiwServiceHandler::InParamListL();
CAiwGenericParamList& CaiwServiceHandler::OutParamListL();

Creating a generic parameter list with provider specific objects

If a provider specific class or struct needs to be transferred between a consumer and a provider, it needs to be serialized by using e.g. a TPtrC8 or TPckg type before adding it to a generic parameter list. The variant type id EVariantTypeDesC8 should be used for these kind of parameters. It should also be noted that the AIW framework does not support passing pointers. See Map and Navigation AIW provider documentation for an example.

Example project

This page was last modified on 30 May 2013, at 04:36.
61 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.