epoc32/include/mw/aknnotecontrol.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
* 
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
#ifndef AKNNOTECONTROL_H
williamr@2
    22
#define AKNNOTECONTROL_H
williamr@2
    23
williamr@2
    24
// INCLUDES
williamr@2
    25
#include <AknControl.h>
williamr@4
    26
#include <AknUtils.h>
williamr@2
    27
williamr@2
    28
#include <aknprogresstimer.h>
williamr@4
    29
#include <AknBitmapAnimation.h>
williamr@2
    30
williamr@2
    31
// FORWARD DECLARATIONS
williamr@2
    32
class CEikImage;
williamr@2
    33
class CEikLabel;
williamr@2
    34
class CEikProgressInfo;
williamr@2
    35
class CAknNoteAttributes;
williamr@2
    36
class CAknTextControl;
williamr@2
    37
class TAknWindowLineLayout;
williamr@2
    38
williamr@2
    39
// CLASS DECLARATION
williamr@2
    40
williamr@2
    41
/**
williamr@2
    42
* The control for a note dialog.
williamr@2
    43
*
williamr@2
    44
* Manage layout of elements in a note dialog:- the text, the image and
williamr@2
    45
* animation, the progress bar.
williamr@2
    46
*
williamr@2
    47
* @since Series 60 0.9
williamr@2
    48
* @see CAknNoteDialog, CAknNoteAttributes, CAknText
williamr@2
    49
*/
williamr@2
    50
