Nokia N97 SDK
Example Applications Guide

aknexnotecontainer.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : aknexnotecontainer.h
00004 *  Part of     : Note example
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2004 - 2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef __AKNEXNOTECONTAINER_H__
00017 #define __AKNEXNOTECONTAINER_H__
00018 
00019 
00020 // INCLUDES
00021 #include <coecntrl.h>
00022 #include <aknnotedialog.h>
00023 #include <AknNotifyStd.h>
00024 #include <apadef.h>
00025 #include <aknprogressdialog.h>
00026 
00027 
00028 // FORWARD DECLARATIONS
00029 class CEikLabel;
00030 class CAknExNoteView;
00031 
00032 
00033 // CLASS DECLARATION
00034 
00035 /**
00036 * CAknExNoteContainer container control class.
00037 */
00038 class CAknExNoteContainer : public CCoeControl, MProgressDialogCallback
00039     {
00040     private: // Enumerations
00041 
00042         enum TAknExNoteComponentControls
00043             {
00044             EAknExNoteComponentLabel,
00045             EAknExNoteComponentListbox
00046             };
00047 
00048     public: // Constructors and destructor
00049 
00050         /**
00051         * CAknExNoteContainer.
00052         * C++ default constructor.
00053         * @param aView Pointer to view class object.
00054         */
00055         CAknExNoteContainer( CAknExNoteView* aView );
00056 
00057 
00058         /**
00059         * ConstructL
00060         * 2nd phase constructor.
00061         * @param aRect Frame rectangle for container.
00062         */
00063         void ConstructL( const TRect& aRect );
00064 
00065 
00066         /**
00067         * ~CAknExNoteContainer.
00068         * Virtual Destructor.
00069         */
00070         virtual ~CAknExNoteContainer();
00071 
00072 
00073     public: // New functions
00074 
00075         /**
00076         * SetTextToLabelL
00077         * @param aResourceId
00078         */
00079         void SetTextToLabelL( TInt aResourceId );
00080 
00081 
00082         /**
00083         * ShowGeneralNoteL
00084         * Indicates general note
00085         * @param aResourceId
00086         * @param aTimeout
00087         * @param aTone
00088         */
00089         void ShowGeneralNoteL( TInt aResourceId, 
00090                                const CAknNoteDialog::TTimeout aTimeout,
00091                                const CAknNoteDialog::TTone aTone );
00092 
00093         /**
00094         * ShowGeneralNoteL
00095         * Indicates general note.
00096         * @param aResourceId
00097         * @param aControlId
00098         * @param aTimeout
00099         * @param aTone
00100         * @param aPlural
00101         */
00102         void ShowGeneralNoteL( TInt aResourceId,
00103                                TInt aControlId,
00104                                const CAknNoteDialog::TTimeout aTimeout,
00105                                const CAknNoteDialog::TTone aTone,
00106                                TBool aPlural );
00107 
00108         /**
00109         * ShowDynamicNumberNoteL
00110         * Indicates note
00111         */
00112         void ShowDynamicNumberNoteL();
00113 
00114         /**
00115         * ShowWaitNoteL
00116         * Indicates wait note.
00117         * @param aResourceId
00118         * @param aControlId
00119         */
00120         void ShowWaitNoteL( TInt aResourceId, TInt aControlId );
00121 
00122         /**
00123         * ShowProgressNoteUnderSingleProcessL
00124         * Indicates ProgressNote.
00125         * @param aResourceId
00126         * @param aControlId
00127         */
00128         void ShowProgressNoteUnderSingleProcessL( TInt aResourceId,   
00129                                                   TInt aControlId );
00130 
00131         /**
00132         * ShowShowNoteL
00133         * Show Note
00134         * @param aType 
00135         * @param aResourceId
00136         */
00137         void ShowShowNoteL( TAknGlobalNoteType aType, 
00138                             TInt aResourceId );
00139 
00140         /**
00141         * CallbackIncrementProgressNoteL
00142         * Callback function to increment progress note
00143         * @param aThis
00144         * @return TInt Return 0 when work is done, otherwise return 1.
00145         */
00146         static TInt CallbackIncrementProgressNoteL( TAny* aThis );
00147         
00148         /**
00149         * UpdateProgressNote
00150         * The entity of ProgressCallBackL() function
00151         * @return TInt 0 when work is done, otherwise return 1.
00152         */
00153         TInt UpdateProgressNote();
00154 
00155 
00156     public: // From MProgressDialogCallback
00157         
00158         /**
00159         * DialogDismissedL
00160         * Called when/if the dialog has been dismissed.
00161         * @param aButtonId
00162         */
00163         void DialogDismissedL( TInt aButtonId );
00164 
00165 
00166     private: // New functions
00167 
00168         /**
00169         * CreateLabelL
00170         * Creates the label object.
00171         */
00172         void CreateLabelL();
00173 
00174     private: // From CCoeControl
00175 
00176         /**
00177         * OfferKeyEventL.
00178         * Handles the key events.
00179         * @param aKeyEvent Key event
00180         * @param aType Type of key event (EEventKey, EEventKeyUp 
00181         * or EEventKeyDown)
00182         * @return if key-event is consumed, EKeyWasConsumed. 
00183         * Else EKeyWasNotConsumed
00184         */
00185         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
00186                                      TEventCode aType );
00187 
00188         /**
00189         * SizeChanged
00190         * Called by framework when the View size is changed..
00191         */
00192         void SizeChanged();
00193 
00194         /**
00195         * CountComponentControls.
00196         * Returns number of component.
00197         * @return Number of controls
00198         */
00199         TInt CountComponentControls() const;
00200 
00201         /**
00202         * ComponentControl.
00203         * Returns pointer to particular component.
00204         * @param aIndex Index of the control
00205         * @return Pointer to Control's component control, identified by index
00206         */
00207         CCoeControl* ComponentControl( TInt aIndex ) const;
00208 
00209         /**
00210         * Draw
00211         * @param aRect Region of the control to be (re)drawn.
00212         */
00213         void Draw( const TRect& aRect ) const;
00214 
00215     private: // Data
00216 
00217         /**
00218         * iLabel
00219         * owned by CAknExNoteContainer object.
00220         */
00221         CEikLabel*                      iLabel;
00222 
00223         /**
00224         * iIdle
00225         * owned by CAknExNoteContainer object.
00226         */
00227         CIdle*                          iIdle;
00228 
00229         /**
00230         * iProgressDialog
00231         * Not owned by CAknExNoteContainer object.
00232         */
00233         CAknProgressDialog*             iProgressDialog;
00234 
00235         /**
00236         * iProgressInfo
00237         * Not owned by CAknExNoteContainer object.
00238         */
00239         CEikProgressInfo*               iProgressInfo;
00240 
00241         /**
00242         * iView
00243         * Not owned by CAknExNoteContainer object.
00244         */
00245         CAknExNoteView*                 iView;
00246 
00247         /** Private Integers for Notes behaviours **/
00248         TInt                            iGlobalNoteId;
00249         TInt                            iPermanentNoteId;
00250         TRequestStatus                  iStatus;
00251     
00252     };
00253 
00254 #endif  //__AKNEXNOTECONTAINER_H__
00255 
00256 // End of File

© Nokia 2009

Back to top