⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appsviewer.h

📁 C++实现的brew程序管理器例子
💻 H
字号:
/////////////////////////////////////////////////////////////////////
// Project : AppsViewer
// File: AppsViewer.h
// 2005/07/26
/////////////////////////////////////////////////////////////////////

#if !defined(AFX_GATEWAYPROXYAPP_H__765E6B4A_5A8E_4342_A28A_41B6E441B775__INCLUDED_)
#define AFX_GATEWAYPROXYAPP_H__765E6B4A_5A8E_4342_A28A_41B6E441B775__INCLUDED_

//===========系统生成,请勿修改,开始========
#include "AEEModGen.h"          // Module interface definitions
#include "AEEAppGen.h"          // Applet interface definitions
//包含GameApi里面的类,需要在Tools->Options...->Directories->Include Files中设置GameApi的路径
#include "Shell.h"
#include "Display.h"
//===========系统生成,请勿修改,结束========
//---------------- Inculde ------------------
#include "Web.h"
#include "Tapi.h"
#include "BaseWnd.h"
#include "GatewayProxyProtocol.h"
#include "GatewayProxyWeb.h"
//-------------------------------------------

//---------------- Define -------------------

#define GATEWAYPROXY_MAX_WND	7

#define EVT_APP_WEBSUCCEED			EVT_USER + 10	//WEB操作成功
#define EVT_APP_WEBERROR			EVT_USER + 11	//WEB操作失败
#define EVT_APP_TOGETSUBSCRIPTION	EVT_USER + 12	//检测定购关系

#define APP_NAME_MAXLEN			20

#define APP_TYPE_DOWNLOADED			0X01	// 已下载
#define APP_TYPE_ALL				0X02	//所有
//-------------------------------------------

typedef struct
{
	uint32 dwClsID;							// CLSID of current applet
	AECHAR wszAppName[APP_NAME_MAXLEN + 1];	// Application name
	char szIMSI[PROTOCOL_IMSI_LEN+1];		// The IMSI of order SIM
	JulianType dateExpire;					// The expire date of current order
	uint16 wBillingType;					// The type of billing
}ORDER_INFO;


class CAppsViewer
{
//===========系统生成,请勿修改,开始========
public:
	static boolean HandleEvent(IApplet * pIApplet, AEEEvent eCode, uint16 wParam, uint32 dwParam)
	{
		return ((CAppsViewer *)pIApplet)->OnEvent(eCode, wParam, dwParam);
	}
	static boolean InitAppData(IApplet * pIApplet)
	{
		return ((CAppsViewer *)pIApplet)->OnInitData();
	}
	static void FreeAppData(IApplet * pIApplet)
	{
		((CAppsViewer *)pIApplet)->OnFreeData();
	}
/*
	static void TempCB(CAppManager *p)
	{
		p->OnTempCB();
	}
*/
	//Web连接完成 
	void OnWebEnd(AEEEvent evt, uint16 wParam = NULL, uint32 dwParam = NULL);
protected:
	//初始化应用程序数据
	boolean OnInitData();
	//释放应用程序资源
	void OnFreeData();
	//处理应用程序消息,事件
	boolean OnEvent(AEEEvent evt, uint16 wParam, uint32 dwParam);

	// Handle EVT_APP_START event
	boolean OnAppStart(/*uint16 wParam, uint32 dwParam*/);
	// Handle EVT_KEY(AVK_CLR) event
	boolean OnClrKeyEvent();
	// Handle EVT_COMMAND event
	boolean OnCommand(uint16 wParam, uint32 dwParam);

	// Insert a window to list and suspend previous window, show current window
	void InsertWindow(CBaseWnd *pWnd, uint16 wState);
	// Create base window and add two softkeys
	CBaseWnd *CreateBaseWnd(uint16 wType, uint16 wSoftkey1, uint16 wSoftkey2);
	// Create static base window and then set text and add two softkeys
	CBaseWnd *CreateStaticBaseWnd(uint16 wSoftkey1, uint16 wSoftkey2, AECHAR *pwszText, AECHAR *pwszTitle = NULL);
	//
	boolean CreatePolicyOption(uint16 nPolicyId);
	//
	boolean CreatePolicyRenew(uint32 classId, boolean isCancel, boolean isRenew, AECHAR *pTitle);
	//
	boolean CreateConfirmWnd(AECHAR *pwszText);

//	void OnWebResp(char *pszText);

//Data restore and save
protected:
	//int ReadOrderInfo();
	//int WriteOrderInfo();
	//boolean IsOrderAvaible();
	boolean ShowMessageWnd(uint16 nLeft, uint16 nRight, uint16 nMessageId, uint16 nState);
	boolean OnMainMenu(uint16 wParam);
	boolean StartGetAppsInfo(uint16 nType);
	boolean StartGetSubscription(uint32 dwParam);
	boolean StartGetService(uint16 nCatalogID);
	boolean StartOrder(uint16 nPolicyID, uint16 isRenew);
	boolean StartRenew(uint32 clsID);
	boolean StartCancel(uint32 clsID);
	//boolean StartTargetApp();
	//
//数据定义
protected:
	AEEApplet	m_applet;
	CShell		*m_pShell;
	CDisplay	*m_pDisplay;
//===========系统生成,请勿修改,结束========
//...在此添加您自己的代码
	//Array of windows
	CBaseWnd *m_arpWnd[GATEWAYPROXY_MAX_WND];
	//Array of each window’s state
	uint16 m_arwState[GATEWAYPROXY_MAX_WND];
	//Index to indicate which item of window’s array is active now
	uint16 m_wIndex;
	//This Applet is suspended or not
	boolean m_bSuspended;
	//IMSI of current handset, get from SMS
	char m_szIMSI[PROTOCOL_IMSI_LEN+1];
	//Pointor of WebAction 
	CGatewayProxyWeb	*m_pWebAction;
	//Pointor of WebUtil
	CWebUtil	*m_pWebUtil;
	//server url
	char		*m_pSvrUrl;
	boolean		m_bConnectionAction;

	//资费策略
	BillingPolicy *m_pBillingPolicys;
	uint16		   m_nPolicysCount;
	//应用数
	AppInfo		  *m_pAppInfos;
	uint16		  m_nAppsCount;
	uint32		   m_clsCPApp;

	uint16		  m_nViewType;

	//定购信息
	uint16 m_nPolicyIndex;
	uint16 m_nIsRenew;
	
};
#endif

⌨️ 快捷键说明

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