using namespace Tizen::Io;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Runtime;
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
+
const int SharePopup::IDA_CANCEL_BUTTON = 101;
const int SharePopup::ID_FORMAT_MESSAGE_STRING = 500;
const int SharePopup::ID_FORMAT_EMAIL_STRING = 501;
SharePopup::SharePopup(void)
:__pList(null),__pShareList(null)
{
-
+ __appControlOngoing = false;
+ __pTimer = null;
}
SharePopup::~SharePopup(void)
pCancelButton->SetActionId(IDA_CANCEL_BUTTON);
}
+ __pTimer = new(std::nothrow) Timer();
+ __pTimer->Construct(*this);
+ SetPropagatedKeyEventListener(this);
return true;
}
}
void
+SharePopup::OnTimerExpired(Timer& timer)
+{
+ Popup::SetShowState(false);
+ Popup::Show();
+}
+
+void
SharePopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
switch(actionId)
{
case 0:
{
-
- // share via message
- StartMessageAppControl();
- Popup::SetShowState(false);
- Popup::Show();
+ if(__appControlOngoing == false)
+ {
+ __appControlOngoing = true;
+ // share via message
+ StartMessageAppControl();
+ __pTimer->Start(2500);
+ }
}
break;
case 1:
{
+ if(__appControlOngoing == false)
+ {
+ __appControlOngoing = true;
+ // share via email
+ StartEmailAppControl();
+ __pTimer->Start(2500);
+ }
- // share via email
- StartEmailAppControl();
- Popup::SetShowState(false);
- Popup::Show();
}
break;
default:
ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
int textSize = 35;
int elementHeight = 50;
- int listItemWidth = 80;
+ int listItemHeight = 75;
CustomItem* pItem = new(std::nothrow) CustomItem();
- r = pItem->Construct(Dimension(GetClientAreaBounds().width, listItemWidth), style);
+ r = pItem->Construct(Dimension(GetClientAreaBounds().width, listItemHeight), style);
if (IsFailed(r))
{
AppLogDebug("Create Item Failed with error %s", GetErrorMessage(r));
{
AppLogDebug("SharePopUp CreateItem 0");
// IDS_SHARE_VIA_MESSAGE
- pItem->AddElement(Rectangle(45,0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_MESSAGE_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_MESSAGES"), true);
+ pItem->AddElement(Rectangle(45,0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_MESSAGE_STRING, CommonUtil::GetString(L"IDS_BR_OPT_MESSAGES"), true);
}
break;
case 1:
{
AppLogDebug("SharePopUp CreateItem 1");
// IDS_SHARE_VIA_EMAIL
- pItem->AddElement(Rectangle(45, 0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_EMAIL_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_EMAIL"), true);
+ pItem->AddElement(Rectangle(45, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_EMAIL_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SENDURLVIA_EMAIL"), true);
}
break;
default:
String ccVal = L"";
String bccKey = L"http://tizen.org/appcontrol/data/bcc";
String bccVal = L"";
+ String resultKey = L"http://tizen.org/appcontrol/data/return_result";
+ String resultVal = "true";
+
//String attachKey = L"attachments";
String attachKey = L"http://tizen.org/appcontrol/data/path";
extraData.Add(&toKey, &toVal);
extraData.Add(&ccKey, &ccVal);
extraData.Add(&bccKey, &bccVal);
+ extraData.Add(&resultKey, &resultVal);
if(attachVal.GetLength() > 0)
{
extraData.Add(&attachKey, pDataList);
delete pAc;
}
- if (pShareInfo != null)
- {
- delete pShareInfo;
- }
delete pDataList;
-
}
void
String textVal;
String attachKey = L"http://tizen.org/appcontrol/data/path";
String attachVal;
+ String resultKey = L"http://tizen.org/appcontrol/data/return_result";
+ String resultVal = "true";
ArrayList* pDataList = null;
if (__pShareList != null)
// type is SMS , attach the text
extraData.Add(&textKey, &textVal);
}
-
+ extraData.Add(&resultKey, &resultVal);
AppControl* pAc = AppManager::FindAppControlN(L"tizen.messages", L"http://tizen.org/appcontrol/operation/compose");
if (pAc)
{
delete pAc;
}
- if (pShareInfo != null)
- {
- delete pShareInfo;
- }
if(pDataList)
{
delete pDataList;
SharePopup::OnAppControlCompleted(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::IList* pResultList)
{
AppLog("InternetApp::OnForeground called");
- Frame* pCurrentFrame = null;
- pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
- if (pCurrentFrame != null)
- {
- pCurrentFrame->SetEnabled(true);
- pCurrentFrame->Invalidate(true);
- }
}
void SharePopup::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
{
AppLog("SharePopup::OnAppControlCompleteResponseReceived");
- Frame* pCurrentFrame = null;
- pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
- if (pCurrentFrame != null)
+ ShareInfo* pShareInfo = null;
+ result r = E_FAILURE;
+
+ if (__pShareList != null)
{
- pCurrentFrame->SetEnabled(true);
- pCurrentFrame->Invalidate(true);
+ pShareInfo = dynamic_cast<ShareInfo*>(__pShareList->GetAt(0));
}
+ String attachVal;
+ bool imageAttachment = false;
+ if (pShareInfo != null)
+ {
+ imageAttachment = pShareInfo->GetImageAttached();
+ if (imageAttachment)
+ {
+ attachVal = pShareInfo->GetImagePath();
+ AppLog("SharePopup:: imagePath is %S",attachVal.GetPointer());
+ r = File::Remove(attachVal);
+ if(r == E_SUCCESS)
+ {
+ AppLog("removed success");
+ }
+ else
+ {
+ AppLog("removed failure");
+ }
+ }
+ if (pShareInfo != null)
+ {
+ delete pShareInfo;
+ }
+ }
+ Popup::SetShowState(false);
+ Popup::Show();
+ __appControlOngoing = false;
+}
+
+bool
+SharePopup::OnKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
+{
+ AppLog("ConfirmationPopup::OnKeyReleased %d",keyEventInfo.GetKeyCode());
+ if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
+ {
+ if(GetShowState() == true)
+ {
+ SetShowState(false);
+ }
+ }
+ return false;
}