?? response.h
字號:
/*
* ============================================================================
* Name : CResponse from Response.h
* Part of : TaskManager
* Created : 08/31/2005 by Forum Nokia
* Version : 1.1
* Copyright: Nokia Corporation
* ============================================================================
*/
#ifndef __CRESPONSE_H
#define __CRESPONSE_H
// INCLUDE FILES
#include <e32std.h>
#include <badesca.h> //CDesCArray
#include "TaskManager.hrh"
// CLASS DECLARATION
/**
* A wrapper class for handling responses from the server.
*/
class CResponse : public CBase
{
public: // Constructors and destructor
/**
* Two-phased constructor.
*/
static CResponse* NewL();
/**
* Two-phased constructor.
*/
static CResponse* NewLC();
/**
* Destructor
*/
~CResponse();
enum TResponseType
{
ELoadTasks = 0,
ETaskComplete
};
public: // New functions
/**
* Constructs this response object from the data received from the server.
* @param aData the data that was received from the server
*/
void InputDataL(const TDesC& aData);
/**
* Returns whether errors occurred in the server side.
* @return ETrue if response contains errors, EFalse if not.
*/
TBool HasError() const;
/**
* Returns the error description.
* @return the error description.
*/
TBuf<KMaxError> Error() const;
/**
* Returns the number of tasks received from the server.
* @return the number of tasks received from the server.
*/
TInt TaskCount() const;
/**
* Returns the task description.
* @param aIndex the index of the description.
* @return the task description.
*/
TBuf<KMaxTaskLength> TaskDescription(const TInt& aIndex) const;
/**
* Returns the task id.
* @return the task id.
*/
TInt TaskId(const TInt& aIndex) const;
/**
* Returns the type of this response.
* @return the type of this response.
*/
TResponseType ResponseType() const;
private:
/**
* Symbian OS default constructor
*/
CResponse();
void ConstructL();
enum TTaskReadStatus
{
EStart = 0,
EReadId,
EReadTask
};
private: // Data members
TBuf<KMaxError> iError;
CDesCArray* iDescriptions;
RArray<TInt> iIds;
TResponseType iResponseType;
};
#endif
// End of file
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -