Пример #1
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CKeyObserver::ConstructL()
{
	CActiveScheduler::Add(this);
	iHandle1 = iHandle2 = iHandle3 = iHandle4 = iHandle5 = -1;
	
	User::LeaveIfError(iWsSession.Connect());
	iWg = RWindowGroup(iWsSession);
		
	User::LeaveIfError(iWg.Construct((TUint32)&iWg, EFalse));
	iWg.SetOrdinalPosition(-1);
	iWg.EnableReceiptOfFocus(EFalse);

	CApaWindowGroupName* wn(NULL);
	wn=CApaWindowGroupName::NewL(iWsSession);
	if(wn)
	{
		CleanupStack::PushL(wn);
		
		wn->SetHidden(ETrue);
		wn->SetWindowGroupName(iWg);
		
		CleanupStack::PopAndDestroy();
	}
	
	iWg.EnableOnEvents();

	CaptureKeys();
	Listen();
}
Пример #2
0
// -----------------------------------------------------------------------------
// Cosmo4AppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void COsmo4AppUi::ConstructL()
{
    // Initialise app UI with standard value.
    BaseConstructL(CAknAppUi::EAknEnableSkin);

    /*Create display*/
    iAppView = COsmo4AppView::NewL( ClientRect() );
	AddToStackL(iAppView);

	/*create playlist*/
#ifndef GPAC_GUI_ONLY
	iPlaylist = CPlaylist::NewL( ClientRect(), iAppView->GetUser() );

	iPlaylist->MakeVisible(EFalse);
#endif
	
	iAppView->MakeVisible(ETrue);
	view_mode = 0;

	m_title = NULL;

	//StatusPane ()->SwitchLayoutL ( R_AVKON_STATUS_PANE_LAYOUT_SMALL );

	nb_keys = 0;
	CaptureKeys(1);



	CCommandLineArguments *args = CCommandLineArguments::NewL();
#ifndef GPAC_GUI_ONLY
	if (args->Count() > 1) {
		TPtrC url = args->Arg(1);
#if defined(_UNICODE)
		char szURL[1024];
		u16 szURLUTF16[1024];
		size_t len;
		len = url.Size();
		memcpy(szURLUTF16, url.Ptr(), sizeof(u8)*len);
		szURLUTF16[len/2] = 0;
		const u16 *sptr = szURLUTF16;
		len = gf_utf8_wcstombs(szURL, 512, &sptr);
		if (len != (size_t) -1) {
			szURL[len] = 0;
			iAppView->Connect((const char *)szURL);
		}
#else
		iAppView->Connect((const char *)url.Ptr());
#endif
	}
#endif
	delete args;
}
Пример #3
0
// -----------------------------------------------------------------------------
// COsmo4AppUi::~COsmo4AppUi()
// Destructor.
// -----------------------------------------------------------------------------
//
COsmo4AppUi::~COsmo4AppUi()
{
	CaptureKeys(0);

	switch (view_mode) {
	case 0:
		if (iAppView) RemoveFromStack(iAppView);
		break;
	case 1:
		if (iPlaylist) RemoveFromStack(iPlaylist);
		break;
	}
    if (iAppView) delete iAppView;
    if (iPlaylist) delete iPlaylist;
	if (m_title) gf_free(m_title);
	m_title = NULL;
}
Пример #4
0
void COsmo4AppUi::HandleForegroundEventL(TBool aForeground)
{
	CaptureKeys(aForeground ? 1 : 0);
	CAknAppUi::HandleForegroundEventL(aForeground);
}