3 // Open Service Platform
4 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // All rights reserved.
7 // This software contains confidential and proprietary information
8 // of Samsung Electronics Co., Ltd.
9 // The user of this software agrees not to disclose, disseminate or copy such
10 // Confidential Information and shall use the software only in accordance with
11 // the terms of the license agreement the user entered into with Samsung.
14 #include "ControlManager.h"
18 #include "TouchForm.h"
20 using namespace Tizen::App;
21 using namespace Tizen::Base;
23 static const String TEMP_VCARD_PATH = L"/opt/temp.vcf";
25 ControlManager::ControlManager()
32 ControlManager::~ControlManager()
37 ControlManager::GetInstance()
39 static ControlManager __manager;
45 ControlManager::StartControl(void)
47 AppControl* pAc = AppManager::FindAppControlN(__provider, __operation);
50 pAc->Start(null, null, &__data, null);
57 ControlManager::ShowText(Tizen::Base::String __text)
61 Tizen::Ui::Controls::MessageBox msgBox;
62 msgBox.Construct("Text Recognized", __text, Tizen::Ui::Controls::MSGBOX_STYLE_OK);
64 msgBox.ShowAndWait(modalResult);
68 ControlManager::ShowUrl(Tizen::Base::String __url)
71 __provider = L"tizen.internet";
72 __operation = L"http://tizen.org/appcontrol/operation/view";
76 __data.Add(&urlKey, &urlVal);
82 ControlManager::ShowSms(Tizen::Base::String __numbers, Tizen::Base::String __body)
84 __provider = L"tizen.messages";
85 __operation = L"http://tizen.org/appcontrol/operation/compose";
87 String typeKey = L"type";
88 String typeVal = L"SMS";
89 String textKey = L"text";
90 String textVal = __body;
92 String toVal = __numbers;
93 __data.Add(&typeKey, &typeVal);
94 __data.Add(&textKey, &textVal);
95 __data.Add(&toKey, &toVal);
100 ControlManager::ShowContact(Tizen::Base::String __Text)
102 __provider = L"tizen.contacts";
103 __operation = L"http://tizen.org/appcontrol/operation/view";
105 String typeKey("viewType");
106 String typeVal("vcf");
107 String pathKey("path");
108 String pathVal(TEMP_VCARD_PATH);
109 __data.Add(&typeKey, &typeVal);
110 __data.Add(&pathKey, &pathVal);
112 Tizen::Io::File file;
113 result r = file.Construct(TEMP_VCARD_PATH, L"w+");
119 r = file.Write(__Text);
130 ControlManager::ShowCall(Tizen::Base::String __phone)
132 __provider = L"tizen.phone";
133 __operation = L"http://tizen.org/appcontrol/operation/call";
135 String telKey(L"tel");
136 String telVal(__phone);
137 String typeKey("type");
138 String typeVal("voice");
139 __data.Add(&telKey, &telVal);
140 __data.Add(&typeKey, &typeVal);
146 ControlManager::ShowEmail(Tizen::Base::String __addr)
148 __provider = L"tizen.email";
149 __operation = L"http://tizen.org/appcontrol/operation/compose";