{
OpUnknown,
OpDefault,
- OpComposeFamily /** For operations Compose, Share, MultiShare and ShareText */
+ OpComposeFamily, /** For operations Compose, Share, MultiShare and ShareText */
+ OpSettings
};
public:
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AppControlSettings_h_
+#define AppControlSettings_h_
+
+#include "AppControlCommand.h"
+
+namespace Msg {
+ class AppControlSettings;
+ typedef std::shared_ptr<AppControlSettings> AppControlSettingsRef;
+
+ class AppControlSettings
+ : public AppControlCommand {
+ public:
+ AppControlSettings(const std::string &opMsg, app_control_h handle);
+ virtual ~AppControlSettings();
+
+ static constexpr const char* getOpName();
+ };
+
+ inline AppControlSettings::AppControlSettings(const std::string &opMsg, app_control_h handle)
+ : AppControlCommand(opMsg, OpSettings)
+ {
+ }
+
+ inline AppControlSettings::~AppControlSettings()
+ {
+ }
+
+ inline constexpr const char* AppControlSettings::getOpName()
+ {
+ return "http://tizen.org/appcontrol/operation/setting/messages";
+ }
+}
+
+#endif /* AppControlSettings_h_ */
#include "AppControlCommand.h"
#include "AppControlDefault.h"
#include "AppControlCompose.h"
+#include "AppControlSettings.h"
#include <app_control.h>
#include <string>
{APP_CONTROL_OPERATION_COMPOSE, AppControlCommand::OpComposeFamily},
{APP_CONTROL_OPERATION_SHARE, AppControlCommand::OpComposeFamily},
{APP_CONTROL_OPERATION_MULTI_SHARE, AppControlCommand::OpComposeFamily},
- {APP_CONTROL_OPERATION_SHARE_TEXT, AppControlCommand::OpComposeFamily}
+ {APP_CONTROL_OPERATION_SHARE_TEXT, AppControlCommand::OpComposeFamily},
+ {AppControlSettings::getOpName(), AppControlCommand::OpSettings}
};
AppControlCommand::OperationType getOperation(const char *op)
case AppControlCommand::OpDefault:
cmd = std::make_shared<AppControlDefault>(opStr, handle);
break;
-
case AppControlCommand::OpComposeFamily:
cmd = std::make_shared<AppControlCompose>(opStr, handle);
break;
+ case AppControlCommand::OpSettings:
+ cmd = std::make_shared<AppControlSettings>(opStr, handle);
+ break;
default:
case AppControlCommand::OpUnknown:
cmd = std::make_shared<AppControlCommand>(opStr, opType);
#include "AppControlCommand.h"
#include "AppControlCompose.h"
#include "AppControlDefault.h"
+#include "AppControlSettings.h"
#include "App.h"
namespace Msg {
*/
void execCmd(const AppControlDefaultRef &cmd);
+ /**
+ * @brief Executes app control command of Settings type.
+ */
+ void execCmd(const AppControlSettingsRef &cmd);
+
/**
* @brief Executes app control command of compose type. This is Compose, Share, MultiShare, ShareText.
*/
#include "AppControlParser.h"
#include "AppControlDefault.h"
#include "AppControlCompose.h"
+#include "AppControlSettings.h"
#include "PathUtils.h"
#include "Config.h"
#include "SystemSettingsManager.h"
if (m_pNaviFrame)
m_pNaviFrame->execCmd(std::static_pointer_cast<AppControlCompose>(cmd));
break;
+ case AppControlCommand::OpSettings:
+ if (m_pNaviFrame)
+ m_pNaviFrame->execCmd(std::static_pointer_cast<AppControlSettings>(cmd));
+ break;
case AppControlCommand::OpUnknown:
default:
MSG_LOG_WARN("Not supported command");
}
}
+void NaviFrameController::execCmd(const AppControlSettingsRef &cmd)
+{
+ if (prepare(*cmd)) {
+ AppControlLauncher::getInst().terminate();
+ auto *frame = findTopFrame<SettingsFrame>();
+ if (frame) {
+ promote(*frame);
+ } else {
+ auto *frame = new SettingsFrame(*this);
+ push(*frame);
+ }
+ }
+}
+
template<typename T>
T *NaviFrameController::findTopFrame() const
{
<operation name="http://tizen.org/appcontrol/operation/share_text"/>
<uri name="mmsto"/>
</app-control>
+ <app-control>
+ <operation name="http://tizen.org/appcontrol/operation/setting/messages"/>
+ </app-control>
</ui-application>
<privileges>
<privilege>http://tizen.org/privilege/datasharing</privilege>