summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalij Tymchyshyn <v.tymchyshyn@samsung.com>2013-04-10 23:31:58 +0900
committerVitalij Tymchyshyn <v.tymchyshyn@samsung.com>2013-04-10 23:31:58 +0900
commit3367f2014b4808d63da63c0b4f80d6d65502837e (patch)
tree08095eacfb35fb8d901a1b2afa024634c44aaa32
parent7957fb08cfac45cbe76d97eaf471e290c3068c7f (diff)
downloadQrCodeGenerator-3367f2014b4808d63da63c0b4f80d6d65502837e.tar.gz
QrCodeGenerator-3367f2014b4808d63da63c0b4f80d6d65502837e.tar.bz2
QrCodeGenerator-3367f2014b4808d63da63c0b4f80d6d65502837e.zip
merged with develop
Change-Id: I4bfd8ee4c3a1c4b7ffcf5a68b154c8b270588047
-rw-r--r--project/inc/QrForm.h7
-rw-r--r--project/manifest.xml1
-rw-r--r--project/src/QrForm.cpp66
3 files changed, 57 insertions, 17 deletions
diff --git a/project/inc/QrForm.h b/project/inc/QrForm.h
index 1fc846d..9a4e6ad 100644
--- a/project/inc/QrForm.h
+++ b/project/inc/QrForm.h
@@ -41,14 +41,19 @@ public:
const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
const Tizen::Ui::Scenes::SceneId& nextSceneId);
- void OnFormBackRequested(Tizen::Ui::Controls::Form &source);
+ virtual void OnFormBackRequested(Tizen::Ui::Controls::Form &source);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+ virtual void OnUserEventReceivedN(RequestId request, Tizen::Base::Collection::IList* pArgs);
+
virtual result OnDraw(void);
public:
static const Tizen::Base::String TEMP_IMAGE_PATH;
+ static const int DO_MESSAGE_ON_SAVE_OK = 501;
+ static const int DO_MESSAGE_ON_SAVE_FAIL = 502;
+
private:
result OpenBitmap(void);
result SaveQr(Tizen::Base::String imPath);
diff --git a/project/manifest.xml b/project/manifest.xml
index 3d40a26..9ef72ae 100644
--- a/project/manifest.xml
+++ b/project/manifest.xml
@@ -14,6 +14,7 @@
<Privileges>
<Privilege>http://tizen.org/privilege/power</Privilege>
<Privilege>http://tizen.org/privilege/content.write</Privilege>
+ <Privilege>http://tizen.org/privilege/content.read</Privilege>
</Privileges>
<UiApp Main="True" MenuIconVisible="True" Name="$(projectName)">
<UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720"/>
diff --git a/project/src/QrForm.cpp b/project/src/QrForm.cpp
index 8329bac..3c02be7 100644
--- a/project/src/QrForm.cpp
+++ b/project/src/QrForm.cpp
@@ -191,31 +191,20 @@ QrForm::SaveQr(Tizen::Base::String imPath)
int width(0), height(0);
r = qrGen.EncodeToFile(__qrData.qrText, __qrData.qrMode, __qrData.errCorrectionLevel, true, imPath, Tizen::Media::IMG_FORMAT_PNG, width, height);
- MessageBox msgBox;
- int modalResult(0);
- Tizen::Base::String msgText;
- Tizen::Base::String msgTitle;
-
- if (!IsFailed(r))
+ if(!IsFailed(r))
{
- r = ContentManager::ScanFile(imPath);
+ r = ContentManager::ScanFile(imPath);
}
- if (IsFailed(r))
+ if (!IsFailed(r))
{
- msgTitle = "Error";
- msgText = "Error while saving QR.";
+ SendUserEvent(DO_MESSAGE_ON_SAVE_OK, null);
}
else
{
- msgTitle = "Success";
- msgText = "QR code is saved.";
+ SendUserEvent(DO_MESSAGE_ON_SAVE_FAIL, null);
}
- msgBox.Construct(msgTitle, msgText, Tizen::Ui::Controls::MSGBOX_STYLE_OK);
- msgBox.ShowAndWait(modalResult);
-
-// OpenBitmap();
return r;
}
@@ -227,3 +216,48 @@ QrForm::OnDraw(void)
return E_SUCCESS;
}
+void
+QrForm::OnUserEventReceivedN(RequestId request, Tizen::Base::Collection::IList* pArgs)
+{
+ switch (request)
+ {
+ case DO_MESSAGE_ON_SAVE_OK:
+ {
+ MessageBox msgBox;
+ int modalResult(0);
+ Tizen::Base::String msgText;
+ Tizen::Base::String msgTitle;
+
+ msgTitle = "Success";
+ msgText = "QR code is saved.";
+
+ msgBox.Construct(msgTitle, msgText, Tizen::Ui::Controls::MSGBOX_STYLE_OK);
+ msgBox.ShowAndWait(modalResult);
+ }
+ break;
+ case DO_MESSAGE_ON_SAVE_FAIL:
+ {
+ MessageBox msgBox;
+ int modalResult(0);
+ Tizen::Base::String msgText;
+ Tizen::Base::String msgTitle;
+
+ msgTitle = "Error";
+ msgText = "Error while saving QR.";
+
+ msgBox.Construct(msgTitle, msgText, Tizen::Ui::Controls::MSGBOX_STYLE_OK);
+ msgBox.ShowAndWait(modalResult);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if(pArgs)
+ {
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
+
+}
+