classicui_pub/notifiers_api/inc/AknGlobalNote.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-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 #ifndef __AKNGLOBALNOTENOTIFY_H__
       
    19 #define __AKNGLOBALNOTENOTIFY_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <AknNotify.h>
       
    23 #include <AknNotifyStd.h>
       
    24 
       
    25 // CLASS DECLARATION
       
    26 
       
    27 /**
       
    28 *  This class handles the global notes.
       
    29 *  
       
    30 *  @since S60 0.9
       
    31 */
       
    32 NONSHARABLE_CLASS(CAknGlobalNote) : public CAknNotifyBase
       
    33     {
       
    34 public: 
       
    35     /**
       
    36     * Two-phased constructor.
       
    37     * @return Pointer to new global note object.
       
    38     */
       
    39     IMPORT_C static CAknGlobalNote* NewL();
       
    40     
       
    41     /**
       
    42     * Two-phased constructor.
       
    43     * @return Pointer to new global note object.
       
    44     */
       
    45     IMPORT_C static CAknGlobalNote* NewLC();
       
    46     
       
    47     /**
       
    48     * Destructor.
       
    49     */
       
    50     IMPORT_C ~CAknGlobalNote();
       
    51 
       
    52    /**
       
    53     * Enable or disable all text processing done by the dialog.
       
    54     * This includes text wrapping, text truncation
       
    55     * and reordering of bidirectional text.
       
    56     *
       
    57     * By default, it is enabled.
       
    58     *
       
    59     * If text processing is disabled, lines are broken only at explicit line 
       
    60     * end characters and they are not truncated, but drawn as long as they
       
    61     * fit. Also, the dialog does not handle reordering of bidirectional text.
       
    62     *
       
    63     * @since S60 2.0
       
    64     * @param aEnabled Enable or disable all text processing.
       
    65     */
       
    66     IMPORT_C void SetTextProcessing(TBool aEnabled);
       
    67 
       
    68     /**
       
    69     * Displays the global note.
       
    70     * @param aType Note type.
       
    71     * @param aNoteText Note text.
       
    72     * @return Note ID.
       
    73     */
       
    74     IMPORT_C TInt ShowNoteL(TAknGlobalNoteType aType, const TDesC& aNoteText);
       
    75     
       
    76     /**
       
    77     * Displays the global note.
       
    78     * @param aStatus Reference to request status.
       
    79     * @param aType Note type.
       
    80     * @param aNoteText Note text.
       
    81     * @return Note ID.
       
    82     */
       
    83     IMPORT_C TInt ShowNoteL(
       
    84         TRequestStatus& aStatus, 
       
    85         TAknGlobalNoteType aType,
       
    86         const TDesC& aNoteText);
       
    87     
       
    88     /**
       
    89     * Cancels the global note.
       
    90     * @param aNoteId Note ID.
       
    91     */
       
    92     IMPORT_C void CancelNoteL(TInt aNoteId);
       
    93     
       
    94     /**
       
    95     * Sets the priority.
       
    96     * @param aPriority An integer specifying the new priority.
       
    97     */
       
    98     IMPORT_C void SetPriority(TInt aPriority);
       
    99     
       
   100     /**
       
   101     * Sets the softkey ID. (Not used)
       
   102     * @param aId softkey ID 
       
   103     */
       
   104     IMPORT_C void SetSoftkeys(TInt aId);
       
   105     
       
   106     /**
       
   107     * Sets the graphic ID and the graphic mask ID.
       
   108     * @param aId Graphic ID
       
   109     * @param aMaskId Graphic mask ID.
       
   110     */
       
   111     IMPORT_C void SetGraphic(TInt aId, TInt aMaskId=-1);
       
   112     
       
   113     /**
       
   114     * Sets the animation.
       
   115     * @param aResourceId Resource ID of the animation.
       
   116     */
       
   117     IMPORT_C void SetAnimation(TInt aResourceId);
       
   118     
       
   119     /**
       
   120     * Sets the tone.
       
   121     * @param aTone New tone.
       
   122     */
       
   123     IMPORT_C void SetTone(TInt aTone);  // must be specified in avkon.hrh
       
   124     
       
   125     /** 
       
   126     * Internal, please do not use.
       
   127     * @internal
       
   128     */
       
   129     IMPORT_C static void DoGlobaNoteBufferL(
       
   130         TInt16 aType,
       
   131         TInt16 aPriority,
       
   132         TInt aSoftkeys,
       
   133         TInt16 aGraphic,
       
   134         TInt16 aGraphicMask,
       
   135         TInt aAnimation,
       
   136         TInt16 aTone,
       
   137         TBool aAdapterUsed,
       
   138         TBool aTextProcessingEnabled,
       
   139         const TDesC& aNoteText,
       
   140         CBufFlat* aBuffer
       
   141         );
       
   142         
       
   143     /** 
       
   144     * @internal
       
   145     */
       
   146     static void DoGlobalNoteBufferL(
       
   147         TInt16 aType,
       
   148         TInt16 aPriority,
       
   149         TInt aSoftkeys,
       
   150         TInt16 aGraphic,
       
   151         TInt16 aGraphicMask,
       
   152         TInt aAnimation,
       
   153         TInt16 aTone,
       
   154         TBool aAdapterUsed,
       
   155         TBool aTextProcessingEnabled,
       
   156         const TDesC& aNoteText,
       
   157         CBufFlat* aBuffer,
       
   158         TInt32 aPreallocatedGlobalNoteId
       
   159         );        
       
   160 
       
   161 private:
       
   162     CAknGlobalNote();
       
   163     void ConstructL();    
       
   164     
       
   165     void PrepareBufferL(
       
   166         TAknGlobalNoteType aType,
       
   167         const TDesC& aNoteText,
       
   168         TInt aPreallocatedGlobalNoteId = 0);
       
   169 
       
   170 private:
       
   171     IMPORT_C void CAknNotifyBase_Reserved();
       
   172     
       
   173 private:
       
   174     TInt iPriority;
       
   175     TInt iSoftkeys;
       
   176     TInt iGraphic;
       
   177     TInt iGraphicMask;
       
   178     TInt iAnimation;
       
   179     TInt iTone;
       
   180     TBool iTextProcessing;
       
   181     
       
   182     CBufFlat *iBuffer;
       
   183     TPtrC8 iBufferPtr;
       
   184 
       
   185     CBufFlat *iCancelBuffer;
       
   186     TPtrC8 iCancelBufferPtr;
       
   187     
       
   188     // Not really used, but needed to prevent buffer handling errors.
       
   189     TPckgBuf<SAknGlobalNoteReturnParams> iRetPckg;
       
   190     };
       
   191 
       
   192 #endif // __AKNGLOBALNOTENOTIFY_H__