📄 fepexample.cpp
字号:
#ifdef __SERIES60_3X__
#include <eikstart.h>
#endif
#include <eikappui.h>
#include <eikenv.h>
#include "FepVer.h"
#include "stdlib.h"
#include "time.h"
#include <FEPBASE.H>
#include <w32std.h>
#include <bautils.h>
#include <frmtlay.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <aknedsts.h>
#include "fepexample.h"
#include "fepcontrol.h"
#include "PatTree.h"
//#include <tchar.h>
#include <e32def.h>
extern const char CreateTime[];
extern const char Version[];
typedef struct _VERINFO {
TBuf<16> CreateTime;
TBuf<16> CoreChineseVer;
TBuf<16> CoreEnglishVer;
TBuf<16> AppVer;
}VERINFO;
// ================= OTHER EXPORTED FUNCTIONS ==============
//
// ---------------------------------------------------------
// NewApplication()
// Constructs CFepSetupApp
// Returns: created application object
// ---------------------------------------------------------
//
/**
* Main Fep construction - defined in COEFEPU.DEF
*/
EXPORT_C CCoeFep* NewFepL(CCoeEnv& aConeEnvironment, const TDesC& /*aFullFileNameOfDll*/, const CCoeFepParameters& aFepParameters)
{
//增加时间判断
TTime time;
TDateTime dateTime;
time.UniversalTime();
dateTime = time.DateTime(); // daylight saving and convert to fields
FILE *fpver;
int i;
VERINFO verinfo;
/*
if (dateTime.Year()!=2005)
{
return NULL;
}
if(dateTime.Month()!=EJune && dateTime.Month()!=EJuly)
{
return NULL;
}
*/
//写版本信息
#ifdef __WINS__
fpver = wfopen((const unsigned short *)L"c:\\ver.dat",(const unsigned short *)L"wb+");
#else
fpver = fopen("c:\\system\\fep\\ver.dat","wb+");
#endif
verinfo.AppVer.Zero();
verinfo.CoreChineseVer.Zero();
verinfo.CoreEnglishVer.Zero();
verinfo.CreateTime.Zero();
//Fill create time
i = 0;
while (CreateTime[i]!=0)
{
verinfo.CreateTime.Append(CreateTime[i]);
i++;
}
//Fill AppVer
i = 0;
while (Version[i]!=0)
{
verinfo.AppVer.Append(Version[i]);
i++;
}
//Fill CoreVer;
verinfo.CoreChineseVer.Format(_L("%x"),NEXTAP_GetKernelVersion());
verinfo.CoreEnglishVer.Format(_L("%x"),0xFFFF);
fwrite(&verinfo,1,sizeof(VERINFO),fpver);
fclose(fpver);
CExampleFep* const fep = new(ELeave) CExampleFep(aConeEnvironment);
CleanupStack::PushL(fep);
fep->ConstructL(aFepParameters);
CleanupStack::Pop(); // fep
return fep;
}
/**
* Export defined in COEFEPU.DEF - unused
*/
EXPORT_C void SynchronouslyExecuteSettingsDialogL(CCoeEnv& /*aConeEnvironment*/, const TDesC& /*aFullFileNameOfDll*/)
{
}
/**
* Reserved exports defined in COEFEPU.DEF - unused
*/
EXPORT_C void Reserved_1(){}
EXPORT_C void Reserved_2(){}
EXPORT_C void Reserved_3(){}
EXPORT_C void Reserved_4(){}
EXPORT_C void Reserved_5(){}
EXPORT_C void Reserved_6(){}
EXPORT_C void Reserved_7(){}
EXPORT_C void Reserved_8(){}
#ifndef __SERIES60_3X__
// ---------------------------------------------------------
// E32Dll(TDllReason)
// Entry point function for EPOC Apps
// Returns: KErrNone: No error
// ---------------------------------------------------------
//
GLDEF_C TInt E32Dll( TDllReason )
{
return KErrNone;
}
#else
// ---------------------------------------------------------
// E32Main()
// Entry point function for new (>= 9.0) EPOC Apps (exe)
// Returns: Sistem Wide error codes or KErrNone if all goes well
// ---------------------------------------------------------
//
EXPORT_C CApaApplication* NewApplication()
{
return new CExampleFep;
}
GLDEF_C TInt E32Main()
{
return EikStart::RunApplication( NewApplication );
}
#endif
//GLDEF_C TInt E32Dll(TDllReason)
// {
// return KErrNone;
// }
/////////////////////////////////////////////////////////////////////////////////
//
//Class CExampleFep
//
/////////////////////////////////////////////////////////////////////////////////
CExampleFep::CExampleFep(CCoeEnv& aConeEnvironment)
:CCoeFep(aConeEnvironment)
{
}
void CExampleFep::ConstructL(const CCoeFepParameters& aFepParameters)
{
BaseConstructL(aFepParameters);
iFepControl = CeQTapControl::NewL(*this);
}
CExampleFep::~CExampleFep()
{
if (iFepControl!=NULL)
delete iFepControl;
}
TInt CExampleFep::NumberOfAttributes() const
{
return 0;
}
TUid CExampleFep::AttributeAtIndex(TInt /*aIndex*/) const
{
return KNullUid;
}
void CExampleFep::WriteAttributeDataToStreamL(TUid /*aAttributeUid*/, RWriteStream& /*aStream*/) const
{
}
void CExampleFep::ReadAttributeDataFromStreamL(TUid /*aAttributeUid*/, RReadStream& /*aStream*/)
{
}
void CExampleFep::OfferKeyEventL(TEventResponse& /*aEventResponse*/,const TKeyEvent& /*aKeyEvent*/, TEventCode /*aEventCode*/)
{
}
void CExampleFep::OfferPointerEventL(TEventResponse& /*aEventResponse*/,const TPointerEvent& /*aPointerEvent*/, const CCoeControl* /*aWindowOwningControl*/)
{
}
void CExampleFep::OfferPointerBufferReadyEventL(TEventResponse& /*aEventResponse*/, const CCoeControl* /*aWindowOwningControl*/)//wbase
{
}
void CExampleFep::HandleChangeInFocus()
{
if (iFepControl)
{
iFepControl->HandleChangeInFocus();
}
}
void CExampleFep::HandleDestructionOfFocusedItem()
{
}
void CExampleFep::HandleGainingForeground()
{
}
void CExampleFep::HandleLosingForeground()
{
}
void CExampleFep::CancelTransaction()
{
}
void CExampleFep::IsOnHasChangedState()
{
}
// end of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -