phonebookui/Speeddial/inc/SpdiaContainer.h
changeset 0 e686773b3f54
child 12 5072fb0f5b46
child 26 0d28c1c5b6dd
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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:     Declares container control for application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef SPDIACONTAINER_H
       
    24 #define SPDIACONTAINER_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <aknview.h>
       
    28 #include <AknUtils.h>
       
    29 #include <eiklbo.h>
       
    30 #include <MPbkContactDbObserver.h>
       
    31 #include "centralrepository.h"
       
    32 #include <aknlongtapdetector.h>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 //class CAknGrid;
       
    36 class CAknQdialStyleGrid;
       
    37 class CSpdiaView;
       
    38 class CPbkContactChangeNotifier;
       
    39 class CSpeedDialPrivate;
       
    40 class TSpdiaIndexData;
       
    41 class CSpdiaNoteDialog;
       
    42 class CVPbkContactManager;
       
    43 class CPNGNumberGrouping;
       
    44 class CAknLongTapDetector;
       
    45 // CLASS DECLARATION
       
    46 
       
    47 class MRefreshObserver
       
    48     {
       
    49     public: // Interface
       
    50         virtual void RefreshDialog() = 0;
       
    51     };
       
    52 
       
    53 /**
       
    54 *  Generic Speeddial container class.
       
    55 *  Container's task is to dispatch key presses to an application-side
       
    56 *  key event handler. If key event is not processed application-side,
       
    57 *  it is passed to the contained control.
       
    58 *
       
    59 *  @since 
       
    60 */
       
    61 
       
    62 class CSpdiaContainer : public CCoeControl,
       
    63                         public MPbkContactDbObserver,
       
    64                         public MAknLongTapDetectorCallBack,
       
    65                         public MRefreshObserver,
       
    66                         public MEikListBoxObserver
       
    67     {
       
    68     public: // Constructors and destructor
       
    69 
       
    70         /**
       
    71         * C++ default constructor.
       
    72         */
       
    73         CSpdiaContainer(CSpeedDialPrivate *aSpeedPrivate);
       
    74         
       
    75         /**
       
    76         * Symbian second phase Constructor.
       
    77         * @param aView      Frame pointer.
       
    78         */
       
    79         void ConstructL(CAknView* aView);
       
    80 
       
    81         /**
       
    82         * Virtual C++ destructor.
       
    83         */
       
    84         virtual ~CSpdiaContainer();
       
    85         
       
    86         /**
       
    87         * From CAknContainer takes care of skin changes.
       
    88         * @param aType skin event identifier.
       
    89         */
       
    90         void HandleResourceChange(TInt aType);
       
    91 
       
    92     public: // New functions
       
    93         /**
       
    94         * Gets the grid data control of speeddial. 
       
    95         * @return   reference of spdctrl
       
    96         */
       
    97         CSpeedDialPrivate& Control();
       
    98 
       
    99         /**
       
   100         * Returns whether the cell position is a VoiceMailBox number or not. 
       
   101         * @param aIndex    index number
       
   102         * @return   ETrue: On VoiceMail Box number
       
   103         */
       
   104         TBool IsVoiceMailBox(TInt aIndex = -1) const;
       
   105         TBool IsVdoMailBox(TInt aIndex = -1) const;
       
   106 
       
   107         /**
       
   108         * Gets the current position of the grid.
       
   109         * @return   Grid position
       
   110         */
       
   111         TInt CurGridPosition() const;
       
   112 
       
   113         /**
       
   114         * Redraws and renfreshes the grid data.
       
   115         */
       
   116         void UpdatePhoneNumberL(TInt aIndex = -1);
       
   117 
       
   118         /**
       
   119         * Get resource id on grid position
       
   120         */
       
   121         TInt MenuResourceID();
       
   122         
       
   123         /**
       
   124         * Selection of the MiddleSoftKey
       
   125         * 
       
   126         */
       
   127 		void CSpdiaContainer::MiddleSoftKeyL();
       
   128 
       
   129         /**
       
   130         * Shows the ViewNumber note.
       
   131         */
       
   132         void ShowViewNumberL();
       
   133 
       
   134         /**
       
   135         * Redraws and renfreshes the ViewNumber note.
       
   136         */
       
   137         void DoUpdateL();
       
   138 
       
   139         /**
       
   140         * Gets the pointer of the grid control.
       
   141         * @return   point of gird control.
       
   142         */
       
   143         CAknQdialStyleGrid* Grid();
       
   144         
       
   145         /* Activating the animation in 
       
   146         * the background for grid
       
   147         */
       
   148         void FocusChanged(TDrawNow aDrawNow);
       
   149         
       
   150         /**
       
   151         * Set status pane to the normal status.
       
   152         */
       
   153         void SetStatusPaneL();
       
   154 
       
   155     public: // Functions from CCoeControl classes
       
   156         /**
       
   157         * This function is called when Help application is launched.  
       
   158         * @param aContex
       
   159         */
       
   160         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   161 
       
   162         /**
       
   163         * This function is called from Spdiaview once the application comes 
       
   164          to foreground.
       
   165         */
       
   166         void RefreshGrid();
       
   167         /**
       
   168         * Sets true when voice mail box dialog launched 
       
   169         * sets false dialog destroyed.  
       
   170         * @param aBool
       
   171         */
       
   172         void VoiceMailDialogLaunched( TBool aBool );
       
   173 
       
   174 
       
   175         CAknLongTapDetector& CSpdiaContainer::LongTapDetectorL();
       
   176         /**
       
   177         * refresh the dialog in speeddial view 
       
   178         */
       
   179         void RefreshDialog();
       
   180     public: // Functions from base classes
       
   181 
       
   182     private:    // New function
       
   183 
       
   184 
       
   185         /**
       
   186         * Call create by current number
       
   187         */
       
   188         void CallCreateL();
       
   189 
       
   190         /**
       
   191         * Creats image from thumbnail.
       
   192         */
       
   193         CEikImage* CreateBitmapL(const CGulIcon& aSrc);
       
   194 
       
   195     private: // Functions from base classes
       
   196         /**
       
   197         * From CoeControl,SizeChanged.
       
   198         */
       
   199         void SizeChanged();
       
   200 
       
   201         /**
       
   202         * From CoeControl,CountComponentControls.
       
   203         */
       
   204         TInt CountComponentControls() const;
       
   205 
       
   206         /**
       
   207         * From CCoeControl,ComponentControl.
       
   208         */
       
   209         CCoeControl* ComponentControl(TInt aIndex) const;
       
   210 
       
   211         /**
       
   212         * From CCoeControl,Draw.
       
   213         */
       
   214         void Draw(const TRect& aRect) const;
       
   215 
       
   216         /**
       
   217         * From CCoeControl processing of a key event
       
   218         */
       
   219         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   220 
       
   221         /**
       
   222         * From CCoeControl,HandlePointerEventL.
       
   223         */
       
   224         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   225         /**
       
   226         * From MContactDbObserver, Handles an event of type aEventType.
       
   227         */
       
   228         void HandleDatabaseEventL(TContactDbObserverEvent aEvent);
       
   229         
       
   230         /**
       
   231         * Returns scaled CEikImage pointer
       
   232         * @param selected icon.
       
   233         */
       
   234         CEikImage* CreateScaledBitmapL(const CGulIcon& aSrc);
       
   235    
       
   236     public:    
       
   237         /**
       
   238         * From MAknLongTapDetectorCallBack
       
   239         * 
       
   240         */
       
   241         void HandleLongTapEventL( const TPoint& aPenEventLocation, 
       
   242                                   const TPoint& aPenEventScreenLocation );
       
   243         
       
   244         /**
       
   245         * From MEikListBoxObserver, Handles an event of listbox.
       
   246         */
       
   247         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   248     private:
       
   249         
       
   250         void SetLayoutL();
       
   251         
       
   252     private: //data
       
   253         CAknQdialStyleGrid*   iGrid;             // owned by this
       
   254         CSpdiaView* iView;
       
   255         CSpeedDialPrivate* iSpeedPrivate;                 // owned by this
       
   256         CVPbkContactManager *iContactManager;
       
   257         CSpdiaNoteDialog* iDialog;               // owned by this
       
   258         TBool iNeedUpdate;
       
   259 
       
   260         CPNGNumberGrouping* iNumberGrouping;
       
   261         TBool iVoiceDialog;
       
   262         TBool iAlreadyActive;
       
   263         CAknLongTapDetector* iLongTapDetector;
       
   264         CRepository*  ivmbxvariation;
       
   265         TInt iVmbxsupported;
       
   266         
       
   267         TBool iLongTapUsed;
       
   268         
       
   269         // Indicator for the note: no assigned number shown
       
   270         TBool iNoAssignedShown;
       
   271         
       
   272         // Grid index in which the button down
       
   273         TInt iButton1DownIndex;
       
   274     };
       
   275 
       
   276 #endif        // SPDIACONTAINER_H
       
   277 
       
   278 // End of File