taskmgrappview.h

来自「基于Symbian s60 2nd 下的任务管理器程序。」· C头文件 代码 · 共 152 行

H
152
字号
/* Copyright (c) 2003, Nokia. All rights reserved */

#ifndef __TASKMGR_APPVIEW_H__
#define __TASKMGR_APPVIEW_H__

#include <aknlists.h> 
#include <coecntrl.h>

/*! 
  @class CtaskmgrAppView
  
  @discussion An instance of CtaskmgrAppView is the Application View object
  for the taskmgr example application
  */
class CtaskmgrAppView : public CCoeControl,public MEikListBoxObserver
    {
public:

/*!
  @function NewL
   
  @discussion Create a CtaskmgrAppView object, which will draw itself to aRect
  @param aRect The rectangle this view will be drawn to
  @result A pointer to the created instance of CtaskmgrAppView
  */
    static CtaskmgrAppView* NewL(const TRect& aRect);

/*!
  @function NewLC
   
  @discussion Create a CtaskmgrAppView object, which will draw itself to aRect
  @param aRect The rectangle this view will be drawn to
  @result A pointer to the created instance of CtaskmgrAppView
  */
    static CtaskmgrAppView* NewLC(const TRect& aRect);


/*!
  @function ~CtaskmgrAppView
  
  @discussion Destroy the object
  */
     ~CtaskmgrAppView();

TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;



public:  // from CCoeControl
	    void FocusChanged(	TDrawNow /*aDrawNow*/	);
/*!
  @function Draw
  
  @discussion Draw this CtaskmgrAppView to the screen
  @param aRect The rectangle of this view that needs updating
  */
    void Draw(const TRect& aRect) const;
  
  
   /** From MEikListBoxObserver
     * Handles listbox event.
     * @param aListBox Pointer to ListBox object is not used.
     * @param aEventType Type of listbox event.
     */
   void HandleListBoxEventL(
							CEikListBox* aListBox,
							TListBoxEvent aEventType 
							);
	void RefreshList();

	void KillApp();

	void NewApp();

	void TaskInfo();                                         
	
	void CompressHeaps();

	void FillProcessList();
	
	void FillTaskList();
	
	void SwitchToApp();	
		
	void RestartDevice();	
	
	void KillProcess();
	
	void ShowSystemInfo();
	
	void ShowProcessInfo();
	
	void SwitchView();
	
	void ShowAbout();
	
private:

/*!
  @function ConstructL
  
  @discussion  Perform the second phase construction of a CtaskmgrAppView object
  @param aRect The rectangle this view will be drawn to
  */
    void ConstructL(const TRect& aRect);

/*!
  @function CtaskmgrAppView
  
  @discussion Perform the first phase of two phase construction 
  */
    CtaskmgrAppView();
    
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
                                       TEventCode aType );
                                       
	
    void CreateListBoxL(const TRect& aRect);
    
    void InitTaskList();
    
    void InitProcessList();
    	
	void ShowInfoDialog(TInt ,TDesC& );
	
    
   
	private://data members
	 
    	CEikFormattedCellListBox*	iListBox;
		CDesCArray *iAppList;
		CDesCArray *iProcList;	
	    TInt iAppCount;
	    TInt iProcCount;    
    	TUid UidArray[100];
	    enum TTaskMgrState{
    		ETaskListState,
    		EProcessListState
	    };
    	TTaskMgrState iAppState;

		CDesCArray *iItemList;
		CDesCArray *iItemList2;
    	
    	TInt iPhoneIndex;
};


#endif // __TASKMGR_APPVIEW_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?