epoc32/include/app/spdiacontrol.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 - 2005 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@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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:  A utility that provides services to both the Speeddial and
williamr@2
    15
*                PhoneBook applications for getting and setting speeddial
williamr@2
    16
*                number configuration.
williamr@2
    17
*
williamr@2
    18
*/
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
#ifndef SPDIACONTROL_H
williamr@2
    23
#define SPDIACONTROL_H
williamr@2
    24
williamr@2
    25
// INCLUDES
williamr@2
    26
#include <coecntrl.h>
williamr@2
    27
#include <TPbkContactItemField.h>
williamr@2
    28
#include <aknutils.h>
williamr@2
    29
#include <MPbkContactDbObserver.h>
williamr@2
    30
#include <MPbkThumbnailOperationObservers.h>
williamr@2
    31
williamr@2
    32
// FORWARD DECLARATIONS
williamr@2
    33
class CAknGrid;
williamr@2
    34
class CGulIcon;
williamr@2
    35
class CEikonEnv;
williamr@2
    36
class TSpdiaIndexData;
williamr@2
    37
class CPbkContactEngine;
williamr@2
    38
class RPbkViewResourceFile;
williamr@2
    39
class CEikStatusPane;
williamr@2
    40
class CPAlbImageData;
williamr@2
    41
class CSpdiaGridDlg;
williamr@2
    42
class CPbkContactChangeNotifier;
williamr@2
    43
class CPbkSingleItemFetchDlg;
williamr@2
    44
class CAknQueryDialog;
williamr@2
    45
williamr@2
    46
class CPAlbImageFactory;
williamr@2
    47
class CPbkThumbnailManager;
williamr@2
    48
williamr@2
    49
class CAknsBasicBackgroundControlContext;
williamr@2
    50
#include <AknsConstants.h>
williamr@2
    51
williamr@2
    52
// CLASS DECLARATION
williamr@2
    53
williamr@2
    54
/**
williamr@2
    55
*  A utility that provides services to both the Speeddial and PhoneBook
williamr@2
    56
*  applications for getting and setting speeddial number configuration.
williamr@2
    57
*
williamr@2
    58
*  @lib SpdCtrl.DLL
williamr@2
    59
*  @deprecated
williamr@2
    60
*  @since
williamr@2
    61
*/
williamr@2
    62
// one line code added for build ver 2.6
williamr@2
    63
const TInt KArraySize =9; 
williamr@2
    64
class CSpdiaControl    : public CCoeControl,
williamr@2
    65
                         public MPbkContactDbObserver,
williamr@2
    66
                         private MPbkThumbnailGetObserver