class CAknNoteControl : public CAknControl 
williamr@2
    51
{
williamr@2
    52
friend class CAknNoteAttributes;
williamr@2
    53
williamr@2
    54
public:	
williamr@2
    55
	
williamr@2
    56
	/**
williamr@2
    57
    * C++ default constructor.
williamr@2
    58
    */
williamr@2
    59
	IMPORT_C CAknNoteControl();
williamr@2
    60
	
williamr@2
    61
	/**
williamr@2
    62
    * Destructor.
williamr@2
    63
    */
williamr@2
    64
	IMPORT_C virtual ~CAknNoteControl();
williamr@2
    65
	
williamr@2
    66
	/**
williamr@2
    67
	* Constructs controls from a resource file.
williamr@2
    68
	* @param aRes The resource reader with which to access @c AVKON_NOTE
williamr@2
    69
	* resource.
williamr@2
    70
	*/
williamr@2
    71
	void ConstructFromResourceL(TResourceReader& aRes);
williamr@2
    72
williamr@2
    73
public:
williamr@2
    74
williamr@2
    75
    /**
williamr@2
    76
    * Set the note image. 
williamr@2
    77
    *
williamr@2
    78
    * Set the image in the note attributes. This reduces the
williamr@2
    79
    * size of the image if necessary (only fixed set of
williamr@2
    80
    * image sizes if supported). Perform layout only for
williamr@2
    81
    * the control. The dialog will not be resized. 
williamr@2
    82
    * 
williamr@2
    83
    * @param aImage Pointer to image to set.
williamr@2
    84
    */
williamr@2
    85
    IMPORT_C void SetImageL(CEikImage* aImage);
williamr@2
    86
williamr@2
    87
    /**
williamr@2
    88
    * Set the note animation. 
williamr@2
    89
    *
williamr@2
    90
    * Set the animation in the note attributes.
williamr@2
    91
    * Perform layout only for the control. 
williamr@2
    92
    * The dialog will not be resized. 
williamr@2
    93
    * 
williamr@2
    94
    * @param aResource ID of @c BMPANIM_DATA resource.
williamr@2
    95
    */
williamr@2
    96
	IMPORT_C void SetAnimationL(TInt aResource);
williamr@2
    97
williamr@2
    98
	/**
williamr@2
    99
    * Set the note icon. 
williamr@2
   100
    *
williamr@2
   101
    * Set the icon in the note attributes.
williamr@2
   102
    * Perform layout only for the control. 
williamr@2
   103
    * The dialog will not be resized. 
williamr@2
   104
    * 
williamr@2
   105
    * @param aIcon Pointer to icon to set.
williamr@2
   106
    */
williamr@2
   107
    IMPORT_C void SetIconL(CEikImage* aIcon);
williamr@2
   108
williamr@2
   109
    /**
williamr@2
   110
    * Set the progress bar final value in the note attributes. 
williamr@2
   111
    *  
williamr@2
   112
    * @param aValue The final value for the progress information control. 
williamr@2
   113
    * If it is zero, the value is set to one.
williamr@2
   114
    * @see CEikProgressInfo
williamr@2
   115
    */	
williamr@2
   116
	IMPORT_C void SetFinalProgressValue(TInt aValue);
williamr@2
   117
williamr@2
   118
	/**
williamr@2
   119
    * Increment the progress bar and draw.
williamr@2
   120
    *
williamr@2
   121
    * @param  aIncrement The increment to add to the current progress value.
williamr@2
   122
    * @return 1 if operation hasn't been completed else 0.
williamr@2
   123
    * 
williamr@2
   124
    * @see CEikProgressInfo
williamr@2
   125
    */
williamr@2
   126
	IMPORT_C TInt IncrementBarsAndDraw(TInt aIncrement);
williamr@2
   127
williamr@2
   128
	/**
williamr@2
   129
    * Create the progress bar.
williamr@2
   130
    *
williamr@2
   131
    * @see CEikProgressInfo
williamr@2
   132
    */
williamr@2
   133
	IMPORT_C void CreateProgressBarL();
williamr@2
   134
williamr@2
   135
	/**
williamr@2
   136
    * Return the progress bar.
williamr@2
   137
    *
williamr@2
   138
    * @return Pointer to the progress bar.
williamr@2
   139
    *
williamr@2
   140
    * @see CEikProgressInfo
williamr@2
   141
    */
williamr@2
   142
	IMPORT_C CEikProgressInfo* GetProgressInfo();
williamr@2
   143
	
williamr@2
   144
	/**
williamr@2
   145
    * Start the note animation.
williamr@2
   146
    *
williamr@2
   147
    * @see CAknBitmapAnimation
williamr@2
   148
    */
williamr@2
   149
	IMPORT_C void StartAnimationL();
williamr@2
   150
williamr@2
   151
	/**
williamr@2
   152
    * Stop the note animation.
williamr@2
   153
    * Calls @c CAknBitmapAnimation::CancelAnimation() for animation object.
williamr@2
   154
    * @return @c KErrNone if cancellation successful,
williamr@2
   155
    * @c KErrGenreral if there was no animation object, otherwise another of the
williamr@2
   156
    * system-wide error codes. 
williamr@2
   157
    *
williamr@2
   158
    * @see CAknBitmapAnimation
williamr@2
   159
    */
williamr@2
   160
	IMPORT_C TInt CancelAnimation();
williamr@2
   161
williamr@2
   162
    /**
williamr@2
   163
    * Reset the note text.
williamr@2
   164
    *
williamr@2
   165
    * Perform layout only for the control. 
williamr@2
   166
    * The dialog will not be resized. 
williamr@2
   167
    *
williamr@2
   168
    * @see CAknTextControl
williamr@2
   169
    */
williamr@2
   170
	IMPORT_C void ResetText();
williamr@2
   171
williamr@2
   172
    /**
williamr@2
   173
    * Set whole text for the note control.
williamr@2
   174
    *
williamr@2
   175
    * Perform layout only for the control. 
williamr@2
   176
    * The dialog will not be resized. 
williamr@2
   177
    * @param aText String to set.
williamr@2
   178
    */	
williamr@2
   179
	IMPORT_C void SetTextL(const TDesC& aText);
williamr@2
   180
williamr@2
   181
	/**
williamr@2
   182
    * Set text for a specific line. Any previous text will be overwritten,
williamr@2
   183
    * except for the text that was set for other lines via this method.
williamr@2
   184
    *
williamr@2
   185
    * This method prevents @c ParseTextL from having any effect, hence text
williamr@2
   186
    * control needs to know font and line width to allocate space.
williamr@2
   187
    * 
williamr@2
   188
    * This method is kept for backwards compatibility as the same
williamr@2
   189
    * results could be achieved by the other @c SetTextL with no wrapping
williamr@2
   190
    * enabled (flag in note attributes) and newline characters in the text to
williamr@2
   191
    * indicate a new line.
williamr@2
   192
    *
williamr@2
   193
    * Perform layout only for the control. 
williamr@2
   194
    * The dialog will not be resized. 
williamr@2
   195
    *
williamr@2
   196
    * @param aText String to set.
williamr@2
   197
    * @param aLineNum Specifies the line of the text to be set.
williamr@2
   198
    */
williamr@2
   199
	IMPORT_C void SetTextL(const TDesC& aText,TInt aLineNum);
williamr@2
   200
	
williamr@2
   201
    /**
williamr@2
   202
    * Set the number inside the note text. The text must have been 
williamr@2
   203
    * previously set via resource or via @c SetTextL and must have a
williamr@2
   204
    * \%d or \%N in it.
williamr@2
   205
    *
williamr@2
   206
    * Note:- This method could be replaced by a @c SetTextL method with 
williamr@2
   207
    * a variable number of arguments.
williamr@2
   208
    *
williamr@2
   209
    * Perform layout only for the control. 
williamr@2
   210
    * The dialog will not be resized. 
williamr@2
   211
    *
williamr@2
   212
    * @param aNumber Integer to be set inside the text.
williamr@2
   213
    */	
williamr@2
   214
	IMPORT_C void SetTextNumberL(const TInt aNumber);
williamr@2
   215
williamr@2
   216
    /**
williamr@2
   217
    * Determine which text is to be used, either the text for
williamr@2
   218
    * singular notes, e.g. "You have 1 new message" or the text
williamr@2
   219
    * for plural notes, e.g. "You have %N new messages". These
williamr@2
   220
    * texts must have been set via resource.
williamr@2
   221
    *
williamr@2
   222
    * Note:- This method could be replaced by a @c SetTextL method with 
williamr@2
   223
    * a variable number of arguments.
williamr@2
   224
    *
williamr@2
   225
    * Perform layout only for the control. 
williamr@2
   226
    * The dialog will not be resized. 
williamr@2
   227
    *
williamr@2
   228
    * @param aIsPlural @c ETrue if plural form of the text is needed,
williamr@2
   229
    * otherwise @c EFalse.
williamr@2
   230
    */	
williamr@2
   231
	IMPORT_C void SetTextPluralityL(const TBool aIsPlural);
williamr@2
   232
	
williamr@2
   233
	/**
williamr@2
   234
    * Return the number of lines.
williamr@2
   235
    *
williamr@2
   236
    * @return The number of lines. 
williamr@2
   237
    */
williamr@2
   238
	IMPORT_C TInt NumberOfLines() const;
williamr@2
   239
williamr@2
   240
public:
williamr@2
   241
williamr@2
   242
    /**
williamr@2
   243
    * Do layout.
williamr@2
   244
    *
williamr@2
   245
    * Before doing layout parse the text (This might be redundant except
williamr@2
   246
    * when the control attributs are trasfered but is left here to avoid
williamr@2
   247
    * breaking the functionality of this exported method).
williamr@2
   248
    *
williamr@2
   249
    * Layout is done only if it is needed, i.e. if the attributes indicates
williamr@2
   250
    * that something has changed in such a way that layout needs to be 
williamr@2
   251
    * performed again, e.g. a line of text has been added.
williamr@2
   252
    *
williamr@2
   253
    * This method assumes that the rect of the control has not been changed. 
williamr@2
   254
    * On the contrary, SizeChanged does not assume that the rect is the same
williamr@2
   255
    * and hence always performs layout.
williamr@2
   256
    */
williamr@2
   257
	IMPORT_C void Layout();
williamr@2
   258
williamr@2
   259
	/**
williamr@2
   260
    *
williamr@2
   261
    * This is used by a dialog to layout the control correctly.
williamr@2
   262
    * @return type of layout to be used.
williamr@2
   263
    *
williamr@2
   264
    */
williamr@2
   265
	void WindowLayout( TAknWindowLineLayout& aLayout ) const;
williamr@2
   266
williamr@2
   267
    /**
williamr@2
   268
    * Return the note height. 
williamr@2
   269
    *
williamr@2
   270
    * The note height is taken from the layout compiler and
williamr@2
   271
    * depends on number of lines and the note layout type. 
williamr@2
   272
    * 
williamr@2
   273
    * @return The note height in pixels.
williamr@2
   274
    */
williamr@2
   275
	IMPORT_C TInt NoteHeight() const;
williamr@2
   276
williamr@2
   277
	/**
williamr@2
   278
    * Return the note width. 
williamr@2
   279
    *
williamr@2
   280
    * The note width is taken from the layout compiler. 
williamr@2
   281
    * Contrary to the note height, the note width does not depend on
williamr@2
   282
    * the note layout type or on number of lines. 
williamr@2
   283
    * 
williamr@2
   284
    * @return The note width in pixels.
williamr@2
   285
    */
williamr@2
   286
	IMPORT_C TInt NoteWidth() const;
williamr@2
   287
williamr@2
   288
public:	//Interface to CAknNoteDialog 
williamr@2
   289
williamr@2
   290
    /**
williamr@2
   291
    * Gets the minimun size requided by the control.
williamr@2
   292
    * @return The minimum size required by the control.
williamr@2
   293
    */
williamr@2
   294
	TSize MinimumSize();
williamr@2
   295
williamr@2
   296
	/**
williamr@2
   297
    * Accessor to note attributes stored in @c CAknNoteAttributes.
williamr@2
   298
    * @return Pointer to @c CAknNoteAttributes.
williamr@2
   299
	*/
williamr@2
   300
	CAknNoteAttributes* Attributes() const;
williamr@2
   301
williamr@2
   302
	/**
williamr@2
   303
    * Used by sleeping notes when going to background,
williamr@2
   304
    * in order to stop and delete animations.        
williamr@2
   305
    * Calls @c CancelAnimation(). 
williamr@2
   306
    */
williamr@2
   307
	void Reset();
williamr@2
   308
	
williamr@2
   309
	/**
williamr@2
   310
    * Updates the image according to the current skin.
williamr@2
   311
    */
williamr@2
   312
	void CreateDefaultImageL();
williamr@2
   313
williamr@2
   314
public:
williamr@2
   315
	IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   316
williamr@2
   317
public:
williamr@2
   318
		/**
williamr@2
   319
		* Manage indexes into LAF tables
williamr@2
   320
		*
williamr@2
   321
        * NP   stands for "Note Popup"
williamr@2
   322
        *
williamr@2
   323
        * WNP  stands for "Waiting/progress Note Popup"
williamr@2
   324
        *
williamr@2
   325
        * NWIP stands for "Note With Image Popup"
williamr@2
   326
		*/
williamr@2
   327
		class TIndex 
williamr@2
   328
		{	
williamr@2
   329
		public:
williamr@2
   330
williamr@2
   331
			/**
williamr@2
   332
            * C++ default constructor.
williamr@2
   333
            * @param aNumberOfLines Number of lines.
williamr@2
   334
            * @param aHasNti Determines whether or not there is a number type
williamr@2
   335
            * indication (NTI).
williamr@2
   336
            * @param aImageSize Image size.
williamr@2
   337
            */		
williamr@2
   338
			TIndex(TInt aNumberOfLines, 
williamr@2
   339
			       TBool aHasNti = EFalse, 
williamr@2
   340
			       TSize aImageSize = TSize(0,0));	
williamr@2
   341
		
williamr@2
   342
		public:	
williamr@2
   343
williamr@2
   344
           /**
williamr@2
   345
            * Returns number of lines.
williamr@2
   346
            * @return Number of lines.
williamr@2
   347
            */			
williamr@2
   348
            TInt Lines() const;	
williamr@2
   349
			
williamr@2
   350
		public:	
williamr@2
   351
williamr@2
   352
    	    /**
williamr@2
   353
            * Return index into table "Waiting/progress Note Popup Window
williamr@2
   354
            * Texts Line 1". Index depends on the number of text lines and
williamr@2
   355
            * whether or not there is a number type indication (NTI). See 
williamr@2
   356
            * table in *.lay and LAF specs for working out indexes.
williamr@2
   357
            * @param aLineNum Line number.
williamr@2
   358
            * @return Index into table "Waiting/progress Note Popup Window
williamr@2
   359
            * Texts Line 1".
williamr@2
   360
            */		
williamr@2
   361
			TInt WNPWindowTextsLine1(TInt aLineNum) const;
williamr@2
   362
williamr@2
   363
			/**
williamr@2
   364
            * Return Left index into table "Note With Image Popup Window
williamr@2
   365
            * Texts Line 1". Index depends on number of text lines, whether or
williamr@2
   366
            * not there is a number type indication (NTI). See table in *.lay
williamr@2
   367
            * and LAF specs for working out indexes.
williamr@2
   368
            * @param aLineNum Line number.
williamr@2
   369
            * @return Left index into table "Note With Image Popup Window
williamr@2
   370
            * Texts Line 1".
williamr@2
   371
            */
williamr@2
   372
			TInt NWIPWindowTextsLine1L(TInt aLineNum) const;
williamr@2
   373
williamr@2
   374
        	/**
williamr@2
   375
            * Return Right index into table "Note With Image Popup Window
williamr@2
   376
            * Texts Line 1". Index depends on number of text lines and image
williamr@2
   377
            * size. See table in *.lay and LAF specs for working out indexes.
williamr@2
   378
            *
williamr@2
   379
            * Table has 3 dimensions:-
williamr@2
   380
            * - Dimension 1 is the line number
williamr@2
   381
            * - Dimension 2 is the image width  
williamr@2
   382
            * - Dimension 3 is the image height 
williamr@2
   383
            * 
williamr@2
   384
            * @param aLineNum Line number.
williamr@2
   385
            * @return Right index into table "Note With Image Popup Window
williamr@2
   386
            * Texts Line 1".
williamr@2
   387
            */
williamr@2
   388
			TInt NWIPWindowTextsLine1R(TInt aLineNum) const;
williamr@2
   389
williamr@2
   390
			/**
williamr@2
   391
            * Return Bottom index into table "Note With Image Popup Window
williamr@2
   392
            * Texts Line 1". Index is the same as the number of text lines
williamr@2
   393
            * minus one. See table in *.lay and LAF specs for working out
williamr@2
   394
            * indexes.
williamr@2
   395
            * @param aLineNum Line number.
williamr@2
   396
            * @return Bottom index into table "Note With Image Popup Window
williamr@2
   397
            * Texts Line 1".
williamr@2
   398
            */
williamr@2
   399
			TInt NWIPWindowTextsLine1B(TInt aLineNum) const;
williamr@2
   400
williamr@2
   401
			/**
williamr@2
   402
            * Return Width index into table "Note With Image Popup Window 
williamr@2
   403
            * Texts Line 1". Index depends on number of text lines, whether or
williamr@2
   404
            * not there is a number type indication (NTI) and image size. See
williamr@2
   405
            * table in *.lay and LAF specs for working out indexes.
williamr@2
   406
            *
williamr@2
   407
            * Table has 4 dimensions:-
williamr@2
   408
            * - Dimension 1 indicates the presence of an NTI(index 0 = NO NTI,
williamr@2
   409
            * index 1 = NTI)
williamr@2
   410
            * - Dimension 2 is the line number
williamr@2
   411
            * - Dimension 3 is the image width
williamr@2
   412
            * - Dimension 4 is the image height
williamr@2
   413
            *
williamr@2
   414
            * @param aLineNum Line number.
williamr@2
   415
            * @return Width index into table "Note With Image Popup Window
williamr@2
   416
            * Texts Line 1".
williamr@2
   417
            */
williamr@2
   418
			TInt NWIPWindowTextsLine1W(TInt aLineNum) const;
williamr@2
   419
			
williamr@2
   420
            /**
williamr@2
   421
            * Return indexes for table @c AKN_LAYOUT_WINDOW_popup_note_window.
williamr@2
   422
            * If there are 0-2 lines the index is 0. If there are 3 lines the
williamr@2
   423
            * index is 1, if there are 4 or more lines the index is 2.
williamr@2
   424
            * @return Indexes for table @c AKN_LAYOUT_WINDOW_popup_note_window.
williamr@2
   425
            */
williamr@2
   426
			TInt PopupNoteWindow() const;
williamr@2
   427
	
williamr@2
   428
	        /**
williamr@2
   429
            * Return indexes for table 
williamr@2
   430
            * @c AKN_LAYOUT_WINDOW_popup_note_wait_window. 
williamr@2
   431
            * If there are 0-2 lines the index is 0. If there are 3 lines the
williamr@2
   432
            * index is 1, if there are 4 lines the index is 2.
williamr@2
   433
            * @return Indexes for table 
williamr@2
   434
            * @c AKN_LAYOUT_WINDOW_popup_note_wait_window.
williamr@2
   435
            */
williamr@2
   436
			TInt PopupNoteWaitWindow() const;
williamr@2
   437
williamr@2
   438
		private:	
williamr@2
   439
			void SelfTest() const;	
williamr@2
   440
			TInt ImageWidthIndex() const;
williamr@2
   441
			TInt ImageHeightIndex() const;
williamr@2
   442
			TInt HasNtiIndex() const;
williamr@2
   443
williamr@2
   444
		private:	
williamr@2
   445
			TInt  iNumberOfLines;
williamr@2
   446
			TBool iHasNti;
williamr@2
   447
			TSize iImageSize;
williamr@2
   448
		};	
williamr@2
   449
williamr@2
   450
private:
williamr@2
   451
	//COECONTROL METHODS
williamr@2
   452
	void Draw(const TRect& aRect) const;
williamr@2
   453
	void SizeChanged();
williamr@2
   454
	void DoLayout();
williamr@2
   455
	TInt CountComponentControls() const;
williamr@2
   456
	CCoeControl* ComponentControl(TInt anIndex) const;
williamr@2
   457
private:
williamr@2
   458
    /**
williamr@2
   459
    * From CAknControl
williamr@2
   460
    */
williamr@2
   461
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   462
private:	
williamr@2
   463
	//LAYOUT METHODS
williamr@2
   464
	TInt NumberTypeIndicationIndex() const;
williamr@2
   465
	TInt ImageWidthIndex() const;
williamr@2
   466
williamr@2
   467
	TInt AnimationIndex();
williamr@2
   468
	void AnimationNoteLayout();
williamr@2
   469
williamr@2
   470
	//Layout for general notes
williamr@2
   471
	void GeneralNoteLayout();
williamr@2
   472
	void GeneralNoteLabelLayout();
williamr@2
   473
	void GeneralNoteIconLayout();
williamr@2
   474
williamr@2
   475
	//Layout for progress and wait notes
williamr@2
   476
	void ProgressNoteLayout();
williamr@2
   477
	void ProgressNoteLabelLayout();
williamr@2
   478
	void ProgressNoteProgressBarLayout();
williamr@2
   479
	void ProgressNoteIconLayout();
williamr@2
   480
	void ProgressNoteNumberTypeIndicationLayout();
williamr@2
   481
williamr@2
   482
	//Layout for image notes
williamr@2
   483
	void ImageNoteLayout();
williamr@2
   484
	void ImageNoteLabelLayout();
williamr@2
   485
	void ImageNoteImageLayout();
williamr@2
   486
	void ImageNoteShadowLayout();
williamr@2
   487
	void ImageNoteNumberTypeIndicationLayout();
williamr@2
   488
williamr@2
   489
	TAknWindowLineLayout GetImageLayout(const TSize& aSize); 
williamr@2
   490
	TAknWindowLineLayout GetImageShadowLayout(const TSize& aSize); 
williamr@2
   491
williamr@2
   492
	TRect LayoutRect() const;
williamr@2
   493
	void SetLineWidthsL();
williamr@2
   494
williamr@2
   495
	
williamr@2
   496
	void ReduceImageIfNeeded();
williamr@2
   497
williamr@2
   498
	void ParseTextL();
williamr@2
   499
williamr@2
   500
private:
williamr@2
   501
	CAknTextControl*    TextControl() const; 
williamr@2
   502
williamr@2
   503
	CEikImage* Image() const; 
williamr@2
   504
	CEikImage* Icon() const; 
williamr@2
   505
	
williamr@2
   506
	CEikProgressInfo* ProgressBar() const; 
williamr@2
   507
	
williamr@2
   508
	CAknProgressTimer* Timer() const; 
williamr@2
   509
	CAknBitmapAnimation* Animation() const; 
williamr@2
   510
	
williamr@2
   511
	TBitFlags&  Flags() const; 
williamr@2
   512
williamr@2
   513
private:
williamr@2
   514
	TInt                iNoteLayout;
williamr@2
   515
	TAknLayoutRect      iShadowRect;
williamr@2
   516
	TBool               iImageHasShadow;
williamr@2
   517
	
williamr@2
   518
	CAknNoteAttributes*  iAttributes;
williamr@2
   519
	CArrayFixFlat<TInt>* iLineWidths;
williamr@2
   520
williamr@2
   521
public:
williamr@2
   522
	/**
williamr@2
   523
	 * @deprecated - use SetTextL() method. 
williamr@2
   524
	 * @param aText aText string to set.
williamr@2
   525
	 */
williamr@2
   526
	 
williamr@2
   527
	IMPORT_C void SetDynamicTextL(const TDesC& aText);
williamr@2
   528
	
williamr@2
   529
	/**
williamr@2
   530
	 * @deprecated - use @c SetTextL().
williamr@2
   531
	 */		
williamr@2
   532
	IMPORT_C void UpdateAndFormatLabelsL(const TDesC& aLabels);
williamr@2
   533
	
williamr@2
   534
	/**
williamr@2
   535
	 * @deprecated - use @c SetTextL().
williamr@2
   536
	 */		
williamr@2
   537
	IMPORT_C void UpdateLabelsL(const TDesC& aLabel1, 
williamr@2
   538
	                            const TDesC& aLabel2=KNullDesC, 
williamr@2
   539
	                            const TDesC& aLabel3=KNullDesC);
williamr@2
   540
	/**
williamr@2
   541
	 * @deprecated - use @c SetTextL().
williamr@2
   542
	 */	 	
williamr@2
   543
	IMPORT_C void UpdateLabels(const TDesC& aLabel1, 
williamr@2
   544
	                           const TDesC& aLabel2=KNullDesC, 
williamr@2
   545
	                           const TDesC& aLabel3=KNullDesC);
williamr@2
   546
williamr@2
   547
	/**
williamr@2
   548
     * @deprecated - label length is taken care of already.
williamr@2
   549
     *
williamr@2
   550
     * Don't use this method anymore. Empty implementation.
williamr@2
   551
     */
williamr@2
   552
	IMPORT_C void SetLabelReserveLengthL(TInt aLength1=0, 
williamr@2
   553
	                                     TInt aLength2=0, 
williamr@2
   554
	                                     TInt aLength3=0);
williamr@2
   555
	
williamr@2
   556
protected: // from MObjectProvider
williamr@2
   557
williamr@2
   558
    /**
williamr@2
   559
    * From @c MObjectProvider. Gets an (@c MAknsControlContext) object whose 
williamr@2
   560
    * type is encapsulated by the specified @c TTypeUid object. Calls 
williamr@2
   561
    * @c SupplyMopObject(TTypeUid aId, CEikButtonGroupContainer* iCba, 
williamr@2
   562
    * CEikMenuBar* iMenu).
williamr@2
   563
    * @since Series 60 2.0
williamr@2
   564
    * @param aId Encapsulates the UID that identifies the type of object
williamr@2
   565
    * required.
williamr@2
   566
    * @return Pointer to the @c MAknsControlContext object provided. Note that
williamr@2
   567
    * the pointer may be @c NULL.
williamr@2
   568
    */
williamr@2
   569
	IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
williamr@2
   570
williamr@2
   571
public: // new methods
williamr@2
   572
williamr@2
   573
    /**
williamr@2
   574
    * Sets up background rectangle context. 
williamr@2
   575
    * @since Series 60 2.1
williamr@2
   576
    * @param aRect Rectangle position to layout the outer and the inner
williamr@2
   577
    * rectangles of the frame.
williamr@2
   578
    * @param aPos Relative coordinates of parent position in screen. 
williamr@2
   579
    * @param aOwnerNotDialog @c ETrue if the owner is non-dialog control.
williamr@2
   580
    */
williamr@2
   581
	IMPORT_C void SetBgRect(const TRect& aRect, 
williamr@2
   582
	                        const TPoint& aPos, 
williamr@2
   583
	                        TBool aOwnerNotDialog = EFalse);
williamr@2
   584
	                        
williamr@2
   585
	/**
williamr@2
   586
    * @return note layout type 
williamr@2
   587
    * see @c Avkon.hrh for Note dialog constants
williamr@2
   588
    */
williamr@2
   589
	TInt NoteLayout() const;
williamr@2
   590
	};
williamr@2
   591
williamr@2
   592
#endif // AKNNOTECONTROL_H