Namespaces

Variants
Actions

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.

Assign Image to contact using AIW service

From Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: judith14 (29 Feb 2008)
Last edited: hamishwillee (27 Jul 2012)

Overview

Application Interworking (AIW) framework is a mechanism for dynamically adding features and functionality to applications without statically linking to the existing code. Contact application provides ‘Assign’ AIW service through which we can assign image or Ringtone to existing contact.

Here is the code to assign image to contact.


Header file

#include <AiwServiceHandler.h>
#include <aiwgenericparam.h>
class CContactAIWAssign31AppUi : public CAknAppUi
{
public:
 

 
// From MEikMenuObserver
void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
 
//For Passing parameters
void AiwParamListLC( CAiwGenericParamList& aParamList ) const;
 
public:
CAiwServiceHandler* iServiceHandler;
 
};

Source file

void CContactAIWAssign31AppUi::ConstructL()
{
iServiceHandler = CAiwServiceHandler::NewL();
//Attach menu services
iServiceHandler->AttachMenuL(R_CONTACTAIWASSIGN31_MENU,R_ASSIGN_INTEREST);
}
 
void CContactAIWAssign31AppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
default:
CAiwGenericParamList& inList = iServiceHandler->InParamListL();
AiwParamListLC(inList);
iServiceHandler->ExecuteMenuCmdL(aCommand,inList,iServiceHandler->OutParamListL(),0,NULL);
break;
}
}
 
void CContactAIWAssign31AppUi::DynInitMenuPaneL(
TInt aResourceId, CEikMenuPane* aMenuPane)
{
if (iServiceHandler -> IsAiwMenu(aResourceId))
{
//Create in param list
CAiwGenericParamList& inList = iServiceHandler->InParamListL();
AiwParamListLC(inList);
iServiceHandler->InitializeMenuPaneL(*aMenuPane,aResourceId,EAIWMenuPlaceHolder,inList);
}
}
 
void CContactAIWAssign31AppUi::AiwParamListLC(CAiwGenericParamList& aParamList) const
{
_LIT(KFilename,"C:\\Sample1.jpg");
_LIT(KFileMime,"image/jpeg");
 
// Append Filepath as parameter
TAiwVariant varFile(KFilename);
TAiwGenericParam paramFile( EGenericParamFile, varFile );
aParamList.AppendL( paramFile );
 
//Append Mime type(for Image - image/jpeg)
TAiwVariant varMime(KFileMime);
TAiwGenericParam paramMime( EGenericParamMIMEType, varMime );
aParamList.AppendL( paramMime );
 
}
This page was last modified on 27 July 2012, at 05:26.
35 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.

×