spdiacontrol.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : SpdiaControl.h
00004 *  Part of     : SpeedDial / SpdCtrl.dll
00005 *  Interface   :
00006 *  Description : A utility that provides services to both the Speeddial and
00007 *                PhoneBook applications for getting and setting speeddial
00008 *                number configuration.
00009 *  Version     :
00010 *
00011 *  Copyright © 2002 - 2005 Nokia Corporation.
00012 *  This material, including documentation and any related
00013 *  computer programs, is protected by copyright controlled by
00014 *  Nokia Corporation. All rights are reserved. Copying,
00015 *  including reproducing, storing,  adapting or translating, any
00016 *  or all of this material requires the prior written consent of
00017 *  Nokia Corporation. This material also contains confidential
00018 *  information which may not be disclosed to others without the
00019 *  prior written consent of Nokia Corporation.
00020 * ============================================================================
00021 */
00022 
00023 
00024 #ifndef SPDIACONTROL_H
00025 #define SPDIACONTROL_H
00026 
00027 // INCLUDES
00028 #include <coecntrl.h>
00029 #include <TPbkContactItemField.h>
00030 #include <aknutils.h>
00031 #include <MPbkContactDbObserver.h>
00032 #include <MPbkThumbnailOperationObservers.h>
00033 
00034 // FORWARD DECLARATIONS
00035 class CAknGrid;
00036 class CGulIcon;
00037 class CEikonEnv;
00038 class TSpdiaIndexData;
00039 class CPbkContactEngine;
00040 class RPbkViewResourceFile;
00041 class CEikStatusPane;
00042 class CPAlbImageData;
00043 class CSpdiaGridDlg;
00044 class CPbkContactChangeNotifier;
00045 class CPbkSingleItemFetchDlg;
00046 class CAknQueryDialog;
00047 
00048 class CPAlbImageFactory;
00049 class CPbkThumbnailManager;
00050 
00051 class CAknsBasicBackgroundControlContext;
00052 #include <AknsConstants.h>
00053 
00054 // CLASS DECLARATION
00055 
00064 // one line code added for build ver 2.6
00065 const TInt KArraySize =9; 
00066 class CSpdiaControl    : public CCoeControl,
00067                          public MPbkContactDbObserver,
00068                          private MPbkThumbnailGetObserver
00069     {
00070     public:     // SpdiaControl APIs
00074         IMPORT_C static CSpdiaControl* NewL();
00075 
00081         IMPORT_C static CSpdiaControl* NewL(
00082                                 CPbkContactEngine& aPbkEngine);
00083 
00092         IMPORT_C TBool AssignDialNumberL(TInt aLocation,
00093                             CEikStatusPane* aStatusPane = NULL);
00094 
00105         IMPORT_C TInt ExecuteLD(TContactItemId aId, TInt aFieldIdx);
00106 
00113         IMPORT_C void Cancel();
00114 
00127         IMPORT_C TBool DialNumberL(TInt aLocation, TDes& aPhoneNumber,
00128                             CEikStatusPane* aStatusPane = NULL);
00129 
00130     private:  // Constructors
00134         CSpdiaControl();
00135 
00139         CSpdiaControl(CPbkContactEngine* aPbkEngine);
00140         
00145         TSize GetThumbnailSize();
00146 
00147     public:  // Destructor
00148 
00152         IMPORT_C virtual ~CSpdiaControl();
00153 
00154     public:     // New function
00163         IMPORT_C TBool VoiceMailL(TDes& aNumber);
00164 
00168         IMPORT_C CPbkContactEngine* PbkEngine() const;
00169 
00177         IMPORT_C TInt Index(TInt aDial) const;
00178 
00186         IMPORT_C TInt Number(TInt aIndex) const;
00187 
00194         IMPORT_C TContactItemId ContactId(TInt aIndex) const;
00195 
00203         IMPORT_C const TDesC& PhoneDialNumber(TInt aDial) const;
00204 
00211         IMPORT_C const TDesC& PhoneNumber(TInt aIndex) const;
00212 
00213     public:   // SpeedDial internal API
00224         IMPORT_C HBufC* ContactTitleL(TContactItemId aCid, TBool aUnnamed);
00225 
00231         IMPORT_C TInt IconIndex(TInt aIndex) const;
00232 
00238         IMPORT_C TInt ThumbIndex(TInt aIndex) const;
00239 
00243         IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
00244 
00254         IMPORT_C TBool CreateGridDataL(CAknGrid* aGrid, TBool aIndex);
00255 
00261         IMPORT_C TBool AssignDialIndexL(TInt aIndex);
00262 
00270         IMPORT_C TBool RemoveDialIndexL(TInt aIndex,
00271                             TBool aConfirmation = ETrue);
00275         IMPORT_C TBool AssignNumberL(TInt aIndex,
00276                             CEikStatusPane* aStatusPane,
00277                             CCoeControl* aContainer,
00278                             TBool aConfirmation);
00279         IMPORT_C void ApplyCellSpdiaPaneStyleL(CAknGrid& aListBox, TSize& aSize);
00280         IMPORT_C void DrawShadow(CWindowGc& aGc, const TSize& aSize);
00281 
00287         IMPORT_C void SetLayout(const TRect& aRect);
00288 
00292         IMPORT_C TInt Size() const;
00293 
00297         IMPORT_C TInt VMBoxPosition() const;
00298 
00302         IMPORT_C TInt SpdIconIndex(TInt aIndex) const;
00303 
00307         IMPORT_C TInt NumberType(TInt aIndex) const;
00311                 IMPORT_C void DeleteIconArray();
00315                 IMPORT_C void ReloadIconArray();
00316                 
00317                 IMPORT_C TInt VoiceMailType();
00321                 IMPORT_C TInt GetSpdCtrlLastError();
00327        IMPORT_C  TBool CheckingIfPopUpNeeded();
00328                 
00329         private:
00335                 TBool CheckingIfPopUpNeededL();
00336                 
00340                  void ReloadIconArrayL();
00341                 
00342     public:
00350         TBool CreateDataL(const CAknGrid& aGrid);
00351 
00355 //        TSize GridSize() const;  // not referenced...
00356 
00364         TBool ConfirmationNumberL(TInt aIndex,
00365                         TInt aId,
00366                         TInt aPromptId);
00367 
00373         void DrawShadow(CWindowGc& aGc) const;
00374 
00375     private:    // Functions from base classes
00376         // from MpblThumbnailOperation
00384         void PbkThumbnailGetComplete(MPbkThumbnailOperation& aOperation,
00385                                      CFbsBitmap* aBitmap);
00386 
00393         void PbkThumbnailGetFailed
00394             (MPbkThumbnailOperation& aOperation, TInt aError);
00395 
00399         TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00400 
00401     private:
00402          
00410          void PbkThumbnailGetCompleteL(MPbkThumbnailOperation& aOperation,
00411                                      CFbsBitmap* aBitmap);
00412 
00413     private:  // from CCoeControl
00417         void Draw(const TRect& aRect) const;
00418 
00422         void SizeChanged();
00423 
00424     private:
00428         void HandleDatabaseEventL(TContactDbObserverEvent aEvent);
00429 
00430     private:    // functions
00434         void ConstructL();
00435 
00439         void InitIndexDataL();
00440 
00444         TBool UpdateIndexDataL(TInt aIndex);
00445 
00452         TInt FindIconIndex(TInt aId) const;
00453 
00459         TInt ThumbType(TInt aIndex) const;
00460 
00466         TSize ThumbSize(TInt aIndex) const;
00467 
00474         void SetContactId(TInt aIndex, TContactItemId aCid);  // not referenced...
00475 
00483         TInt IconPositionL(const CPbkContactItem& aItem, TInt aDial, TInt& aFieldId);
00484 
00490         TInt SetIconArrayL(CArrayPtrFlat<CGulIcon>* aArray);
00491 
00499         HBufC* ItemDescriptorLC(TInt aIndex, const TSpdiaIndexData& aSdmData);
00500 
00507         HBufC* CreateItemDescriptorLC(const TSpdiaIndexData& aSdmData);
00508 
00515         void AppendTextL(const TSpdiaIndexData& aSdmData, TPtr& aText);
00516 
00524         TPbkContactItemField* FindFieldL(CPbkContactItem& aItem,
00525                                     TPbkFieldId aFieldId);
00526 
00534         void AppendThumbnail(const TSpdiaIndexData& aSdmData,
00535                             TPtr& aText,
00536                             TBool aFixedLocation);
00537 
00543         TInt ConvThumbType(const TSize& aSize) const;
00544 
00549         void SetOperationsL();
00550 
00556         void SetItemDataL(CDesCArray& aArray);
00557 
00564         void AssignDialL(TContactItemId aId, TInt aFieldIdx, TInt aDial);
00565 
00573         TBool CheckSpaceBelowCriticalLevelL();
00574 
00581         TInt HasOperation(const MPbkThumbnailOperation& aOperation);
00582 
00586         void ResetArray();
00587 
00594         void SetIndexDataL(TInt aIndex, TSpdiaIndexData& aSdmData);
00595 
00602         void ChangeIndexDataL(TInt aIndex, const TSpdiaIndexData& aSdmData);
00603 
00611         TBool CreateIndexIconL(TInt aIndex, TSpdiaIndexData& aSdmData,
00612                             TBool aSetUpdateThumb);
00613 
00614             
00615                 private:
00616                         //code added for build ver 2.6
00617                         void InitializeArray();
00618 
00619     private:    // Data
00620         // The type of the caller application.
00621         enum TGridUse
00622             {
00623             EGridUse,               // SpeedDial
00624             EGridUseAndUpdate,      // PhoneBook
00625             EGridNoUse              // PhoneClient
00626             };
00627         CPbkContactEngine* iEngine;                 // owned by this
00628         TBool iExEngine;                            // engine owned flags
00629         TGridUse iGridUsed;
00630 
00631         TInt iSdmCount;                             // Grid cell count(Row * col)
00632 
00633         CArrayFixFlat<TSpdiaIndexData>* iSdmArray;  // owned by this
00634         CArrayFixFlat<TAknLayoutRect>* iShadowLayout;     // owned by this
00635 
00636         CPbkContactChangeNotifier* iPbkNotifier;    // owned by this
00637         CPbkSingleItemFetchDlg* iPbkSingleItem;     // owned by this
00638         CAknQueryDialog* iQueryDialog;              // owned by this
00639         RPbkViewResourceFile* iPbkResourceFile;     // owned by this
00640         CSpdiaGridDlg* iGridDlg;                    // owned by this
00641 
00643         CPbkThumbnailManager* iManager;
00645         CPAlbImageFactory* iThumbFactory;
00646 
00647         CAknGrid* iGrid;
00648         TInt    iFileOffset;
00649         CArrayPtrFlat<CGulIcon>* iIconArray;
00650 
00651         CAknsBasicBackgroundControlContext* iBgContext;
00652         
00653                 // Variable used to know if the popup dialog has to be shown
00654                 // according to the release.
00655                 TBool iBooleanVarForAddingDialogVariation;
00656                 //Code added for build ver 2.6.
00657                 RArray<TAknsItemID>*iDialSkinBmp;
00658                 RArray<TAknsItemID>*iSkinIcons;
00659                 TAknLayoutRect icellLayout[KArraySize];
00660                 TBuf<254> iBmpPath;
00661                 TBuf<254> iRscPath;
00662                 TInt iType;
00663                 TInt iError;
00664                 TBool iPopupDialog;
00665                 CAknQueryDialog* iSaveChangesDialog;
00666                 TBool iSaveDlg;
00667     };
00668 
00669 // SPDIACONTROL_H
00670 #endif
00671 
00672 // End of File
00673 

Copyright © Nokia Corporation 2001-2008
Back to top