shared_ptr<ZLOptionsDialog> ZLbadaDialogManager::createOptionsDialog(const ZLResourceKey &key, shared_ptr<ZLRunnable> applyAction, bool showApplyButton) const {
	AppLog("ZLbadaDialogManager::createOptionsDialog");
	//ZLbadaOptionsDialog* b= new ZLbadaOptionsDialog(myApplicationWindow->viewWidget().mybadaForm,resource()[key], applyAction, showApplyButton);
	//mybadaOptionsDialog =new ZLbadaOptionsDialog(myApplicationWindow->viewWidget().mybadaForm,resource()[key], applyAction, showApplyButton);
	shared_ptr<ZLOptionsDialog> b = new ZLTizenOptionsDialog(myApplicationWindow->viewWidget().mybadaForm,resource()[key], applyAction, showApplyButton);
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	TizenDialogForm* d = (TizenDialogForm*)pFrame->GetCurrentForm();
	d->__badaOptionsDialog = b;
	//b->myDialogForm = myApplicationWindow->viewWidget().mybadaForm->CreateDalogForm();
	return b;//new ZLbadaOptionsDialog(myApplicationWindow->viewWidget().mybadaForm,resource()[key], applyAction, showApplyButton);
}
void VKUDialogsPanel::OnRefresh() {
	pProvider->LoadData();

	Frame* frame = VKUApp::GetInstance()->GetFrame(FRAME_NAME);
	Form* form = frame->GetCurrentForm();
	if (form->GetName() == IDF_MAIN) {
		VKUMainForm *mainForm = dynamic_cast<VKUMainForm *>(form);
		if(mainForm != null) {
			mainForm->UpdateCounters();
		}
	}
}
shared_ptr<ZLTreeDialog> ZLbadaDialogManager::createTreeDialog(const ZLResourceKey &key) const {
	AppLog("ZLbadaDialogManager::createTreeDialog");

	//myTreeDialog = new ZLbadaTreeDialog(resource()[key]);
	//return myTreeDialog;

	shared_ptr<ZLTreeDialog> b = new ZLbadaTreeDialog(resource()[key]);
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	TreeViewForm* d = (TreeViewForm*)pFrame->GetCurrentForm();
	d->__myTreeDialog = b;
   return b;

}
void VKUServiceProxy::OnMessageReceivedN(RemoteMessagePort* pRemoteMessagePort, IMap* pMessage) {
	AppLog("VKU : A response message is Received.");

	VKUApp* pApp = static_cast<VKUApp*>(App::GetInstance());

	if (pApp != null) {
		String* event = static_cast<String*>(pMessage->GetValue(String(L"event")));
		if (event != null) {

			if(event->CompareTo(L"newmessage") == 0) {
				int messageId;
				Integer::Parse(*static_cast<String *>(pMessage->GetValue(String(L"messageid"))), messageId);

				Frame* frame = pApp->GetFrame(FRAME_NAME);
				Form* form = frame->GetCurrentForm();
				if (form->GetName() == IDF_DIALOG) {
					VKUDialogPanel* pDialogPanel = static_cast<VKUDialogPanel*>(form->GetControl(IDC_PANEL_DIALOG));
					if (pDialogPanel != null) {
						pDialogPanel->LoadNewMessage(messageId);
					}
				}
			} else if(event->CompareTo(L"typing") == 0) {
				Frame* frame = pApp->GetFrame(FRAME_NAME);
				Form* form = frame->GetCurrentForm();
				if (form->GetName() == IDF_DIALOG) {
					VKUDialogPanel* pDialogPanel = static_cast<VKUDialogPanel*>(form->GetControl(IDC_PANEL_DIALOG));
					if (pDialogPanel != null) {
						pDialogPanel->OnTyping();
					}
				}
			} else if(event->CompareTo("read") == 0) {
				int messageId;
				Integer::Parse(*static_cast<String *>(pMessage->GetValue(String(L"msg_id"))), messageId);

				if(_readEventListener != null) {
					_readEventListener->OnReadEvent(messageId);
				}
			} else if(event->CompareTo(L"status") == 0) {
				int userId;
				bool online;
				bool current;

				Integer::Parse(*static_cast<String *>(pMessage->GetValue(String(L"user_id"))), userId);
				online = static_cast<String *>(pMessage->GetValue(String(L"status")))->CompareTo(L"online") == 0;
				current = static_cast<String *>(pMessage->GetValue(String(L"current")))->CompareTo(L"true") == 0;

				// TODO: status processing
				// current = user in current dialog?
			} else if(event->CompareTo("audio-progress") == 0) {
				long duration, position;

				Long::Parse(*static_cast<String *>(pMessage->GetValue(String(L"duration"))), duration);
				Long::Parse(*static_cast<String *>(pMessage->GetValue(String(L"position"))), position);

				if(_audioProgressListener != null) {
					_audioProgressListener->OnAudioProgress(duration, position);
				}

				if(_audioElement != null) {
					_audioElement->OnProgress((int)(((double)position / (double)duration)*100));
				}
			}
		}
	}


	delete pMessage;
}
Example #5
0
void TreeViewForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{

	AppLog("TreeViewForm::OnUserEventReceivedN requestId = %d", requestId);

	if (requestId == 997) {
		//int oldItemCount = ItemCount;
		ItemCount = myTreeDialog->myCurrentNode->children().size();
		int bottomIndex=__pListView->GetBottomDrawnItemIndex();
		int topIndex = __pListView->GetTopDrawnItemIndex ();
		AppLog("###### GetTopDrawnItemIndex = %d", topIndex);
		AppLog("###### GetBottomDrawnItemIndex = %d", bottomIndex);
		//if (bottomIndex < 0 ) updatedItem = 0;
		if (bottomIndex <0 ) {
			for (int i = 0; i<ItemCount; i++)
						__pListView->RefreshList(i,LIST_REFRESH_TYPE_ITEM_ADD);
			updatedItem = ItemCount;
			return;
		}

		if ((updatedItem-bottomIndex)>5) return;
		int upItem = ((updatedItem+5)<ItemCount)?(updatedItem+5):ItemCount;

		for (int i = updatedItem; i<upItem; i++)
			__pListView->RefreshList(i,LIST_REFRESH_TYPE_ITEM_ADD);
		//__pListView->Invalidate(false);
		updatedItem = upItem;
		return;
	}
	if (requestId == 998) {
		updateHeader();
		return;
	}

	if (requestId == 999) {
		updateContent();
		return;
	}

	if (requestId>999) {
		__pListView->RefreshList(requestId-1000,LIST_REFRESH_TYPE_ITEM_MODIFY);
		return;
	}

	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

	Form* prevForm = pFrame->GetCurrentForm();
	switch(requestId)
	{
	case 0:
		{
			pFrame->SetCurrentForm(*this);
			pFrame->RequestRedraw();
			if (prevForm != null)		{
				pFrame->RemoveControl(*prevForm);
				}

		}
		break;
	case 1:
		{
			AppLog("TreeViewForm::OnUserEventReceivedN 1");
			pFrame->SetCurrentForm(*this);
			pFrame->RequestRedraw();
		}
		break;
	case 2:
		{
			AppLog("TreeViewForm::OnUserEventReceivedN 2");
			pPreviousForm->SendUserEvent(0, null);
		}
		break;
	case 10: // авторизация удалась
		{	AppLog("TreeViewForm::OnUserEventReceivedN 10");
			pFrame->SetCurrentForm(*this);
			pFrame->RequestRedraw();
			if (prevForm != null)		{
				pFrame->RemoveControl(*prevForm);
				}
			if (myNode != null) {
				myNode->beforeExpandNode();
				AppLog("before enter");
				myTreeDialog->enter(myNode);
			}
		}
		break;
	default:
		break;
	}

}