uifw/AvKon/src/akndiscreetpopupserverhandler.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
    18 
    18 
    19 #include <eikcmobs.h>
    19 #include <eikcmobs.h>
    20 #include <avkon.hrh>
    20 #include <avkon.hrh>
    21 #include "akndiscreetpopupserverhandler.h"
    21 #include "akndiscreetpopupserverhandler.h"
    22 #include "akndiscreetpopupdata.h"
    22 #include "akndiscreetpopupdata.h"
    23 
    23 #include "akntrace.h"
    24 
    24 
    25 // ======== MEMBER FUNCTIONS ========
    25 // ======== MEMBER FUNCTIONS ========
    26 
    26 
    27 // ---------------------------------------------------------------------------
    27 // ---------------------------------------------------------------------------
    28 // CAknDiscreetPopupServerHandler::NewL
    28 // CAknDiscreetPopupServerHandler::NewL
    55 // CAknDiscreetPopupServerHandler::~CAknDiscreetPopupServerHandler
    55 // CAknDiscreetPopupServerHandler::~CAknDiscreetPopupServerHandler
    56 // ---------------------------------------------------------------------------
    56 // ---------------------------------------------------------------------------
    57 //
    57 //
    58 CAknDiscreetPopupServerHandler::~CAknDiscreetPopupServerHandler()
    58 CAknDiscreetPopupServerHandler::~CAknDiscreetPopupServerHandler()
    59     {
    59     {
       
    60     _AKNTRACE_FUNC_ENTER;
    60     iLaunchers.ResetAndDestroy();
    61     iLaunchers.ResetAndDestroy();
    61     iUiServer.Close();
    62     iUiServer.Close();
       
    63     _AKNTRACE_FUNC_EXIT;
    62     }
    64     }
    63 
    65 
    64 
    66 
    65 // ---------------------------------------------------------------------------
    67 // ---------------------------------------------------------------------------
    66 // CAknDiscreetPopupServerHandler::LaunchGlobalPopup
    68 // CAknDiscreetPopupServerHandler::LaunchGlobalPopup
    85                                                     aCommandObserver, 
    87                                                     aCommandObserver, 
    86                                                     aCommandId,
    88                                                     aCommandId,
    87                                                     aPopupId,
    89                                                     aPopupId,
    88                                                     aAppUid,
    90                                                     aAppUid,
    89                                                     aViewUid );
    91                                                     aViewUid );
       
    92     CleanupStack::PushL( launcher );
    90     launcher->SetData(
    93     launcher->SetData(
    91         aTitle,
    94         aTitle,
    92         aText,
    95         aText,
    93         aSkinId,
    96         aSkinId,
    94         aBitmapFile,
    97         aBitmapFile,
    95         aBitmapId,
    98         aBitmapId,
    96         aMaskId,
    99         aMaskId,
    97         aFlags );
   100         aFlags );
    98     iLaunchers.AppendL( launcher );
   101     iLaunchers.AppendL( launcher );
       
   102     CleanupStack::Pop( launcher );
    99     launcher->LaunchDiscreetPopup();
   103     launcher->LaunchDiscreetPopup();
   100     }
   104     }
   101 
   105 
   102 
   106 
   103 // ---------------------------------------------------------------------------
   107 // ---------------------------------------------------------------------------
   118                                                        aCommandObserver, 
   122                                                        aCommandObserver, 
   119                                                        aCommandId,
   123                                                        aCommandId,
   120                                                        aPopupId,
   124                                                        aPopupId,
   121                                                        aAppUid,
   125                                                        aAppUid,
   122                                                        aViewUid );
   126                                                        aViewUid );
       
   127     CleanupStack::PushL( launcher );
   123     launcher->SetData( 
   128     launcher->SetData( 
   124             aResourceId,
   129             aResourceId,
   125             aResourceFile );
   130             aResourceFile );
   126     iLaunchers.AppendL( launcher );
   131     iLaunchers.AppendL( launcher );
       
   132     CleanupStack::Pop( launcher );
   127     launcher->LaunchDiscreetPopup();
   133     launcher->LaunchDiscreetPopup();
   128     }
   134     }
   129 
   135 
   130 
   136 
   131 // ---------------------------------------------------------------------------
   137 // ---------------------------------------------------------------------------
   185 // CAknDiscreetPopupServerHandler::ConstructL
   191 // CAknDiscreetPopupServerHandler::ConstructL
   186 // ---------------------------------------------------------------------------
   192 // ---------------------------------------------------------------------------
   187 //
   193 //
   188 void CAknDiscreetPopupServerHandler::ConstructL()
   194 void CAknDiscreetPopupServerHandler::ConstructL()
   189     {
   195     {
       
   196     _AKNTRACE_FUNC_ENTER;
   190     User::LeaveIfError( iUiServer.Connect() );
   197     User::LeaveIfError( iUiServer.Connect() );
       
   198     _AKNTRACE_FUNC_EXIT;
   191     }
   199     }
   192 
   200 
   193 
   201 
   194 // ---------------------------------------------------------------------------
   202 // ---------------------------------------------------------------------------
   195 // CAknDiscreetPopupServerHandler::PopupIdInUse
   203 // CAknDiscreetPopupServerHandler::PopupIdInUse
   215 // CAknDiscreetPopupGlobalLauncher::~CAknDiscreetPopupGlobalLauncher
   223 // CAknDiscreetPopupGlobalLauncher::~CAknDiscreetPopupGlobalLauncher
   216 // ---------------------------------------------------------------------------
   224 // ---------------------------------------------------------------------------
   217 //
   225 //
   218 CAknDiscreetPopupGlobalLauncher::~CAknDiscreetPopupGlobalLauncher()
   226 CAknDiscreetPopupGlobalLauncher::~CAknDiscreetPopupGlobalLauncher()
   219     {
   227     {
       
   228     _AKNTRACE( "[%s][%s] Enter ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   220     if ( IsActive() && iHandler )
   229     if ( IsActive() && iHandler )
   221         {
   230         {
   222         // Cancel request using status handle
   231         // Cancel request using status handle
   223         TAknDiscreetPopupCancelRequestData cancelData;
   232         TAknDiscreetPopupCancelRequestData cancelData;
   224         cancelData.SetStatusHandle( ( TUint ) &iStatus );
   233         cancelData.SetStatusHandle( ( TUint ) &iStatus );
   225         iHandler->UiServer()->DoDiscreetPopupAction( &cancelData );
   234         iHandler->UiServer()->DoDiscreetPopupAction( &cancelData );
   226         }
   235         }
   227     Cancel();
   236     Cancel();
       
   237     _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   228     }
   238     }
   229 
   239 
   230 
   240 
   231 // ---------------------------------------------------------------------------
   241 // ---------------------------------------------------------------------------
   232 // CAknDiscreetPopupGlobalLauncher::LaunchDiscreetPopup
   242 // CAknDiscreetPopupGlobalLauncher::LaunchDiscreetPopup
   233 // ---------------------------------------------------------------------------
   243 // ---------------------------------------------------------------------------
   234 //
   244 //
   235 void CAknDiscreetPopupGlobalLauncher::LaunchDiscreetPopup()
   245 void CAknDiscreetPopupGlobalLauncher::LaunchDiscreetPopup()
   236     {
   246     {
       
   247     _AKNTRACE( "[%s][%s] Enter ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   237     if ( IsActive() )
   248     if ( IsActive() )
   238         {
   249         {
       
   250         _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   239         return;
   251         return;
   240         }
   252         }
   241     RenewRequest();
   253     RenewRequest();
       
   254     _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   242     }
   255     }
   243 
   256 
   244 
   257 
   245 // ---------------------------------------------------------------------------
   258 // ---------------------------------------------------------------------------
   246 // CAknDiscreetPopupGlobalLauncher::RunL
   259 // CAknDiscreetPopupGlobalLauncher::RunL
   247 // ---------------------------------------------------------------------------
   260 // ---------------------------------------------------------------------------
   248 //
   261 //
   249 void CAknDiscreetPopupGlobalLauncher::RunL()
   262 void CAknDiscreetPopupGlobalLauncher::RunL()
   250     {
   263     {
       
   264     _AKNTRACE( "[%s][%s] Enter,  iStatus : %d", 
       
   265     		"CAknDiscreetPopupGlobalLauncher", __FUNCTION__, iStatus.Int() );
   251     if ( iStatus.Int() != KRequestPending )
   266     if ( iStatus.Int() != KRequestPending )
   252         {
   267         {
   253         if( iCommandObserver )
   268         if( iCommandObserver )
   254         	{
   269         	{
   255         	if( iStatus.Int() == KErrCompletion && iCommandId )
   270         	if( iStatus.Int() == KErrCompletion && iCommandId )
   265         }
   280         }
   266     else
   281     else
   267         {
   282         {
   268         RenewRequest();
   283         RenewRequest();
   269         }
   284         }
       
   285     _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalLauncher", __FUNCTION__ );
   270     }
   286     }
   271 
   287 
   272 
   288 
   273 // ---------------------------------------------------------------------------
   289 // ---------------------------------------------------------------------------
   274 // CAknDiscreetPopupGlobalLauncher::DoCancel
   290 // CAknDiscreetPopupGlobalLauncher::DoCancel
   312 //
   328 //
   313 void CAknDiscreetPopupGlobalLauncher::RenewRequest()
   329 void CAknDiscreetPopupGlobalLauncher::RenewRequest()
   314     {
   330     {
   315     if ( iHandler )
   331     if ( iHandler )
   316         {
   332         {
       
   333         _AKNTRACE( "CAknDiscreetPopupGlobalLauncher::RenewRequest, issue request." );
   317         iHandler->UiServer()->DoDiscreetPopupAction( PopupData(), &iStatus );
   334         iHandler->UiServer()->DoDiscreetPopupAction( PopupData(), &iStatus );
   318         }
   335         }
   319     SetActive();
   336     SetActive();
   320     }
   337     }
   321 
   338 
   339         const TInt& aCommandId,
   356         const TInt& aCommandId,
   340         const TInt& aPopupId,
   357         const TInt& aPopupId,
   341         const TUid& aAppUid,
   358         const TUid& aAppUid,
   342         const TUid& aViewUid )
   359         const TUid& aViewUid )
   343     {
   360     {
       
   361     _AKNTRACE( "[%s][%s] Enter ", "CAknDiscreetPopupGlobalParamLauncher", __FUNCTION__ );
   344     CAknDiscreetPopupGlobalParamLauncher* self = 
   362     CAknDiscreetPopupGlobalParamLauncher* self = 
   345         new ( ELeave ) CAknDiscreetPopupGlobalParamLauncher(
   363         new ( ELeave ) CAknDiscreetPopupGlobalParamLauncher(
   346                 aHandler, aObserver, aCommandId, aPopupId, aAppUid, aViewUid );
   364                 aHandler, aObserver, aCommandId, aPopupId, aAppUid, aViewUid );
   347     CleanupStack::PushL( self );
   365     CleanupStack::PushL( self );
   348     self->ConstructL();
   366     self->ConstructL();
   349     CleanupStack::Pop( self );
   367     CleanupStack::Pop( self );
       
   368     _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalParamLauncher", __FUNCTION__ );
   350     return self;
   369     return self;
   351     }
   370     }
   352 
   371 
   353 
   372 
   354 // ---------------------------------------------------------------------------
   373 // ---------------------------------------------------------------------------
   432         const TInt& aCommandId,
   451         const TInt& aCommandId,
   433         const TInt& aPopupId,
   452         const TInt& aPopupId,
   434         const TUid& aAppUid,
   453         const TUid& aAppUid,
   435         const TUid& aViewUid )
   454         const TUid& aViewUid )
   436     {
   455     {
       
   456     _AKNTRACE( "[%s][%s] Enter ", "CAknDiscreetPopupGlobalResourceLauncher", __FUNCTION__ );
   437     CAknDiscreetPopupGlobalResourceLauncher* self = 
   457     CAknDiscreetPopupGlobalResourceLauncher* self = 
   438         new ( ELeave ) CAknDiscreetPopupGlobalResourceLauncher(
   458         new ( ELeave ) CAknDiscreetPopupGlobalResourceLauncher(
   439                 aHandler, aObserver, aCommandId, aPopupId, aAppUid, aViewUid );
   459                 aHandler, aObserver, aCommandId, aPopupId, aAppUid, aViewUid );
   440     CleanupStack::PushL( self );
   460     CleanupStack::PushL( self );
   441     self->ConstructL();
   461     self->ConstructL();
   442     CleanupStack::Pop( self );
   462     CleanupStack::Pop( self );
       
   463     _AKNTRACE( "[%s][%s] Exit ", "CAknDiscreetPopupGlobalResourceLauncher", __FUNCTION__ );
   443     return self;
   464     return self;
   444     }
   465     }
   445 
   466 
   446 
   467 
   447 // ---------------------------------------------------------------------------
   468 // ---------------------------------------------------------------------------