classicui_plat/extended_notes_api/inc/aknnoteattributes.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:  Stores attributes of note control. Since these attributes are
       
    15 *                sometimes stored by the dialog before constructing the 
       
    16 *                control, this class is the interface for passing attributes 
       
    17 *                from the dialog to the control.
       
    18 *
       
    19 */
       
    20 
       
    21 #ifndef __AKNNOTEATTRIBUTES__
       
    22 #define __AKNNOTEATTRIBUTES__ 
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class CEikImage;
       
    27 class CEikLabel;
       
    28 
       
    29 class CEikProgressInfo;
       
    30 class CAknProgressTimer;
       
    31 
       
    32 class CAknNoteControl;
       
    33 class CAknTextControl;
       
    34 
       
    35 class CAknsFrameBackgroundControlContext;
       
    36 class CCoeBrushAndPenContex;
       
    37 class TAknsItemID;
       
    38 
       
    39 /** 
       
    40  * Indexes into iFlags.
       
    41  * Can't use zero as this is the default behaviour (no flag indexes set).
       
    42  */
       
    43 enum TNoteFlags
       
    44     {
       
    45     ENoteNoTextWrapping        = 1, ///< EAknNoteNoTextWrapping 
       
    46     ENoteNeedLayoutControl     = 2, ///< When this flag is on, the note control needs layout
       
    47     ENoteNeedLayoutDialog      = 3, ///< When this flag is on, the dialog needs layout
       
    48     ENoteNoTextProcessing      = 4, ///< When this flag is on, the note performs no text processing
       
    49     ENoteDoNotAllocateMem      = 5,
       
    50     ENoteAnimationStarted      = 6,
       
    51     ENoteLeftSKWhenTapped      = 7, ///< EAknNoteLeftSoftkeyWhenTapped
       
    52     ENoteWithSkinnableGraphics = 8  ///< EAknNoteFlagWithSkinnableGraphics
       
    53     };
       
    54 
       
    55 NONSHARABLE_CLASS(CAknNoteAttributes) : public CBase
       
    56     {
       
    57 public:
       
    58     enum { EMaxNumberOfLabels = 5 };
       
    59 
       
    60 public:
       
    61     CAknNoteAttributes();
       
    62     CAknNoteAttributes(CAknNoteControl* aNoteControl);
       
    63     ~CAknNoteAttributes();
       
    64 
       
    65 public:
       
    66     CAknNoteAttributes& operator=(CAknNoteAttributes& aAttributes);
       
    67     void ConstructFromResourceL(TResourceReader& aRes);
       
    68 
       
    69 public:
       
    70     void SetAnimationL(TInt aResourceId);
       
    71     void SetImageL(CEikImage* aImage);
       
    72     void SetIconL(CEikImage* aIcon);
       
    73 
       
    74     void SetFinalProgressValue(TInt aValue);
       
    75     TInt IncrementBarsAndDraw(TInt aIncrement);
       
    76     void CreateProgressBarL();
       
    77 
       
    78     void SetTextPluralityL(TBool aIsPlural);
       
    79     void SetTextNumberL(TInt aNumber);
       
    80 
       
    81     void SetTextL(const TDesC& aText);
       
    82     void SetTextL(const TDesC& aText, TInt aLineNum,const CFont* aFont, CArrayFixFlat<TInt>* aLineWidths);
       
    83 
       
    84     void AttemptOptimizedTextDrawingL(TInt aOldNumberOfLines);
       
    85     void AllowOptimizedDrawing();
       
    86 
       
    87 public:
       
    88     void StartAnimationL();
       
    89     TInt CancelAnimation();
       
    90 
       
    91 public:
       
    92     TPtrC Text() const;
       
    93     void  ParseTextL(const CFont* aFont, CArrayFixFlat<TInt>* aLineWidths);
       
    94 
       
    95 public:
       
    96     ///Layout type
       
    97     enum TLayoutType 
       
    98         { 
       
    99         EDialog = 0, ///Entire dialog needs layout. 
       
   100         EControl = 1 ///EControl: only control needs layout 
       
   101         };  
       
   102 
       
   103     TBool IsLayoutNeeded(const TLayoutType& aType = EDialog) const;                     
       
   104     void  SetLayoutDone(const TLayoutType& aType = EDialog);
       
   105     void  InvalidateLayout();
       
   106 
       
   107 private:
       
   108     void TransferToControlL();
       
   109     void TransferToControlL(CCoeControl* aControl);
       
   110 
       
   111     static TInt StaticPictographCallBack( TAny* aPtr );
       
   112     void PictographCallBack();
       
   113 
       
   114 private:
       
   115     CAknNoteAttributes(const CAknNoteAttributes&); //not allowed
       
   116 
       
   117 public:
       
   118     CAknTextControl*     iNoteText;    ///The note text
       
   119                                           
       
   120     CEikImage*           iImage;       ///The note image at top right 
       
   121     CEikImage*           iIcon;        ///The small icon at bottom left (number type indic, etc)
       
   122                                           
       
   123     CEikProgressInfo*    iProgressBar; ///A progress bar for wait notes
       
   124     CAknProgressTimer*   iTimer;       ///Time for progress bar
       
   125                                           
       
   126     CAknBitmapAnimation* iAnimation;   ///An animation replacing the image
       
   127     TBitFlags            iFlags;       ///Flags that determine behavior
       
   128     TBitFlags            iClearFlags;  ///Flags that inhibit behaviour, used in operator= only 
       
   129                                           
       
   130     TRect                iBgRect;      ///For nondialog controls
       
   131                                           
       
   132 private:                                  
       
   133     CAknNoteControl*     iNoteControl; ///Not owned - The control that owns us or NULL
       
   134     
       
   135 public:
       
   136     CAknsFrameBackgroundControlContext* iBgContext; 
       
   137     CCoeBrushAndPenContext* iBrushAndPenContext;
       
   138 
       
   139 public: // New skin utility functions 
       
   140     IMPORT_C static TAknsItemID GetSkinnedBitmapID(TInt aIcon);
       
   141     void SetAnimationBackGroundFrameL(); 
       
   142 
       
   143 private: // new data
       
   144     TInt iAnimationID;
       
   145     TBool iAllowOptimizedDrawing;
       
   146 
       
   147 public:
       
   148     void HandleSkinChangeL();
       
   149 
       
   150 private:
       
   151     HBufC*               iImageFile;
       
   152     TInt                 iImageId;
       
   153     TInt                 iImageMask;
       
   154     TAknsItemID          iSkinIdForImage;
       
   155     };
       
   156 
       
   157 #endif