📄 magictrainappui.h
字号:
/*
============================================================================
Name : TrainAppUi.h
Author : Johnson Liu
Copyright : JL&NB
Description : Declares UI class for application.
============================================================================
*/
#ifndef __TRAINAPPUI_h__
#define __TRAINAPPUI_h__
// INCLUDES
#include <aknappui.h>
#include <f32file.h>
#include <s32file.h>
#include "MagicTrain.hrh"
#include "OTResult.h"
#include "TSSResult.h"
#include "OSResult.h"
#include "apgcli.h"
#include "MDownloadManagerObserver.h"
#include "MProgressNoteObserver.h"
// FORWARD DECLARATIONS
class CMagicTrainDocument;
class CMagicTrainAppView;
class Engine;
class CDownloadEntity;
enum TUpdateStatus {
EUSNone,
EUSSV,
EUSDV,
EUSData
};
// CLASS DECLARATION
/**
* CTrainAppUi application UI class.
* Interacts with the user through the UI and request message processing
* from the handler class
*/
class CAskStationDialog;
class CAskTrainDialog;
class CAskOneStationDialog;
class CMagicTrainAppUi : public CAknAppUi,
public MDownloadManagerObserver,
public MProgressNoteObserver
{
public: // Constructors and destructor
/**
* ConstructL.
* 2nd phase constructor.
*/
void ConstructL();
void ConstructVersionL();
/**
* CTrainAppUi.
* C++ default constructor. This needs to be public due to
* the way the framework constructs the AppUi
*/
CMagicTrainAppUi(CMagicTrainDocument* aDoc);
/**
* ~CTrainAppUi.
* Virtual Destructor.
*/
virtual ~CMagicTrainAppUi();
void ShowTrainMsg(const TDesC& head,const TDesC& msg);
void SetMenuBar(TInt a);
private:
void ConstructFilePathL();
void ConstructFilePathSubL(RFs& fs,RFileReadStream& rs,TFileName& aFilePath,TFileName& aSubFilePath);
public:
TFileName iStationFilePath;
TFileName iTrainFilePath;
TFileName iTrainLineFilePath;
public:
void DownloadFinished(TDownloadStatus aStatus);
void DownloadPercent(TInt aPercent);
public:
void CompleteProgressNote();
void StepProgressNote(TInt aPercent);
void CancelProgressNote();
void HandleCommandL( TInt aCommand );
private:
TBuf<10> GetLastVersion(const TDesC& words);
void ParseUpdateData();
void DecodeBase64Code(TFileName aFileName);
private: // Functions from base classes
/**
* From CEikAppUi, HandleCommandL.
* Takes care of command handling.
* @param aCommand Command to be handled.
*/
/**
* HandleStatusPaneSizeChange.
* Called by the framework when the application status pane
* size is changed.
*/
virtual void HandleResourceChangeL( TInt aType );
void DynInitMenuPaneL( TInt aResourceId,CEikMenuPane* aMenuPane );
TKeyResponse HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType );
// void HandleStatusPaneSizeChange();
void LaunchWapBrowswerL(const TDesC& aAddr );
void SaveVersionL(const TDesC8& version);
public:
Engine* iEngine;
private: // Data
/**
* The application view
* Owned by CTrainAppUi
*/
CMagicTrainAppView* iAppView;
CMagicTrainDocument* iDoc;
RApaLsSession iApaLsSession;
CAskTrainDialog* iAskTrainDialog;
CAskOneStationDialog* iAskOneStationDialog;
CAskStationDialog* iAskStationDialog;
TBuf<KMaxAsktrainrNameLength> iTrainName;
TBuf<KMaxAsktrainrNameLength> iStationName;
TBuf<KMaxAskStatonNameLength> iStationName1;
TBuf<KMaxAskStatonNameLength> iStationName2;
RPointerArray<COTResult>* iOTResult;
RPointerArray<CTSSResult>* iTSSResult;
RPointerArray<COSResult>* iOSResult;
CDownloadEntity* iDownloadEntity;
RFs iFs;
TBuf8<10> iDataVersion8;
TBuf<10> iDataVersion;
TBuf<10> iLastDataVersion;
TBuf<10> iVersion;
TFileName iDataPath;
TFileName iCfgPath;
TFileName iVersionPath;
TUpdateStatus iUpdateStatus;
//TrainWay* iTrainWay;
};
#endif // __TRAINAPPUI_h__
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -