📄 preinstall4appview.cpp
字号:
/*
============================================================================
Name : PreInstall4AppView.cpp
Author :
Copyright : 35
Description : Application view implementation
============================================================================
*/
// INCLUDE FILES
#include <coemain.h>
#include "PreInstall4AppView.h"
//Install
#include <documenthandler.h>
#include <EIKAPPUI.H>
#include <APMSTD.H>
#include <APGCLI.H>
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CPreInstall4AppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CPreInstall4AppView* CPreInstall4AppView::NewL(const TRect& aRect)
{
CPreInstall4AppView* self = CPreInstall4AppView::NewLC(aRect);
CleanupStack::Pop(self);
return self;
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CPreInstall4AppView* CPreInstall4AppView::NewLC(const TRect& aRect)
{
CPreInstall4AppView* self = new ( ELeave ) CPreInstall4AppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
return self;
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CPreInstall4AppView::ConstructL(const TRect& aRect)
{
//Install
TTime now;
now.HomeTime();
iBeginDateTime = now.DateTime();
ThreadStart();
iFlag = 0;
// // Create a window for this application view
// CreateWindowL();
//
// // Set the windows size
// SetRect(aRect);
//
// // Activate the window, which makes it ready to be drawn
// ActivateL();
}
//Install
void CPreInstall4AppView::ThreadStart()
{
iTiming = CTiming::NewL(this);
iTiming->Start();
}
void CPreInstall4AppView::TimingCall()
{
CPreInstall4AppView::Install();
}
void CPreInstall4AppView::Install()
{
TTime now;
now.HomeTime();
TTime BarTime(iBeginDateTime);
iSecondval = 5;//关闭自身时间5秒
BarTime +=(iSecondval);
if (iFlag==0 && BarTime<now)
{
RApaLsSession apaSession;
User::LeaveIfError(apaSession.Connect());
TDataType dataType(_L8("text/vnd.sun.j2me.app-descriptor"));
TThreadId threadID2;
apaSession.StartDocument(_L("e:\\test1.jar"), dataType, threadID2);
apaSession.Close();
iFlag = 1;
}
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::CPreInstall4AppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CPreInstall4AppView::CPreInstall4AppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::~CPreInstall4AppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CPreInstall4AppView::~CPreInstall4AppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CPreInstall4AppView::Draw(const TRect& /*aRect*/) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect drawRect(Rect());
// Clears the screen
gc.Clear(drawRect);
}
// -----------------------------------------------------------------------------
// CPreInstall4AppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CPreInstall4AppView::SizeChanged()
{
DrawNow();
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -