widgets/widgetapp/src/cpspublisher.cpp
changeset 1 7c90e6132015
parent 0 dd21522fd290
child 10 a359256acfc6
equal deleted inserted replaced
0:dd21522fd290 1:7c90e6132015
    20 
    20 
    21 #include <LiwServiceHandler.h>
    21 #include <LiwServiceHandler.h>
    22 #include <LiwVariant.h>
    22 #include <LiwVariant.h>
    23 #include <LiwGenericParam.h>
    23 #include <LiwGenericParam.h>
    24 #include <Liwcommon.h>
    24 #include <Liwcommon.h>
    25 
    25 #include <liwcommon.hrh>
    26 #include <AknsFrameBackgroundControlContext.h>
    26 #include <AknsFrameBackgroundControlContext.h>
    27 #include <fbs.h>
    27 #include <fbs.h>
    28 #include <aknsdrawutils.h> 
    28 #include <aknsdrawutils.h> 
    29 
    29 
    30 
    30 
   147     return self;
   147     return self;
   148     }
   148     }
   149 
   149 
   150 CCpsPublisher::~CCpsPublisher()
   150 CCpsPublisher::~CCpsPublisher()
   151     {
   151     {
       
   152     
       
   153     TRAP_IGNORE(ExecuteRegistrationCommandL( KLiwOptCancel ));
       
   154     
   152     if( iCpsInterface )
   155     if( iCpsInterface )
   153         {
   156         {
   154         iCpsInterface->Close();
   157         iCpsInterface->Close();
   155         iCpsInterface = NULL;
   158         iCpsInterface = NULL;
   156         }
   159         }
   159         iServiceHandler->Reset();
   162         iServiceHandler->Reset();
   160         delete iServiceHandler;
   163         delete iServiceHandler;
   161         iServiceHandler = NULL;
   164         iServiceHandler = NULL;
   162         }
   165         }
   163     delete iMaskBitmap;
   166     delete iMaskBitmap;
       
   167 __UHEAP_MARKEND;    
   164     }
   168     }
   165 
   169 
   166 CLiwDefaultMap* ElementSizeFilterLC()
   170 CLiwDefaultMap* ElementSizeFilterLC()
   167     {
   171     {
   168     //Create filter criteria for requested entries in form of LIW map:
   172     //Create filter criteria for requested entries in form of LIW map:
   194     
   198     
   195     }
   199     }
   196 
   200 
   197 void CCpsPublisher::ConstructL()
   201 void CCpsPublisher::ConstructL()
   198     {
   202     {
       
   203     __UHEAP_MARK;
   199     RDebug::Printf("CCpsPublisher::InitCPS");
   204     RDebug::Printf("CCpsPublisher::InitCPS");
   200     InitCpsInterfaceL();
   205     InitCpsInterfaceL();
   201     RDebug::Printf("CCpsPublisher::Register");
   206     RDebug::Printf("CCpsPublisher::Register");
   202     ExecuteRegistrationCommandL( 0 );
   207     ExecuteRegistrationCommandL( 0 );
   203     RDebug::Printf("CCpsPublisher::GetBitmapSize");
   208     RDebug::Printf("CCpsPublisher::GetBitmapSize");
   247     }
   252     }
   248     
   253     
   249 void CCpsPublisher::ExecuteRegistrationCommandL( 
   254 void CCpsPublisher::ExecuteRegistrationCommandL( 
   250     TUint aOption )
   255     TUint aOption )
   251     {
   256     {
   252     __UHEAP_MARK;
       
   253     CLiwDefaultMap* filter = ElementSizeFilterLC();
   257     CLiwDefaultMap* filter = ElementSizeFilterLC();
   254     filter->InsertL( KOperation, TLiwVariant( KUpdate ));
   258     filter->InsertL( KOperation, TLiwVariant( KUpdate ));
   255     
   259     
   256     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   260     CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
   257     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   261     CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
   268                 this );
   272                 this );
   269     
   273     
   270     outParamList.Reset();
   274     outParamList.Reset();
   271     inParamList.Reset(); 
   275     inParamList.Reset(); 
   272     CleanupStack::PopAndDestroy( filter );
   276     CleanupStack::PopAndDestroy( filter );
   273     __UHEAP_MARKEND;
       
   274     }
   277     }
   275 
   278 
   276 TInt CCpsPublisher::HandleNotifyL(
   279 TInt CCpsPublisher::HandleNotifyL(
   277     TInt /*aCmdId*/,
   280     TInt /*aCmdId*/,
   278     TInt /*aEventId*/,
   281     TInt /*aEventId*/,