classicui_plat/extended_notifiers_api/inc/AknSoftNotifier.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  Client API for Avkon soft notifications.   
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __AKNSOFTNOTIFIER_H__
       
    19 #define __AKNSOFTNOTIFIER_H__
       
    20 
       
    21 #include <AknNotify.h>
       
    22 #include <AknNotifyStd.h>
       
    23 
       
    24 class CAknPrivateSoftNoteParameters;
       
    25 class CAknSoftNotificationParameters;
       
    26 class CAknSoftNotifierExt;
       
    27 
       
    28 
       
    29 
       
    30 NONSHARABLE_CLASS(CAknSoftNotifier) : public CAknNotifyBase
       
    31     {
       
    32     public:
       
    33         IMPORT_C static CAknSoftNotifier* NewL();
       
    34         IMPORT_C static CAknSoftNotifier* NewLC();
       
    35         IMPORT_C ~CAknSoftNotifier();
       
    36 
       
    37         /**
       
    38         * Add new soft notification of type 'aType'. If the notification of
       
    39         * type 'aType' already exists number of items is increased by one.
       
    40         * Optional dynamic notification text can also be set.
       
    41         *       
       
    42         * Please note that this method cannot be used with custom soft notifications
       
    43         *
       
    44         * @param aType The type of the soft notification. Types can be found
       
    45         *        in AknNotifyStd.h 
       
    46         * @param aText Dynamic text to the notification.
       
    47         */
       
    48         IMPORT_C void AddNotificationL(
       
    49             TAknSoftNotificationType aType, TPtrC* aText = NULL );
       
    50 
       
    51         /**
       
    52         * Add new soft notification of type 'aType'. The number of items is
       
    53         * set to 'aCount'.
       
    54         *       
       
    55         * Please note that this method cannot be used with custom soft notifications
       
    56         *
       
    57         * @param aType The type of the soft notification. Types can be found
       
    58         *        in AknNotifyStd.h
       
    59         * @param aCount The number of items for this type, e.g, missed calls,
       
    60         *        voice mails
       
    61         */
       
    62         IMPORT_C void AddNotificationL(
       
    63             TAknSoftNotificationType aType, TInt aCount );
       
    64     
       
    65         /**
       
    66         * Set number of notifications of type 'aType'. This overrides current
       
    67         * value. Optional dynamic notification text can also be set.
       
    68         *       
       
    69         * Please note that this method cannot be used with custom soft notifications
       
    70         * 
       
    71         * @param aType The type of the soft notification.
       
    72         *        Types can be found in AknNotifyStd.h
       
    73         * @param aCount Number of item is the notification.
       
    74         * @param aText Dynamic text to the notification. (Not implemented in
       
    75         *        current release).
       
    76         */
       
    77         IMPORT_C void SetNotificationCountL(
       
    78             TAknSoftNotificationType aType, TInt aCount, TPtrC* aText = NULL );
       
    79 
       
    80         /**
       
    81         * Cancels soft notification of type 'aType'.
       
    82         *       
       
    83         * Please note that this method cannot be used with custom soft notifications
       
    84         *
       
    85         * @param aType The type of the soft notification.
       
    86         * Types can be found in AknNotifyStd.h
       
    87         */
       
    88         IMPORT_C void CancelSoftNotificationL( TAknSoftNotificationType aType );
       
    89 
       
    90         /**
       
    91         * Adds a custom soft notification. If a custom soft notification with
       
    92         * exactly the same parameters already exists,
       
    93         * its count is increased by aCount.
       
    94         *
       
    95         * @param aParams custom soft notification parameters
       
    96         * @param aCount count
       
    97         */
       
    98         IMPORT_C void AddCustomNotificationL(
       
    99             CAknSoftNotificationParameters& aParams, TInt aCount = 1 );
       
   100 
       
   101         /**
       
   102         * Sets the absolute count of a custom soft notification with
       
   103         * given parameters. If such notification did not exist already,
       
   104         * it is created.
       
   105         */
       
   106         IMPORT_C void SetCustomNotificationCountL(
       
   107             CAknSoftNotificationParameters& aParams, TInt aCount );
       
   108 
       
   109         /**
       
   110         * Cancels custom soft notification with the given parameters.
       
   111         */
       
   112         IMPORT_C void CancelCustomSoftNotificationL(
       
   113             CAknSoftNotificationParameters& aParams );
       
   114 
       
   115     private:
       
   116         /**
       
   117         * Tell the soft notes if the phone is in idle state or not.
       
   118         * Soft notes do not display unless the phone is in idle state.
       
   119         *
       
   120         * @param aIdleState Is phone in idle state
       
   121         */
       
   122         IMPORT_C void SetIdleStateL( TBool aIdleState );
       
   123 
       
   124     private:
       
   125         IMPORT_C void CAknNotifyBase_Reserved();
       
   126         CAknSoftNotifier();
       
   127         void ConstructL();
       
   128 
       
   129         void PrepareBufferL( 
       
   130             TAknSoftNotificationType aType, 
       
   131             TInt aCount, 
       
   132             TPtrC* aText, 
       
   133             TBool aCancel, 
       
   134             TBool aAddCount,
       
   135             CAknSoftNotificationParameters* aParams = NULL);
       
   136 
       
   137     private: // data
       
   138         CBufFlat* iBuffer;
       
   139         TPtrC8 iBufferPtr;
       
   140 
       
   141 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
   142         CAknSoftNotifierExt* iExt;
       
   143 #endif
       
   144     public: // NCN updates phone idle information
       
   145         friend class CNcnSNNotifier;
       
   146         friend class CSimpleAppUi;
       
   147         
       
   148 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
   149         friend class CAknSoftNotifierExt;
       
   150 #endif
       
   151     };
       
   152 
       
   153 #endif // __AKNSOFTNOTIFIER_H__