iaupdate/IAD/backgroundchecker/src/iaupdatebgsoftnotification.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:22:02 +0100
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:    
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
// INCLUDE FILES
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    21
#include <AknDynamicSoftNotifier.h>
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    22
#include <AknDynamicSoftNotificationParams.h>
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "iaupdatebgsoftnotification.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include "iaupdatebginternalfilehandler.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include "iaupdatebgconst.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include "iaupdatebglogger.h"
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
// ============================ MEMBER FUNCTIONS ===============================
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
// CIAUpdateBGSoftNotification::NewLC
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
// Static constructor
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    36
CIAUpdateBGSoftNotification* CIAUpdateBGSoftNotification::NewL( MIAUpdateBGSoftNotificationCallBack* aCallback, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    37
                                                                CIAUpdateBGInternalFileHandler* aInternalFile )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    {   
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
    CIAUpdateBGSoftNotification* self =
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    40
        new ( ELeave ) CIAUpdateBGSoftNotification( aCallback, aInternalFile );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    CleanupStack::PushL( self );
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
    
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
    self->ConstructL();
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    CleanupStack::Pop( self );
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    return self;
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
// Destructor
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
//
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
CIAUpdateBGSoftNotification::~CIAUpdateBGSoftNotification()
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    55
    delete iSoftkey1;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    56
    delete iSoftkey2;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    58
    delete iLabel;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    59
    delete iGroupLabel;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    61
    delete iImageData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    62
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    63
    delete iNotifier;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
    }
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    65
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
// -----------------------------------------------------------------------------
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    67
// CIAUpdateBGSoftNotification::NotificationAccepted
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    68
// Dynamic soft notification was accepted by user.
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    71
void CIAUpdateBGSoftNotification::NotificationAccepted( TInt /*aIdentifier*/ )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    73
    FLOG("[bgchecker] softnotification callback function ACCEPTED");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    74
    //remove the soft notifiation id
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    75
    iInternalFile->SetSoftNotificationID( 0 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    76
    TRAP_IGNORE( iInternalFile->WriteControllerDataL() );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    78
    iCallback->SoftNotificationCallBack( ETrue );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
// -----------------------------------------------------------------------------
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    82
// CIAUpdateBGSoftNotification::NotificationCanceled
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    83
// Dynamic soft notification was canceled by user.
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    84
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    85
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    86
void CIAUpdateBGSoftNotification::NotificationCanceled( TInt /*aIdentifier*/ )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    87
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    88
    FLOG("[bgchecker] softnotification callback function Canceled");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    89
    //remove the soft notifiation id
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    90
    iInternalFile->SetSoftNotificationID( 0 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    91
    TRAP_IGNORE( iInternalFile->WriteControllerDataL() );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    92
          
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    93
    iCallback->SoftNotificationCallBack( EFalse );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    94
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    95
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    96
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    97
// CIAUpdateBGSoftNotification::ShowSoftNotificationL
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
    98
// Displays a soft notification
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   101
void CIAUpdateBGSoftNotification::ShowSoftNotificationL()
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   103
    TAknDynamicSoftNotificationParams param( KSoftNotificationPriority );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   104
    FillNotificationParams( param );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
    
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   106
    TInt oldId = iNotificationId;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   107
    iNotificationId =
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   108
        iNotifier->SetDynamicNotificationCountL( param, iNotificationId, 1 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   109
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   110
    if( oldId != iNotificationId )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   111
        {           
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   112
        FLOG("[bgchecker] softnotification save notification Id");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   113
        iInternalFile->SetSoftNotificationID( iNotificationId );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   114
        TRAP_IGNORE( iInternalFile->WriteControllerDataL() );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   115
        
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   116
        iNotifier->StopObserving( oldId );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   117
        iNotifier->StartObservingL( iNotificationId, this );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   118
        }
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
// -----------------------------------------------------------------------------
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   122
// CIAUpdateBGSoftNotification::RemoveSoftNotificationL
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   123
// Cancels and removes the soft notification
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   126
void CIAUpdateBGSoftNotification::RemoveSoftNotificationL( TInt aNotifierId )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   128
    if ( aNotifierId != 0 )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   129
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   130
        iNotifier->CancelDynamicNotificationL( aNotifierId );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   131
        }
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
// CIAUpdateBGSoftNotification::SetTextL
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
// Sets a text for a soft notification
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   139
void CIAUpdateBGSoftNotification::SetTextL( const TDesC& aText, const TDesC& aGroupText )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   141
    HBufC* txt = aText.AllocL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   142
    delete iLabel;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   143
    iLabel = txt;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   145
    txt = aGroupText.AllocL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   146
    delete iGroupLabel;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   147
    iGroupLabel = txt;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
// -----------------------------------------------------------------------------
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   151
// CIAUpdateBGSoftNotification::SetSoftkeyLabelsL
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   152
// Sets new labels for softkeys
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   155
void CIAUpdateBGSoftNotification::SetSoftkeyLabelsL(
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   156
    const TDesC& aSoftkey1Label,
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   157
    const TDesC& aSoftkey2Label )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   159
    HBufC* txt = aSoftkey1Label.AllocL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   160
    delete iSoftkey1;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   161
    iSoftkey1 = txt;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   162
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   163
    txt = aSoftkey2Label.AllocL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   164
    delete iSoftkey2;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   165
    iSoftkey2 = txt;
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    }
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   167
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   168
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   169
// CIAUpdateBGSoftNotification::SetImageL
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   170
// Sets an image for a soft notification
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   171
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   172
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   173
void CIAUpdateBGSoftNotification::SetImageL(
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   174
    const TDesC8& aImage )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   175
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   176
    HBufC8* image = aImage.AllocL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   177
    delete iImageData;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   178
    iImageData = image;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   179
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   180
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   181
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   182
// CIAUpdateBGSoftNotification::Id
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   183
// Notification Id
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   184
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   185
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   186
TInt CIAUpdateBGSoftNotification::Id()
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   187
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   188
    return iNotificationId;
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   189
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   190
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
// CIAUpdateBGSoftNotification::ConstructL
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
// Symbian 2nd phase constructor can leave.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
//
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
void CIAUpdateBGSoftNotification::ConstructL()
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
    {
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
    FLOG("[bgchecker] softnotification ConstructL");
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   199
    iNotifier = CAknDynamicSoftNotifier::NewL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   200
    
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   201
    iInternalFile->ReadControllerDataL();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   202
    iNotificationId = iInternalFile->SoftNotificationID();
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   203
      
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
// CIAUpdateBGSoftNotification::CIAUpdateBGSoftNotification
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
// C++ default constructor can NOT contain any code, that
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
// might leave.
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   212
CIAUpdateBGSoftNotification::CIAUpdateBGSoftNotification( MIAUpdateBGSoftNotificationCallBack* aCallback, 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   213
                                                          CIAUpdateBGInternalFileHandler* aInternalFile ) 
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   214
    : iCallback ( aCallback ), iInternalFile ( aInternalFile )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
    {
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
// -----------------------------------------------------------------------------
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   219
// CIAUpdateBGSoftNotification::StartObservingIfNeededL
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   220
// -----------------------------------------------------------------------------
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   221
//
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   222
void CIAUpdateBGSoftNotification::StartObservingIfNeededL()
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   223
    {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   224
    if ( iNotificationId )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   225
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   226
        FLOG("[bgchecker] softnotification There is a buffered softnotification");
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   227
        //a buffering soft notification
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   228
        iNotifier->StartObservingL( iNotificationId, this );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   229
        }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   230
    }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   231
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   232
// -----------------------------------------------------------------------------
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
// CIAUpdateBGSoftNotification::FillNotificationParams
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
// -----------------------------------------------------------------------------
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
//
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   236
void CIAUpdateBGSoftNotification::FillNotificationParams(
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   237
    TAknDynamicSoftNotificationParams& aParam )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
    {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   239
    if( iSoftkey1 && iSoftkey2 )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   240
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   241
        aParam.SetSoftkeys( *iSoftkey1, *iSoftkey2 );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   242
        }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   243
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   244
    if( iLabel )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
        {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   246
        aParam.SetNoteLabels( *iLabel, *iLabel );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
        }
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   248
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   249
    if( iGroupLabel )
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
        {
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   251
        //aParam.SetGroupLabels( *iGroupLabel, *iGroupLabel );
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   252
        }
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   253
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   254
    if( iImageData )
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   255
        {
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   256
        aParam.SetImageData( *iImageData );
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
        }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
    
26
8b7f4e561641 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 25
diff changeset
   259
    aParam.EnableObserver();
0
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
    }
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
ba25891c3a9e Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
//  End of File