examples/ForumNokia/Symbian_OS_End-to-End_Sockets_API_Example/SocketTaskManager_S60/inc/TaskManagerAppView.h

00001 /*
00002 * ============================================================================
00003 *  Name     : CTaskManagerAppView from TaskManagerAppView.h
00004 *  Part of  : TaskManager
00005 *  Created  : 15/03/2006 by Forum Nokia
00006 *  Version  : 1.2
00007 *  Copyright: Nokia Corporation
00008 * ============================================================================
00009 */
00010 
00011 #ifndef __TASKMANAGER_APPVIEW_H__
00012 #define __TASKMANAGER_APPVIEW_H__
00013 
00014 // INCLUDE FILES
00015 #include "TaskManagerEngine.h"
00016 
00017 #include <eiklbo.h> // MEikListBoxObserver
00018 #include <coecntrl.h>
00019 
00020 // CONSTANTS
00021 const TInt KMaxStatusTextLength = 25;
00022 
00023 // FORWARD DECLARATIONS
00024 class CAknSingleStyleListBox;
00025 class CTaskManagerAppUi;
00026 class CResponse;
00027 
00028 // CLASS DECLARATION
00029 
00034 class CTaskManagerAppView : public CCoeControl, 
00035                                                         public MEikListBoxObserver, 
00036                                                         public MTransactionObserver
00037         {
00038 public: // Constructors and destructor
00039 
00043         static CTaskManagerAppView* NewL(const TRect& aRect, CTaskManagerAppUi& aAppUi);
00044 
00048      ~CTaskManagerAppView();
00049 
00050 
00051 public: // New functions
00052 
00059         TBool QueryIapL(TUint32& aId, const TUint32& aDefaultId);
00060 
00061 private: // Functions from base classes
00062 
00066     void Draw(const TRect& aRect) const;
00067     
00071     void SizeChanged();
00072     
00076         TInt CountComponentControls() const;
00077         
00081         CCoeControl* ComponentControl(TInt aIndex) const;
00082         
00086         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
00087         
00091         void HandleListBoxEventL(CEikListBox* aListBox,
00092                                                          TListBoxEvent aListBoxEvent);
00093         
00097         void OpeningConnectionL();
00098                                                          
00103         void ConnectingToServerL(const TBool& aLoadingTasks);
00104         
00112         void SuccessL(const CResponse& aResponse);
00113         
00118         void FailedL(const TInt& aError);
00119         
00123         void CancelledL();
00124         
00130         void ErrorL(const TDesC& aErrorMsg);
00131         
00132 private:
00133 
00137         void ConstructL(const TRect& aRect);
00138     CTaskManagerAppView(CTaskManagerAppUi& aAppUi);
00139     
00140 private: // New functions
00141 
00146         void ReadTasksL( const CResponse& aResponse );
00147     
00154     void ShowStatus(const TDesC& aStatus);
00155     
00159     void CreateListL();
00160 
00164         void DeleteSelectedTaskL();    
00165     
00166         enum TTransactionStatus
00167                 {
00168                 EFetchingTasks = 0,
00169                 EMarkingTaskDone
00170                 };
00171     
00172 private: // Data members
00173     
00174     CAknSingleStyleListBox* iTaskList;
00175     CTaskManagerAppUi& iAppUi;
00176     TTransactionStatus iTransactionStatus;
00177     TBuf<KMaxStatusTextLength> iStatusText;
00178         };
00179 
00180 
00181 #endif // __TASKMANAGER_APPVIEW_H__
00182 
00183 // End of file

Generated by  doxygen 1.6.2