connectionutilities/ConnectionDialogs/src/ConnectionDialogsNotifBase.cpp
branchRCL_3
changeset 57 05bc53fe583b
parent 45 4c83dcfb6f1a
child 58 83ca720e2b9a
equal deleted inserted replaced
55:fc7b30ed2058 57:05bc53fe583b
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 
    20 
    21 #include <e32property.h>
    21 #include "ConnectionDialogsNotifBase.h"
    22 #include <ScreensaverInternalPSKeys.h>
    22 
    23 #include <coreapplicationuisdomainpskeys.h>
       
    24 #include <bautils.h>
    23 #include <bautils.h>
    25 #include <eikenv.h>
    24 #include <eikenv.h>
    26 #include <data_caging_path_literals.hrh>
    25 #include <data_caging_path_literals.hrh>
    27 
    26 
    28 #include "ConnectionDialogsLogger.h"
       
    29 #include "ConnectionDialogsNotifBase.h"
       
    30 
       
    31 #ifdef _DEBUG
       
    32 #include <e32debug.h>
       
    33 #endif
       
    34 
    27 
    35 // CONSTANTS
    28 // CONSTANTS
    36 
    29 
    37 // ROM folder
    30 // ROM folder
    38 _LIT( KDriveZ, "z:" );
    31 _LIT( KDriveZ, "z:" );
    93 // ---------------------------------------------------------
    86 // ---------------------------------------------------------
    94 // CConnectionDialogsNotifBase::CConnectionDialogsNotifBase()
    87 // CConnectionDialogsNotifBase::CConnectionDialogsNotifBase()
    95 // ---------------------------------------------------------
    88 // ---------------------------------------------------------
    96 //
    89 //
    97 CConnectionDialogsNotifBase::CConnectionDialogsNotifBase()
    90 CConnectionDialogsNotifBase::CConnectionDialogsNotifBase()
    98 : iCancelled( EFalse ), 
    91 : iReplySlot( 0 ),
       
    92   iCancelled( EFalse ),
    99   iResource( 0 )
    93   iResource( 0 )
   100     {
    94     {
       
    95     iInfo.iUid = TUid::Null();
       
    96     iInfo.iChannel = TUid::Null();
       
    97     iInfo.iPriority = 0;
   101     }
    98     }
   102 
    99 
   103 
   100 
   104 // ---------------------------------------------------------
   101 // ---------------------------------------------------------
   105 // void CConnectionDialogsNotifBase::ConstructL()
   102 // void CConnectionDialogsNotifBase::ConstructL()
   135         {
   132         {
   136         CCoeEnv::Static()->DeleteResourceFile( iResource );        
   133         CCoeEnv::Static()->DeleteResourceFile( iResource );        
   137         }
   134         }
   138     }
   135     }
   139 
   136 
   140 // ---------------------------------------------------------
       
   141 // CConnectionDialogsNotifBase::ScreenSaverOn()
       
   142 // ---------------------------------------------------------
       
   143 //
       
   144 TBool CConnectionDialogsNotifBase::ScreenSaverOn()
       
   145     {
       
   146     TInt err( KErrNone );
       
   147     TInt screenSaverOn( 0 );
       
   148 
       
   149     // Cancel the dialog if screen saver is on.
       
   150     err = RProperty::Get( KPSUidScreenSaver, 
       
   151             KScreenSaverOn, 
       
   152             screenSaverOn );
       
   153     
       
   154     return (err == KErrNone && screenSaverOn > 0); 
       
   155     }
       
   156 
       
   157 // ---------------------------------------------------------
       
   158 // CConnectionDialogsNotifBase::AutolockOn()
       
   159 // ---------------------------------------------------------
       
   160 //
       
   161 TBool CConnectionDialogsNotifBase::AutolockOn()
       
   162     {
       
   163     TBool retval( EFalse );
       
   164 
       
   165     CLOG_ENTERFN( "CConnectionDialogsNotifBase::AutolockOn" );
       
   166     
       
   167 #ifdef RD_STARTUP_CHANGE
       
   168     TInt err( KErrNone );
       
   169     TInt autolockOn( 0 );
       
   170     // Cancel the dialog if screen saver is on.
       
   171     err = RProperty::Get( KPSUidCoreApplicationUIs, 
       
   172             KCoreAppUIsAutolockStatus, 
       
   173             autolockOn );
       
   174     // In boot there may come EAutolockStatusUninitialized, when it should be EAutolockOn...
       
   175     retval = (err == KErrNone && autolockOn != EAutolockOff); 
       
   176 
       
   177 #ifdef _DEBUG
       
   178     RDebug::Print( _L("CConnectionDialogsNotifBase::AutolockOn: autolockOn: %d"), autolockOn );
       
   179     RDebug::Print( _L("CConnectionDialogsNotifBase::AutolockOn: err: %d"), err );
       
   180     RDebug::Print( _L("CConnectionDialogsNotifBase::AutolockOn: %d"), retval );
       
   181 #endif
       
   182     
       
   183 #endif // RD_STARTUP_CHANGE
       
   184     
       
   185     CLOG_LEAVEFN( "CConnectionDialogsNotifBase::AutolockOn" );
       
   186 
       
   187     return retval; 
       
   188     }
       
   189 
   137 
   190 
   138 
   191 // End of File
   139 // End of File