williamr@2
    67
    {
williamr@2
    68
    public:     // SpdiaControl APIs
williamr@2
    69
        /**
williamr@2
    70
        * Creates a new instace of this class.
williamr@2
    71
        */
williamr@2
    72
        IMPORT_C static CSpdiaControl* NewL();
williamr@2
    73
williamr@2
    74
        /**
williamr@2
    75
        * Creates a new instace of this class.
williamr@2
    76
        *
williamr@2
    77
        * @param aPbkEngine     reference of CPbkContactEngine.
williamr@2
    78
        */
williamr@2
    79
        IMPORT_C static CSpdiaControl* NewL(
williamr@2
    80
                                CPbkContactEngine& aPbkEngine);
williamr@2
    81
williamr@2
    82
        /**
williamr@2
    83
        * Puts a query on the screen asking for '...Assign it now'.
williamr@2
    84
        * When the user goes through, it will assign speed dial.
williamr@2
    85
        *
williamr@2
    86
        * @param aLocation      a location to assign speed dial.
williamr@2
    87
        * @param aStatusPane    not used.
williamr@2
    88
        * @reutn    ETrue if success.
williamr@2
    89
        */
williamr@2
    90
        IMPORT_C TBool AssignDialNumberL(TInt aLocation,
williamr@2
    91
                            CEikStatusPane* aStatusPane = NULL);
williamr@2
    92
williamr@2
    93
        /**
williamr@2
    94
        * Runs the Speed Dial Selection Grid Dialog.
williamr@2
    95
        * If accepted sets speed dial key to aItem's aFieldId.
williamr@2
    96
        * Note: Calls CPbkContactEngine::SetFieldAsSpeedDialL().
williamr@2
    97
        *       If necessary, calls CPbkContactEngine::RemoveSpeedDialFieldL().
williamr@2
    98
        *
williamr@2
    99
        * @param aId        a contact item id. (Don't open)
williamr@2
   100
        * @param aFieldId   index to aItems field set.
williamr@2
   101
        * @return   nonzero if accepted, zero if canceled.
williamr@2
   102
        */
williamr@2
   103
        IMPORT_C TInt ExecuteLD(TContactItemId aId, TInt aFieldIdx);
williamr@2
   104
williamr@2
   105
        /**
williamr@2
   106
        * Cancels and dismisses this dialog. In other words makes
williamr@2
   107
        * ExecuteLD return just like cancel was pressed.
williamr@2
   108
        * Used when user switches a application and all modal
williamr@2
   109
        * dialogs are closed.
williamr@2
   110
        */
williamr@2
   111
        IMPORT_C void Cancel();
williamr@2
   112
williamr@2
   113
        /**
williamr@2
   114
        * The assigned number of the location is obtained.
williamr@2
   115
        * Note: Voice mail number will be returned if the location
williamr@2
   116
        *       is the position of Voice mail.
williamr@2
   117
        * Note: If the location is empty, required dialog
williamr@2
   118
        *       will be displayed and a location will be assigned.
williamr@2
   119
        *
williamr@2
   120
        * @param aLocation      a location of speed dial.
williamr@2
   121
        * @param aPhonenumber   reference of phonenumber.
williamr@2
   122
        * @param aStatusPane    not used.
williamr@2
   123
        * @return   EFalse if user cancel or failed.
williamr@2
   124
        */
williamr@2
   125
        IMPORT_C TBool DialNumberL(TInt aLocation, TDes& aPhoneNumber,
williamr@2
   126
                            CEikStatusPane* aStatusPane = NULL);
williamr@2
   127
williamr@2
   128
    private:  // Constructors
williamr@2
   129
        /**
williamr@2
   130
        * C++ default constructor.
williamr@2
   131
        */
williamr@2
   132
        CSpdiaControl();
williamr@2
   133
williamr@2
   134
        /**
williamr@2
   135
        * C++ constructor.
williamr@2
   136
        */
williamr@2
   137
        CSpdiaControl(CPbkContactEngine* aPbkEngine);
williamr@2
   138
        
williamr@2
   139
        /**
williamr@2
   140
        * Gets actual size of thumbnial to be drawn.
williamr@2
   141
        * @return  size of thumbnail.
williamr@2
   142
        */
williamr@2
   143
        TSize GetThumbnailSize();
williamr@2
   144
williamr@2
   145
    public:  // Destructor
williamr@2
   146
williamr@2
   147
        /**
williamr@2
   148
        * Destructor.
williamr@2
   149
        */
williamr@2
   150
        IMPORT_C virtual ~CSpdiaControl();
williamr@2
   151
williamr@2
   152
    public:     // New function
williamr@2
   153
        /**
williamr@2
   154
        * The number of voice mail returned, if voice mail is assigned.
williamr@2
   155
        * Note: If the location is empty, required dialog
williamr@2
   156
        * will be displayed and voice mail will be defined.
williamr@2
   157
        *
williamr@2
   158
        * @param aNumber    reference of phone number.
williamr@2
   159
        * @retunr   EFalse if user cancel or failed.
williamr@2
   160
        */
williamr@2
   161
        IMPORT_C TBool VoiceMailL(TDes& aNumber);
williamr@2
   162
williamr@2
   163
        /**
williamr@2
   164
        * Returns the owned Phone Book Engine.
williamr@2
   165
        */
williamr@2
   166
        IMPORT_C CPbkContactEngine* PbkEngine() const;
williamr@2
   167
williamr@2
   168
        /**
williamr@2
   169
        * The value converted into the index of an array from
williamr@2
   170
        * the location of speeddial is returned.
williamr@2
   171
        *
williamr@2
   172
        * @param aDial      a location of speed dial.
williamr@2
   173
        * @return   the index of a speeddial index data, if not found -1
williamr@2
   174
        */
williamr@2
   175
        IMPORT_C TInt Index(TInt aDial) const;
williamr@2
   176
williamr@2
   177
        /**
williamr@2
   178
        * The value converted into the the location of speeddial
williamr@2
   179
        * from index of an array is returned.
williamr@2
   180
        *
williamr@2
   181
        * @param aIndex     a index of array.
williamr@2
   182
        * @return   location of speed dial(1-9), if not found -1
williamr@2
   183
        */
williamr@2
   184
        IMPORT_C TInt Number(TInt aIndex) const;
williamr@2
   185
williamr@2
   186
        /**
williamr@2
   187
        * Returns the phone book contact item's id.
williamr@2
   188
        *
williamr@2
   189
        * @param aIndex     a index of array.
williamr@2
   190
        * @return   a contact item's id, if not found -1
williamr@2
   191
        */
williamr@2
   192
        IMPORT_C TContactItemId ContactId(TInt aIndex) const;
williamr@2
   193
williamr@2
   194
        /**
williamr@2
   195
        * Returns the phone number of a speed dial contact.
williamr@2
   196
        * Note: A character invalid as a phone number is removed.
williamr@2
   197
        *
williamr@2
   198
        * @param aDial      a location of speeddial.
williamr@2
   199
        * @return   phone number
williamr@2
   200
        */
williamr@2
   201
        IMPORT_C const TDesC& PhoneDialNumber(TInt aDial) const;
williamr@2
   202
williamr@2
   203
        /**
williamr@2
   204
        * Returns the phone number of a speed dial contact.
williamr@2
   205
        * Note: left and right spaces are removed.
williamr@2
   206
        *
williamr@2
   207
        * @param aIndex     a index of array.
williamr@2
   208
        */
williamr@2
   209
        IMPORT_C const TDesC& PhoneNumber(TInt aIndex) const;
williamr@2
   210
williamr@2
   211
    public:   // SpeedDial internal API
williamr@2
   212
        /**
williamr@2
   213
        * Gets a title text from contact item's id.
williamr@2
   214
        * Note:  calls CPbkContactItem::GetContactTitleOrNullL()
williamr@2
   215
        *              or CPbkContactEngine::UnnamedTitle()
williamr@2
   216
        *
williamr@2
   217
        * @param aCid       contact item's id
williamr@2
   218
        * @param aUnnamed   if title is empty, unname or NULL.
williamr@2
   219
        * @return   a buffer containing the title. An unnametitle will
williamr@2
   220
        *           be set if a title is empty.
williamr@2
   221
        */
williamr@2
   222
        IMPORT_C HBufC* ContactTitleL(TContactItemId aCid, TBool aUnnamed);
williamr@2
   223
williamr@2
   224
        /**
williamr@2
   225
        * Returns the icon index of a grid array.
williamr@2
   226
        *
williamr@2
   227
        * @param aIndex     a index of array.
williamr@2
   228
        */
williamr@2
   229
        IMPORT_C TInt IconIndex(TInt aIndex) const;
williamr@2
   230
williamr@2
   231
        /**
williamr@2
   232
        * Returns the thumbnail index of a grid array.
williamr@2
   233
        *
williamr@2
   234
        * @param aIndex     a index of array.
williamr@2
   235
        */
williamr@2
   236
        IMPORT_C TInt ThumbIndex(TInt aIndex) const;
williamr@2
   237
williamr@2
   238
        /**
williamr@2
   239
        * Returns the array of icons
williamr@2
   240
        */
williamr@2
   241
        IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
williamr@2
   242
williamr@2
   243
        /**
williamr@2
   244
        * Icons, thumbnails and text array for the grid are created.
williamr@2
   245
        * Note: If a aIndex parameter is set, only the data of the value
williamr@2
   246
        *       will be set up.
williamr@2
   247
        * Note: CreateDataL() is used if App to be used is except SD.
williamr@2
   248
        *
williamr@2
   249
        * @param aGrid      the grid to set up
williamr@2
   250
        * @param aIndex     (TInt) if <-1, All values are set up.
williamr@2
   251
        */
williamr@2
   252
        IMPORT_C TBool CreateGridDataL(CAknGrid* aGrid, TBool aIndex);
williamr@2
   253
williamr@2
   254
        /**
williamr@2
   255
        * Assigns the index data at the index in the phone book's contact entry.
williamr@2
   256
        *
williamr@2
   257
        * @param aIndex     a index of array.
williamr@2
   258
        */
williamr@2
   259
        IMPORT_C TBool AssignDialIndexL(TInt aIndex);
williamr@2
   260
williamr@2
   261
        /**
williamr@2
   262
        * Removes a speed dial from the phone book's contact entry.
williamr@2
   263
        *
williamr@2
   264
        * @param aIndex         a index of array.
williamr@2
   265
        * @param aConfirmation  when remove, confirm is displayed.
williamr@2
   266
        * @reutn    ETrue if success
williamr@2
   267
        */
williamr@2
   268
        IMPORT_C TBool RemoveDialIndexL(TInt aIndex,
williamr@2
   269
                            TBool aConfirmation = ETrue);
williamr@2
   270
        /**
williamr@2
   271
        * deprecated - do not use
williamr@2
   272
        */
williamr@2
   273
        IMPORT_C TBool AssignNumberL(TInt aIndex,
williamr@2
   274
                            CEikStatusPane* aStatusPane,
williamr@2
   275
                            CCoeControl* aContainer,
williamr@2
   276
                            TBool aConfirmation);
williamr@2
   277
        IMPORT_C void ApplyCellSpdiaPaneStyleL(CAknGrid& aListBox, TSize& aSize);
williamr@2
   278
        IMPORT_C void DrawShadow(CWindowGc& aGc, const TSize& aSize);
williamr@2
   279
williamr@2
   280
        /**
williamr@2
   281
        * The position which a shadow draws is set up.
williamr@2
   282
        *
williamr@2
   283
        * @param aRect
williamr@2
   284
        */
williamr@2
   285
        IMPORT_C void SetLayout(const TRect& aRect);
williamr@2
   286
williamr@2
   287
        /**
williamr@2
   288
        * deprecated - do not use
williamr@2
   289
        */
williamr@2
   290
        IMPORT_C TInt Size() const;
williamr@2
   291
williamr@2
   292
        /**
williamr@2
   293
        * Returns the position of voice mail box
williamr@2
   294
        */
williamr@2
   295
        IMPORT_C TInt VMBoxPosition() const;
williamr@2
   296
williamr@2
   297
        /**
williamr@2
   298
        * Returns the icon index of grid array.
williamr@2
   299
        */
williamr@2
   300
        IMPORT_C TInt SpdIconIndex(TInt aIndex) const;
williamr@2
   301
williamr@2
   302
        /**
williamr@2
   303
        * Returns type of the phone number.
williamr@2
   304
        */
williamr@2
   305
        IMPORT_C TInt NumberType(TInt aIndex) const;
williamr@2
   306
		/**
williamr@2
   307
        * Build ver 2.6 . Deletes the old icon array.
williamr@2
   308
        */
williamr@2
   309
		IMPORT_C void DeleteIconArray();
williamr@2
   310
		/**
williamr@2
   311
        * Build ver 2.6 .  Reloads the new skin icons
williamr@2
   312
        */
williamr@2
   313
		IMPORT_C void ReloadIconArray();
williamr@2
   314
		
williamr@2
   315
		IMPORT_C TInt VoiceMailType();
williamr@2
   316
		/**
williamr@2
   317
        * Returns last error.
williamr@2
   318
        */
williamr@2
   319
		IMPORT_C TInt GetSpdCtrlLastError();
williamr@2
   320
		/**
williamr@2
   321
        * Internal rutine to check if pop up has to be shown
williamr@2
   322
        * to enable the One-Key-Dialling setting.
williamr@2
   323
        * @return   bool value of one key calling status on or off.
williamr@2
   324
        */
williamr@2
   325
       IMPORT_C  TBool CheckingIfPopUpNeeded();
williamr@2
   326
		
williamr@2
   327
	private:
williamr@2
   328
		/**
williamr@2
   329
        * Internal rutine to check if pop up has to be shown
williamr@2
   330
        * to enable the One-Key-Dialling setting.
williamr@2
   331
        * @return   bool value of one key calling status on or off.
williamr@2
   332
        */
williamr@2
   333
		TBool CheckingIfPopUpNeededL();
williamr@2
   334
		
williamr@2
   335
		/**
williamr@2
   336
        * Build ver 2.6 .  Reloads the new skin icons
williamr@2
   337
        */
williamr@2
   338
		 void ReloadIconArrayL();
williamr@2
   339
		
williamr@2
   340
    public:
williamr@2
   341
        /**
williamr@2
   342
        * Creates a grid itemArray.
williamr@2
   343
        * Note: It calls, when using a grid except SDM.
williamr@2
   344
        *
williamr@2
   345
        * @param aGrid      the grid to set up
williamr@2
   346
        * @param aUpdate    updates in an event.
williamr@2
   347
        */
williamr@2
   348
        TBool CreateDataL(const CAknGrid& aGrid);
williamr@2
   349
williamr@2
   350
        /**
williamr@2
   351
        * Returns the size of grid.
williamr@2
   352
        */
williamr@2
   353
//        TSize GridSize() const;  // not referenced...
williamr@2
   354
williamr@2
   355
        /**
williamr@2
   356
        * Display confirmation dialog from id's
williamr@2
   357
        *
williamr@2
   358
        * @param aIndex     a index of array.
williamr@2
   359
        * @param aId        resource id
williamr@2
   360
        * @param aPromptId  prompt id
williamr@2
   361
        */
williamr@2
   362
        TBool ConfirmationNumberL(TInt aIndex,
williamr@2
   363
                        TInt aId,
williamr@2
   364
                        TInt aPromptId);
williamr@2
   365
williamr@2
   366
        /**
williamr@2
   367
        * Thumbnail's shadow is drawn.
williamr@2
   368
        *
williamr@2
   369
        * @param aGc    window gc
williamr@2
   370
        */
williamr@2
   371
        void DrawShadow(CWindowGc& aGc) const;
williamr@2
   372
williamr@2
   373
    private:    // Functions from base classes
williamr@2
   374
        // from MpblThumbnailOperation
williamr@2
   375
        /**
williamr@2
   376
        * Called when thumbnail loading is completed.
williamr@2
   377
        *
williamr@2
   378
        * @param aOperation    the completed operation.
williamr@2
   379
        * @param aBitmap       The loaded bitmap. Callee is responsible of
williamr@2
   380
        *                      the bitmap.
williamr@2
   381
        */
williamr@2
   382
        void PbkThumbnailGetComplete(MPbkThumbnailOperation& aOperation,
williamr@2
   383
                                     CFbsBitmap* aBitmap);
williamr@2
   384
williamr@2
   385
        /**
williamr@2
   386
        * Called if the thumbnail loading fails.
williamr@2
   387
        *
williamr@2
   388
        * @param aOperation     the failed operation.
williamr@2
   389
        * @param aError         error code of the failure.
williamr@2
   390
        */
williamr@2
   391
        void PbkThumbnailGetFailed
williamr@2
   392
            (MPbkThumbnailOperation& aOperation, TInt aError);
williamr@2
   393
williamr@2
   394
        /**
williamr@2
   395
        * Passes skin information when needed.
williamr@2
   396
        **/
williamr@2
   397
        TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
williamr@2
   398
williamr@2
   399
    private:
williamr@2
   400
    	 
williamr@2
   401
        /**
williamr@2
   402
        * Called when thumbnail loading is completed.
williamr@2
   403
        *
williamr@2
   404
        * @param aOperation    the completed operation.
williamr@2
   405
        * @param aBitmap       The loaded bitmap. Callee is responsible of
williamr@2
   406
        *                      the bitmap.
williamr@2
   407
        */
williamr@2
   408
    	 void PbkThumbnailGetCompleteL(MPbkThumbnailOperation& aOperation,
williamr@2
   409
                                     CFbsBitmap* aBitmap);
williamr@2
   410
williamr@2
   411
    private:  // from CCoeControl
williamr@2
   412
        /**
williamr@2
   413
         * Draw this control
williamr@2
   414
         */
williamr@2
   415
        void Draw(const TRect& aRect) const;
williamr@2
   416
williamr@2
   417
        /**
williamr@2
   418
         * Set size for the skin background context.
williamr@2
   419
         */
williamr@2
   420
        void SizeChanged();
williamr@2
   421
williamr@2
   422
    private:
williamr@2
   423
        /**
williamr@2
   424
        * From MContactDbObserver, Handles an event of type aEventType.
williamr@2
   425
        */
williamr@2
   426
        void HandleDatabaseEventL(TContactDbObserverEvent aEvent);
williamr@2
   427
williamr@2
   428
    private:    // functions
williamr@2
   429
        /**
williamr@2
   430
        * Constructor
williamr@2
   431
        */
williamr@2
   432
        void ConstructL();
williamr@2
   433
williamr@2
   434
        /**
williamr@2
   435
        * Index data are initialized.
williamr@2
   436
        */
williamr@2
   437
        void InitIndexDataL();
williamr@2
   438
williamr@2
   439
        /**
williamr@2
   440
        * Updates data set to match index of the owned index data array.
williamr@2
   441
        */
williamr@2
   442
        TBool UpdateIndexDataL(TInt aIndex);
williamr@2
   443
williamr@2
   444
        /**
williamr@2
   445
        * Searches icon of grid array for a match.
williamr@2
   446
        *
williamr@2
   447
        * @param aId     phone book icon id to match to.
williamr@2
   448
        * @return   the matching index, -1 if not found.
williamr@2
   449
        */
williamr@2
   450
        TInt FindIconIndex(TInt aId) const;
williamr@2
   451
williamr@2
   452
        /**
williamr@2
   453
        * Returns the thumbnail type.
williamr@2
   454
        *
williamr@2
   455
        * @param aIndex     a index of array.
williamr@2
   456
        */
williamr@2
   457
        TInt ThumbType(TInt aIndex) const;
williamr@2
   458
williamr@2
   459
        /**
williamr@2
   460
        * Returns the thumbnail size.
williamr@2
   461
        *
williamr@2
   462
        * @param aIndex     a index of array.
williamr@2
   463
        */
williamr@2
   464
        TSize ThumbSize(TInt aIndex) const;
williamr@2
   465
williamr@2
   466
        /**
williamr@2
   467
        * Set phonebook contact itmes'id.
williamr@2
   468
        *
williamr@2
   469
        * @param aIndex     a index of array.
williamr@2
   470
        * @param aCid       phone book contact item's id.
williamr@2
   471
        */
williamr@2
   472
        void SetContactId(TInt aIndex, TContactItemId aCid);  // not referenced...
williamr@2
   473
williamr@2
   474
        /**
williamr@2
   475
        * The position on the array that a grid uses from
williamr@2
   476
        * an item and a phone number is returned.
williamr@2
   477
        *
williamr@2
   478
        * @param aItem      contacd item
williamr@2
   479
        * @param aDial      phone number
williamr@2
   480
        */
williamr@2
   481
        TInt IconPositionL(const CPbkContactItem& aItem, TInt aDial, TInt& aFieldId);
williamr@2
   482
williamr@2
   483
        /**
williamr@2
   484
        * An icon array is created and set.
williamr@2
   485
        *
williamr@2
   486
        * @retunr   if need loadthumbL ETrue
williamr@2
   487
        */
williamr@2
   488
        TInt SetIconArrayL(CArrayPtrFlat<CGulIcon>* aArray);
williamr@2
   489
williamr@2
   490
        /**
williamr@2
   491
        * Gets Item's descriptor for Grid.
williamr@2
   492
        *
williamr@2
   493
        * @param aIndex     a index of array.
williamr@2
   494
        * @param aSdmData   reference to the data currently used.
williamr@2
   495
        * @return   a buffer containing the descriptor text.
williamr@2
   496
        */
williamr@2
   497
        HBufC* ItemDescriptorLC(TInt aIndex, const TSpdiaIndexData& aSdmData);
williamr@2
   498
williamr@2
   499
        /**
williamr@2
   500
        * Creates Item's descriptor for Grid.
williamr@2
   501
        *
williamr@2
   502
        * @param aSdmData   reference to the data currently used.
williamr@2
   503
        * @returen  a buffer containing the descriptor text.
williamr@2
   504
        */
williamr@2
   505
        HBufC* CreateItemDescriptorLC(const TSpdiaIndexData& aSdmData);
williamr@2
   506
williamr@2
   507
        /**
williamr@2
   508
        * A descriptor is added to a text.
williamr@2
   509
        *
williamr@2
   510
        * @param aSdmData   reference to the data currently used.
williamr@2
   511
        * @param aText      the text for storing
williamr@2
   512
        */
williamr@2
   513
        void AppendTextL(const TSpdiaIndexData& aSdmData, TPtr& aText);
williamr@2
   514
williamr@2
   515
        /**
williamr@2
   516
        * Searches contact item's fiels of this contact for a match.
williamr@2
   517
        *
williamr@2
   518
        * @param aItem      contact item to search.
williamr@2
   519
        * @param aFieldId   field id to search.
williamr@2
   520
        * @return   first field matching aFieldId, NULL if none found.
williamr@2
   521
        */
williamr@2
   522
        TPbkContactItemField* FindFieldL(CPbkContactItem& aItem,
williamr@2
   523
                                    TPbkFieldId aFieldId);
williamr@2
   524
williamr@2
   525
        /**
williamr@2
   526
        * The descriptor for thumbnail is added.
williamr@2
   527
        *
williamr@2
   528
        * @param aSdmData           reference to the data currently used.
williamr@2
   529
        * @param aText
williamr@2
   530
        * @param aFixedLocation
williamr@2
   531
        */
williamr@2
   532
        void AppendThumbnail(const TSpdiaIndexData& aSdmData,
williamr@2
   533
                            TPtr& aText,
williamr@2
   534
                            TBool aFixedLocation);
williamr@2
   535
williamr@2
   536
        /**
williamr@2
   537
        * Returns the type from a size of thumbnail.
williamr@2
   538
        *
williamr@2
   539
        * @param aSize  a thumbnail size
williamr@2
   540
        */
williamr@2
   541
        TInt ConvThumbType(const TSize& aSize) const;
williamr@2
   542
williamr@2
   543
        /**
williamr@2
   544
        * Operations to a CPbkThumbnailManager are set.
williamr@2
   545
        * Note: call GetThumbnailAsyncL().
williamr@2
   546
        */
williamr@2
   547
        void SetOperationsL();
williamr@2
   548
williamr@2
   549
        /**
williamr@2
   550
        * The data of items are added to an array.
williamr@2
   551
        *
williamr@2
   552
        * @param aArray
williamr@2
   553
        */
williamr@2
   554
        void SetItemDataL(CDesCArray& aArray);
williamr@2
   555
williamr@2
   556
        /**
williamr@2
   557
        * Assigns the index data at aDial in the phone book's contact entry
williamr@2
   558
        *
williamr@2
   559
        * @param aId
williamr@2
   560
        * @param aDial
williamr@2
   561
        */
williamr@2
   562
        void AssignDialL(TContactItemId aId, TInt aFieldIdx, TInt aDial);
williamr@2
   563
williamr@2
   564
        /**
williamr@2
   565
        * Checks if the Flash File System storage will fall below
williamr@2
   566
        * Critical Level. Warning will be displayed if sotrage
williamr@2
   567
        * is below Critical Level.
williamr@2
   568
        *
williamr@2
   569
        * @return   ETrue   Below critical level
williamr@2
   570
        */
williamr@2
   571
        TBool CheckSpaceBelowCriticalLevelL();
williamr@2
   572
williamr@2
   573
        /**
williamr@2
   574
        * Does it have a thumbnail operation object to match?
williamr@2
   575
        *
williamr@2
   576
        * @param aOperation     a thumbnail operation object to match to.
williamr@2
   577
        * @return   index of speeddial index data array.
williamr@2
   578
        */
williamr@2
   579
        TInt HasOperation(const MPbkThumbnailOperation& aOperation);
williamr@2
   580
williamr@2
   581
        /**
williamr@2
   582
        * A text array that a grid has is erased.
williamr@2
   583
        */
williamr@2
   584
        void ResetArray();
williamr@2
   585
williamr@2
   586
        /**
williamr@2
   587
        * Speeddial index data is set by the data of parameters.
williamr@2
   588
        *
williamr@2
   589
        * @param aIndex     a index of array.
williamr@2
   590
        * @param aSdmData   reference to the data currently used.
williamr@2
   591
        */
williamr@2
   592
        void SetIndexDataL(TInt aIndex, TSpdiaIndexData& aSdmData);
williamr@2
   593
williamr@2
   594
        /**
williamr@2
   595
        * Speeddial index data is changed by the data of parameters.
williamr@2
   596
        *
williamr@2
   597
        * @param aIndex     a index of array.
williamr@2
   598
        * @param aSdmData   reference to the data currently used.
williamr@2
   599
        */
williamr@2
   600
        void ChangeIndexDataL(TInt aIndex, const TSpdiaIndexData& aSdmData);
williamr@2
   601
williamr@2
   602
        /**
williamr@2
   603
        * Creates icon data for SDM control data by the data of parameters.
williamr@2
   604
        *
williamr@2
   605
        * @param aIndex             a index of array.
williamr@2
   606
        * @param aSdmData           reference to the data currently used.
williamr@2
   607
        * @param aSetUpdateThumb    thumbnail load start parameter set in index data
williamr@2
   608
        */
williamr@2
   609
        TBool CreateIndexIconL(TInt aIndex, TSpdiaIndexData& aSdmData,
williamr@2
   610
                            TBool aSetUpdateThumb);
williamr@2
   611
williamr@2
   612
	    
williamr@2
   613
		private:
williamr@2
   614
			//code added for build ver 2.6
williamr@2
   615
			void InitializeArray();
williamr@2
   616
williamr@2
   617
    private:    // Data
williamr@2
   618
        // The type of the caller application.
williamr@2
   619
        enum TGridUse
williamr@2
   620
            {
williamr@2
   621
            EGridUse,               // SpeedDial
williamr@2
   622
            EGridUseAndUpdate,      // PhoneBook
williamr@2
   623
            EGridNoUse              // PhoneClient
williamr@2
   624
            };
williamr@2
   625
        CPbkContactEngine* iEngine;                 // owned by this
williamr@2
   626
        TBool iExEngine;                            // engine owned flags
williamr@2
   627
        TGridUse iGridUsed;
williamr@2
   628
williamr@2
   629
        TInt iSdmCount;                             // Grid cell count(Row * col)
williamr@2
   630
williamr@2
   631
        CArrayFixFlat<TSpdiaIndexData>* iSdmArray;  // owned by this
williamr@2
   632
        CArrayFixFlat<TAknLayoutRect>* iShadowLayout;     // owned by this
williamr@2
   633
williamr@2
   634
        CPbkContactChangeNotifier* iPbkNotifier;    // owned by this
williamr@2
   635
        CPbkSingleItemFetchDlg* iPbkSingleItem;     // owned by this
williamr@2
   636
        CAknQueryDialog* iQueryDialog;              // owned by this
williamr@2
   637
        RPbkViewResourceFile* iPbkResourceFile;     // owned by this
williamr@2
   638
        CSpdiaGridDlg* iGridDlg;                    // owned by this
williamr@2
   639
williamr@2
   640
        /// Own: thumbnail manager
williamr@2
   641
        CPbkThumbnailManager* iManager;
williamr@2
   642
        /// Own: factory for scaling to Thumbnails
williamr@2
   643
        CPAlbImageFactory* iThumbFactory;
williamr@2
   644
williamr@2
   645
        CAknGrid* iGrid;
williamr@2
   646
        TInt    iFileOffset;
williamr@2
   647
        CArrayPtrFlat<CGulIcon>* iIconArray;
williamr@2
   648
williamr@2
   649
        CAknsBasicBackgroundControlContext* iBgContext;
williamr@2
   650
	
williamr@2
   651
		// Variable used to know if the popup dialog has to be shown
williamr@2
   652
		// according to the release.
williamr@2
   653
		TBool iBooleanVarForAddingDialogVariation;
williamr@2
   654
		//Code added for build ver 2.6.
williamr@2
   655
		RArray<TAknsItemID>*iDialSkinBmp;
williamr@2
   656
		RArray<TAknsItemID>*iSkinIcons;
williamr@2
   657
		TAknLayoutRect icellLayout[KArraySize];
williamr@2
   658
		TBuf<254> iBmpPath;
williamr@2
   659
		TBuf<254> iRscPath;
williamr@2
   660
		TInt iType;
williamr@2
   661
		TInt iError;
williamr@2
   662
		TBool iPopupDialog;
williamr@2
   663
		CAknQueryDialog* iSaveChangesDialog;
williamr@2
   664
		TBool iSaveDlg;
williamr@2
   665
    };
williamr@2
   666
williamr@2
   667
#endif // SPDIACONTROL_H
williamr@2
   668
williamr@2
   669
// End of File
williamr@2
   670