{
switch(actionId)
{
- case TouchForm::ID_BUTTON_EXECUTE:
- {
- if(__pTracker)
- {
- ExecuteQr(__pTracker->GetTextMessage());
- }
- }
- break;
-
case ID_BUTTON_YES:
{
//Crushing application without this
}
void
-QrCodeRecognizer::ExecuteQr(Tizen::Base::String text)
-{
- if (!text.IsEmpty())
- {
- ControlManager* cMan = ControlManager::GetInstance();
-
- if (text.StartsWith(L"http://", 0) ||
- text.StartsWith("ftp://", 0) ||
- text.StartsWith("ftps://", 0) ||
- text.StartsWith("sftp://", 0) ||
- text.StartsWith("https://", 0)
- )
- {
- cMan->ShowUrl(text);
- }
- else if (text.StartsWith(L"sms:", 0))
- {
- Tizen::Base::String _number;
- Tizen::Base::String _body;
-
- int _numberStartIndex = 4; // message starting with "sms:" substring with length = 4
- int _numberFinishIndex;
- int _messageStartIndex;
- text.IndexOf(L"?", _numberStartIndex, _numberFinishIndex);
- text.SubString(_numberStartIndex, _numberFinishIndex - _numberStartIndex, _number);
- text.IndexOf(L"body=", _numberStartIndex, _messageStartIndex);
- text.SubString(_messageStartIndex + 5, _body);
-
- cMan->ShowSms(_number, _body);
- }
- else if (text.StartsWith(L"BEGIN:VCARD", 0))
- {
- cMan->ShowContact(text);
- }
- else
- {
- cMan->ShowText(text);
- }
- }
-}
-
-void
QrCodeRecognizer::OnFormBackRequested(Tizen::Ui::Controls::Form &source)
{
__pPopup->SetShowState(true);
Tizen::Ui::Controls::Footer* pFooter = GetFooter();
- Tizen::Ui::Controls::FooterItem pFooterItemMain;
- pFooterItemMain.Construct(ID_BUTTON_EXECUTE);
- pFooterItemMain.SetText(L"Process Qr");
- pFooter->AddItem(pFooterItemMain);
-
pFooter->AddActionEventListener(*__pLoadListener);
SetFormBackEventListener(__pBackListener);
return r;