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