Example #1
0
void
CropForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
	result r = E_SUCCESS;
	if(requestId == REQUEST_ID_DISPLAYIMAGE)
	{
		HashMap extraData;
		extraData.Construct();
		String typeKey = L"type";
		String typeVal = L"image";
		String selectKey = L"selectionType";
		String selectVal = L"single";
		extraData.Add(&typeKey, &typeVal);
		extraData.Add(&selectKey, &selectVal);

		AppControl* pAc = AppManager::FindAppControlN(L"tizen.filemanager",  L"http://tizen.org/appcontrol/operation/pick");
		if (pAc)
		{
			result r = pAc->Start(null, null, &extraData, this);
			if(r != E_SUCCESS)
				AppLogException("Error launching appcontrol, %s", GetErrorMessage(r));
			delete pAc;
		}
	}
	else if(requestId == REQUEST_ID_DISPLAYWEBIMAGE)
	{
		if(pArgs!= null && pArgs->GetCount()>0)
		{
			Bitmap*  pBitmap = static_cast<Bitmap* >(pArgs->GetAt(0));
			LoadWebImage(pBitmap);
			RequestRedraw();
		}
	}
}
Example #2
0
bool
MapForm::ShowMyLocation(bool show)
{
	bool isMyLocationEnabled = false;
	
		_pMap->SetMyLocationEnabled(show);
	_showMe = show;

	if(show) {
		isMyLocationEnabled = _pMap->GetMyLocationEnabled();

		if(!isMyLocationEnabled)
		{
			bool value = false;
			SettingInfo::GetValue(L"GPSEnabled", value);

			if (!value){
				int modalResult = 0;
				MessageBox messageBox;
				messageBox.Construct(L"Information", L"Location services are disabled. Enable them in location settings?", MSGBOX_STYLE_YESNO);
				messageBox.ShowAndWait(modalResult);

				if (MSGBOX_RESULT_YES == modalResult){
			// Lunching SettingAppControl
			ArrayList* pDataList = new ArrayList();
			String* pData = new String(L"category:Location");

			pDataList->Construct();
			pDataList->Add(*pData);

			AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_SETTINGS, "");
			if(pAc)
			{
				pAc->Start(pDataList, this);
				delete pAc;
			}

			delete pDataList;
			delete pData;
		}
				else {
					_showMe = false;
				}
			}
		}
		else
		{
			if ( _pMap->MoveToMyLocation() != E_SUCCESS) {
				_pPopup->SetShowState(true);
				_pPopup->Show();
				_popupShow = true;
				_showMe = false;
				Redraw();
			}
		}
	}

	return _showMe;
	}
