iaupdate/IAD/backgroundchecker/inc/iaupdatebgsoftnotification.h
changeset 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IAUPDATEBGSOFTNOTIFICATION_H
       
    21 #define IAUPDATEBGSOFTNOTIFICATION_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <AknDynamicSoftNotifier.h>
       
    26 #include "iaupdatebgcheckermode.h"
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 class TAknDynamicSoftNotificationParams;
       
    30 class CIAUpdateBGInternalFileHandler;
       
    31 
       
    32 class MIAUpdateBGSoftNotificationCallBack
       
    33     {
       
    34     public:
       
    35         virtual void SoftNotificationCallBack( TBool aIsAccepted ) = 0;
       
    36         virtual TIAUpdateBGMode CurrentMode() = 0;
       
    37     };
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42  *  Controls the native soft notifications.
       
    43  *  This class delegates method calls to AvKon soft notification.
       
    44  *
       
    45  *  @since 3.2
       
    46  */
       
    47 class CIAUpdateBGSoftNotification : public CBase, public MAknDynamicSoftNoteObserver
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50 
       
    51         /**
       
    52          * Static constructor
       
    53          */
       
    54         static CIAUpdateBGSoftNotification* NewL( MIAUpdateBGSoftNotificationCallBack* aCallback, CIAUpdateBGInternalFileHandler* aInternalFile );
       
    55 
       
    56         /**
       
    57          * Destructor.
       
    58          */
       
    59         virtual ~CIAUpdateBGSoftNotification();
       
    60 
       
    61     public: // From MAknDynamicSoftNotifierObserver
       
    62 
       
    63         /**
       
    64          * Dynamic soft notification was accepted by user.
       
    65          *
       
    66          * @param aNoteId Identification of notification.
       
    67          */
       
    68         void NotificationAccepted( TInt aIdentifier );
       
    69 
       
    70         /**
       
    71          * Dynamic soft notification was canceled by user.
       
    72          *
       
    73          * @param aNoteId Identification of notification.
       
    74          */
       
    75         void NotificationCanceled( TInt aIdentifier );
       
    76 
       
    77     public: // New functions
       
    78         
       
    79         void StartObservingIfNeededL();
       
    80         
       
    81         
       
    82         /**
       
    83          * Add a custom soft notification. If a custom soft notification with
       
    84          * exactly the same parameters already exists,
       
    85          * its count is increased by aCount.
       
    86          *
       
    87          * @param aNotificationId identifier for this notification
       
    88          * @param aCount addition count
       
    89          */
       
    90         void ShowSoftNotificationL();
       
    91 
       
    92         /**
       
    93          * Cancels custom soft notification.
       
    94          *
       
    95          * @param aNotificationId identifier for this notification
       
    96          */
       
    97         void RemoveSoftNotificationL( TInt aNotifierID );
       
    98 
       
    99         /**
       
   100          * Set a text for a soft notification.
       
   101          *
       
   102          * @param aSingularText singular text for soft notification
       
   103          * @param aPluralText plural text for soft notification
       
   104          */
       
   105         void SetTextL( const TDesC& aText, const TDesC& aGroupText );
       
   106 
       
   107         /**
       
   108          * Set labels for soft notification's softkeys.
       
   109          *
       
   110          * @param aSoftkey1Label Label for the softkey 1
       
   111          * @param aSoftkey2Label Label for the softkey 2
       
   112          */
       
   113         void SetSoftkeyLabelsL( const TDesC& aSoftkey1Label,
       
   114             const TDesC& aSoftkey2Label );
       
   115 
       
   116         /**
       
   117          * Set an image for a soft notification.
       
   118          *
       
   119          * @param aImage image for soft notification
       
   120          */
       
   121         void SetImageL( const TDesC8& aImage );
       
   122 
       
   123         /**
       
   124          * Returns the notification id.
       
   125          *
       
   126          * @return notification id
       
   127          */
       
   128         TInt Id();
       
   129 
       
   130     private:  // Constructors
       
   131         /**
       
   132          * C++ constructor.
       
   133          *
       
   134          * @param aAppId View activation application id.
       
   135          * @param aNotificationId Notification id.
       
   136          * @param aEventSource Event source used for posting events from
       
   137          *        native to Java side.
       
   138          */
       
   139         CIAUpdateBGSoftNotification( MIAUpdateBGSoftNotificationCallBack* aCallback, CIAUpdateBGInternalFileHandler* aInternalFile );
       
   140 
       
   141         /**
       
   142          * 2nd phase constructor.
       
   143          */
       
   144         void ConstructL();
       
   145 
       
   146     private:  // New methods
       
   147    
       
   148         /**
       
   149          * Set assigned member data to custom notification parameters
       
   150          *
       
   151          * @param aParam custom soft notification params to fill
       
   152          */
       
   153         void FillNotificationParams( TAknDynamicSoftNotificationParams& aParam );
       
   154 
       
   155     private:  // Data
       
   156         /// Own. AvKon custom soft notifier
       
   157         CAknDynamicSoftNotifier* iNotifier;
       
   158         /// View activation application id
       
   159         TUid iAppId;
       
   160         /// Notification Id
       
   161         TInt iNotificationId;
       
   162         /// Own. Softkey 1 label
       
   163         HBufC* iSoftkey1;
       
   164         /// Own. Softkey 2 label
       
   165         HBufC* iSoftkey2;
       
   166         /// Own. Note label when single dialog is shown
       
   167         HBufC* iLabel;
       
   168         /// Own. Note label when notifications are groupped
       
   169         HBufC* iGroupLabel;
       
   170         /// Own. Image data byte array
       
   171         HBufC8* iImageData;
       
   172         
       
   173         MIAUpdateBGSoftNotificationCallBack* iCallback;
       
   174         
       
   175         CIAUpdateBGInternalFileHandler* iInternalFile; //not owned
       
   176 
       
   177     };
       
   178 
       
   179 #endif // IAUPDATEBGSOFTNOTIFICATION_H
       
   180 
       
   181