# HG changeset patch # User hgs # Date 1269601255 -7200 # Node ID a6d55a2e75bee3a6571c3a617b46e6ae977f7a08 # Parent 0e41c72311af7fcaf336f587c4d3536f128c8b05 201011_03 diff -r 0e41c72311af -r a6d55a2e75be activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp --- a/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Wed Mar 24 13:06:03 2010 +0200 +++ b/activityfw/activitydatabase/hsactivitydbserver/s60/src/main.cpp Fri Mar 26 13:00:55 2010 +0200 @@ -14,24 +14,72 @@ * Description: Application entry point * */ + #include #include +#include +#include +#include + +#include +#include #include "hsactivityserver.h" #include "hsactivitystorage.h" +class HsActivityMainAppUi : public QS60MainAppUi + { +public: + TBool FrameworkCallsRendezvous() const { + return EFalse; + } + }; +class HsActivityMainDocument : public QS60MainDocument + { +public: + HsActivityMainDocument(CEikApplication &mainApplication):QS60MainDocument(mainApplication){} + + CEikAppUi *CreateAppUiL() { + return (static_cast (new(ELeave)HsActivityMainAppUi)); + } + }; + +class HsActivityApplication : public QS60MainApplication + { +protected: + CApaDocument *CreateDocumentL() { + return new (ELeave) HsActivityMainDocument(*this); + } + }; + +CApaApplication *newHsActivityApplication() +{ + return new HsActivityApplication; +} int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QApplication app(newHsActivityApplication, argc, argv); HsActivityStorage storage; HsActivityServer server(storage); int retVal(KErrGeneral); if( server.start() ){ + CEikonEnv * env = CEikonEnv::Static(); + if ( env ) { + CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(env->WsSession()); + wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc. + wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down + RWindowGroup &rootWindowGroup = env->RootWin(); + wgName->SetWindowGroupName(rootWindowGroup); + rootWindowGroup.SetOrdinalPosition(-1, ECoeWinPriorityNormal); //move to background. + CleanupStack::PopAndDestroy(); + } RProcess::Rendezvous(KErrNone); retVal = app.exec(); }else RProcess::Rendezvous(retVal); return retVal; } + +