Example #3
0
void
ShareMenu::LoadBluetoothWnd(void)
{
	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_BLUETOOTH,
			APPCONTROL_OPERATION_PICK);
	if(pAc != null)
	{
		pAc->Start(null, this);
		delete pAc;
	}
}
Example #4
0
void UserForm::MakeCall() {
	String userPhone;
	JsonParseUtils::GetString(*_pUserJson, L"mobile_phone", userPhone);

	String uri = L"tel:" + userPhone;

	AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone",
	                                                 L"http://tizen.org/appcontrol/operation/dial");
	if (pAc) {
		pAc->Start(&uri, null, null, null);
		delete pAc;
	}
}
Example #5
0
void FBReader::openLinkInBrowser(const std::string &url) const {
	if (url.empty()) {
		return;
	}
	AppLog("openLinkInBrowser url=%s",url.c_str());

   int len = url.length();
   String bada_str;
   ByteBuffer buffer;
   buffer.Construct(len + 1);
   buffer.SetArray((const byte*)url.data(), 0, len);
   buffer.SetByte( '\0');
   buffer.Flip();
   Utf8Encoding utf8;
   int charCount;
   utf8.GetCharCount(buffer, charCount);
   utf8.GetString(buffer, bada_str);

	ArrayList* pDataList = null;
	pDataList = new ArrayList();
	pDataList->Construct();
	String* pData = null;

	pData = new String(L"url:" + bada_str);
	//pData = new String(L"url:http://www.bada.com");
	pDataList->Add(*pData);
	//APPCONTROL_BROWSER
	//TODO Tizen
	AppControl* pAc;// rem  TIZEN !!!!!!!!!= AppManager::FindAppControlN(APPCONTROL_BROWSER, OPERATION_VIEW);
	//AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_BROWSER, APPCONTROL_OPERATION_VIEW);
	if (pAc)    {       pAc->Start(pDataList, null);       delete pAc;    }
	pDataList->RemoveAll(true);
	delete pDataList;

	/*
	shared_ptr<ProgramCollection> collection = webBrowserCollection();
	if (collection.isNull()) {
		return;
	}
	shared_ptr<Program> program = collection->currentProgram();
	if (program.isNull()) {
		return;
	}
	std::string copy = url;
//	NetworkLinkCollection::Instance().rewriteUrl(copy, true);
	ZLLogger::Instance().println("URL", copy);
	program->run("openLink", copy);*/
}
bool MessageDocElement::OnTouchReleased(Tizen::Ui::Control& source, const Tizen::Ui::TouchEventInfo& touchEventInfo) {
	if (!touchAllowed)
		return false;

	String url;
	JsonParseUtils::GetString(*_pDocObject, L"url", url);

	AppControl* pAc = AppManager::FindAppControlN(L"tizen.internet",
							 L"http://tizen.org/appcontrol/operation/view");
	if (pAc) {
		pAc->Start(&url, null, null, null);
		delete pAc;
	}

	return true;
}
Example #7
0
void
ShareMenu::LoadMsgWnd(void)
{
	ArrayList* pDataList = null;
	pDataList = new ArrayList();
	pDataList->Construct();

	String* pData = null;
	if(__isLink == true)
	{
		pData = new String(L"type:SMS");
	}
	else
	{
		pData = new String(L"type:MMS");
	}
	pDataList->Add(*pData);

	String* pData2 = null;
	pData2 = new String(L"text:");

	pData2->SetCapacity(pData2->GetCapacity() + __shareContent.GetLength());
	pData2->Append(__shareContent);
	pDataList->Add(*pData2);

	String* pData3 = null;
	pData3 = new String(L"to:");
	pDataList->Add(*pData3);

	if(__isLink == false)
	{
	   String* pData4 = null;
	   pData4 = new String(L"attachImage:");
	   pData4->SetCapacity(pData4->GetCapacity() + __shareContent.GetCapacity());
	   pData4->Append(__shareContent);
	   pDataList->Add(*pData4);
	}

	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_MESSAGE, APPCONTROL_OPERATION_COMPOSE);
	if(pAc)
	{
	  pAc->Start(pDataList, null);
	  delete pAc;
	}
	pDataList->RemoveAll(true);
	delete pDataList;
}
void
ProjectGiraffeTab4::takePhoto(void)
{
	AppLog("take photo with camera");

	AppControl* appControl = AppManager::FindAppControlN(L"tizen.camera", L"http://tizen.org/appcontrol/operation/createcontent");

	HashMap extraData;
	extraData.Construct();
	String typeKey = L"type";
	String typeVal = L"camera";
	extraData.Add(&typeKey, &typeVal);

	if (appControl) {
		appControl->Start(null, null, &extraData, this);
		delete appControl;
	}
}
void ItemForm::OpenPostInDefaultBrowser() {

	String url;
	url.Append(L"url:");
	url.Append(pFeedItem->link);

	ArrayList* pDataList = null;
	pDataList = new ArrayList();
	pDataList->Construct();
	pDataList->Add(url);

	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_BROWSER, APPCONTROL_OPERATION_VIEW);
	pAc->Start(pDataList, null);
	delete pAc;

	pDataList->RemoveAll(false);
	delete pDataList;

}
Example #10
0
void
ShareMenu::LoadEmailWnd(void)
{
	ArrayList* pDataList = null;
	String text(__shareContent);

	pDataList = new ArrayList();
	pDataList->Construct();

	String* pData = null;
	pData = new String(L"subject:");

	String emailText;
	Application::GetInstance()->GetAppResource()->GetString(L"IDS_SHARE_SUBJECT", emailText);
	pData->SetCapacity(pData->GetCapacity() + emailText.GetCapacity());
	pData->Append(emailText);
	pDataList->Add(*pData);

	String* pData2 = null;
	pData2 = new String(L"text:");
	pData2->SetCapacity(pData2->GetCapacity() + __shareContent.GetCapacity());
	pData2->Append(__shareContent);
	pDataList->Add(*pData2);

	if(__isLink == false)
	{
	   String* pData3 = null;
	   pData3 = new String(L"attachments:");
	   pData3->SetCapacity(pData3->GetCapacity() + __shareContent.GetCapacity());
	   pData3->Append(__shareContent);
	   pDataList->Add(*pData3);
	}

	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_EMAIL, APPCONTROL_OPERATION_EDIT);
	if(pAc)
	{
	  pAc->Start(pDataList, null);
	  delete pAc;
	}
	pDataList->RemoveAll(true);
	delete pDataList;
}
Example #11
0
void
WebForm::LaunchBrowser(const String& url) {
	ArrayList* pDataList = null;
	pDataList = new ArrayList();
	pDataList->Construct();

	String* pData = null;
	pData = new String(L"url:");
	pData->Append(url);
	AppLogDebug("Launching Stock Browser with %S", pData->GetPointer());
	pDataList->Add(*pData);

	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_BROWSER, "");
	if(pAc) {
		pAc->Start(pDataList, null);
		delete pAc;
	}
	pDataList->RemoveAll(true);
	delete pDataList;
}
Example #12
0
void
Kamera::GetPicture() {
	AppLogDebug("Taking picture");

	ArrayList* pDataList = null;
	pDataList = new ArrayList();
	pDataList->Construct();

	String* pData = null;
	pData = new String(L"type:camera");
	pDataList->Add(*pData);

	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_CAMERA, OPERATION_CAPTURE);
	if(pAc)
	{
	  pAc->Start(pDataList, this);
	  delete pAc;
	}
	pDataList->RemoveAll(true);
	delete pDataList;
}
void
ProjectGiraffeTab4::choosePhoto(void)
{
	AppLog("choose photo from library");

	AppControl* appControl = AppManager::FindAppControlN(L"tizen.filemanager", L"http://tizen.org/appcontrol/operation/pick");

	HashMap extraData;
	extraData.Construct();
	String selectKey = L"selectionType";
	String selectVal = L"single";
	extraData.Add(&selectKey, &selectVal);
	String typeKey = L"type";
	String typeVal = L"image";
	extraData.Add(&typeKey, &typeVal);

	if (appControl) {
		appControl->Start(null, null, &extraData, this);
		delete appControl;
	}
}
Example #14
0
void ASControl::autorun_register()//系统启动后,autorun 带起3次
{
	int			         err;
	ServiceAddress     myAddr;
	AppControl       appOpts;
	ServicesElement    mySelf;

	appOpts.SetOption(SE_THRMSG | SE_CBNTFY);
	appOpts.SetRedundMode(SE_RM_DUPLEX);

	
	myAddr.SetApp("ASControl_App");
	myAddr.SetPrg("ASControl_Prg");
	

	if ((err = mySelf.InitStart(myAddr, appOpts)) != SE_AOK)
	{
		exit (-1);
	}
	printf("SE.InitStart ok.\n");  
	mySelf.InitComplete();
}
result
CameraRecorderForm::__ViewVideo(Osp::Base::String& videoPath)
{
	result r = E_SUCCESS;
	AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_VIDEO, APPCONTROL_OPERATION_PLAY);
	if(pAc != null)
	{
		AppLog("Video player started.");
		ArrayList* pDataList = null;
		pDataList = new ArrayList();
		pDataList->Construct();
		String* pData = null;

		pData = new String(L"type:video");
		pDataList->Add(*pData);

		pData = new String(L"path:");
		(*pData).Append(videoPath);
		pDataList->Add(*pData);

		r = pAc->Start(pDataList, null);

		delete pAc;
		pAc = null;

		pDataList->RemoveAll(true);
		delete pDataList;

	}
	else
	{
		r  = E_OBJ_NOT_FOUND;
	}

	return r;
}