</xs:complexType>
</xs:element>
+<!-- TODO : appservice will be removed. Please use app-control-->
<xs:element name="appservice">
<xs:complexType>
<xs:attribute name="src" type="xs:NCName" use="required"/>
</xs:complexType>
</xs:element>
+<xs:element name="app-control">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="packages:src"/>
+ <xs:element ref="packages:operation"/>
+ <xs:element ref="packages:scheme"/>
+ <xs:element ref="packages:mime"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="category">
+ <xs:complexType>
+ <xs:anyAttribute processContents="lax"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="src">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="operation">
+ <xs:complexType>
+ <xs:attribute name="name" type="tizen:appserviceOperationType" use="required"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="scheme">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="optional"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="mime">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="optional"/>
+ </xs:complexType>
+</xs:element>
+
</xs:schema>
ConfigParserData::Setting m_setting;
};
-class ServiceParser : public ElementParser
+class AppControlParser : public ElementParser
{
public:
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
m_data.appServiceList.push_back(serviceInfo);
}
- ServiceParser(ConfigParserData& data) :
+ AppControlParser(ConfigParserData& data) :
ElementParser(),
m_src(DPL::OptionalString::Null),
m_operation(DPL::OptionalString::Null),
bool m_properNamespace;
};
+class CategoryParser : public ElementParser
+{
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if (attribute.name == L"name") {
+ if (attribute.value.size() > 0) {
+ m_name = attribute.value;
+ }
+ }
+ }
+
+ virtual void Accept(const Element& /*element*/)
+ {
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {
+ }
+
+ virtual void Verify()
+ {
+ if (m_name.IsNull()) {
+ LogWarning("name attribute of category element is mandatory - ignoring");
+ return;
+ }
+
+ if (m_data.categoryList.find(*m_name) ==
+ m_data.categoryList.end()) {
+ m_data.categoryList.insert(*m_name);
+ }
+ }
+
+ explicit CategoryParser(ConfigParserData& data) :
+ m_data(data)
+ {
+ }
+
+ private:
+ DPL::OptionalString m_name;
+ ConfigParserData& m_data;
+};
+
ElementParser::ActionFunc WidgetParser::GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
m_map[L"link"] = DPL::MakeDelegate(this, &WidgetParser::OnLinkElement);
m_map[L"setting"] =
DPL::MakeDelegate(this, &WidgetParser::OnSettingElement);
- m_map[L"appservice"] = DPL::MakeDelegate(this, &WidgetParser::OnServiceElement);
+ // TODO: appservice will be removed
+ m_map[L"appservice"] = DPL::MakeDelegate(this, &WidgetParser::OnAppControlElement);
m_map[L"application"] = DPL::MakeDelegate(this, &WidgetParser::OnApplicationElement);
m_map[L"splash"] = DPL::MakeDelegate(this, &WidgetParser::OnSplashElement);
m_map[L"background"] = DPL::MakeDelegate(this, &WidgetParser::OnBackgroundElement);
m_map[L"privilege"] = DPL::MakeDelegate(this, &WidgetParser::OnPrivilegeElement);
+ m_map[L"appcontrol"] = DPL::MakeDelegate(this,
+ &WidgetParser::OnAppControlElement);
+ m_map[L"category"] = DPL::MakeDelegate(this,
+ &WidgetParser::OnCategoryElement);
}
ElementParserPtr WidgetParser::OnNameElement()
return ElementParserPtr(new SettingParser(m_data));
}
-ElementParserPtr WidgetParser::OnServiceElement()
-{
- return ElementParserPtr(new ServiceParser(m_data));
-}
-
ElementParserPtr WidgetParser::OnApplicationElement()
{
return ElementParserPtr(new ApplicationParser(m_data));
return ElementParserPtr(new PrivilegeParser(m_data));
}
+ElementParserPtr WidgetParser::OnAppControlElement()
+{
+ return ElementParserPtr(new AppControlParser(m_data));
+}
+
+ElementParserPtr WidgetParser::OnCategoryElement()
+{
+ return ElementParserPtr(new CategoryParser(m_data));
+}
+
void WidgetParser::Accept(const Element& element)
{
if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&
ElementParserPtr OnAccessElement();
ElementParserPtr OnLinkElement();
ElementParserPtr OnSettingElement();
- ElementParserPtr OnServiceElement();
ElementParserPtr OnApplicationElement();
ElementParserPtr OnSplashElement();
ElementParserPtr OnBackgroundElement();
ElementParserPtr OnPrivilegeElement();
+ ElementParserPtr OnAppControlElement();
+ ElementParserPtr OnCategoryElement();
virtual ActionFunc GetElementParser(const DPL::String& ns,
const DPL::String& name);
writeElementWithOneAttribute(writer, "icon", i->getString(), "xml:lang",
i->getLang(), i->hasLang());
}
- FOREACH(a, this->applicationService)
+ FOREACH(a, this->appControl)
{
a->serialize(writer);
}
writeElementWithOneAttribute(writer, "icon", i->getString(), "xml:lang",
i->getLang(), i->hasLang());
}
- FOREACH(a, this->applicationService)
+ FOREACH(a, this->appControl)
{
a->serialize(writer);
}
+ FOREACH(c, this->appCategory)
+ {
+ startElement(writer, "category");
+ writeAttribute(writer, "name", *c);
+ endElement(writer);
+ }
endElement(writer);
}
endElement(writer);
}
-void ApplicationService::serialize(xmlTextWriterPtr writer)
+void AppControl::serialize(xmlTextWriterPtr writer)
{
- startElement(writer, "application-service");
+ startElement(writer, "app-control");
FOREACH(o, this->operation)
{
startElement(writer, "operation");
}
endElement(writer);
}
-
} //namespace Jobs
} //namespace WidgetInstall
typedef DPL::String NcnameType, NmtokenType, AnySimpleType, LangType;
typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType;
typedef DPL::OptionalString InstallLocationType, CategoriesType;
+typedef DPL::String AppCategoryType;
/**
* xmllib2 wrappers
/**
* @brief application-service element
*/
-class ApplicationService
+class AppControl
{
public:
- ApplicationService() {}
+ AppControl() {}
void addOperation(const OperationType &x) { this->operation.push_back(x); }
void addUri(const UriType &x) { this->uri.push_back(x); }
void addMime(const MimeType &x) { this->mime.push_back(x); }
std::list<MimeType> mime; //attr name AnySimpleType
};
-typedef ApplicationService ApplicationServiceType;
+typedef AppControl AppControlType;
/**
* @brief ime-application element
void setType(const TypeType &x) { this->type = x; }
void addLabel(const LabelType &x) { this->label.push_back(x); }
void addIcon(const IconType &x) { this->icon.push_back(x); }
- void addApplicationService(const ApplicationServiceType &x)
+ void addAppControl(const AppControlType &x)
{
- this->applicationService.push_back(x);
+ this->appControl.push_back(x);
}
void serialize(xmlTextWriterPtr writer);
private:
TypeType type;
std::list<LabelType> label; //attr name AnySimpleType
std::list<IconType> icon; //attr name AnySimpleType
- std::list<ApplicationServiceType> applicationService; //attr name AnySimpleType
+ std::list<AppControlType> appControl; //attr name AnySimpleType
};
typedef ServiceApplication ServiceApplicationType;
void setCategories(const NcnameType &x) { this->categories = x; }
void addLabel(const LabelType &x) { this->label.push_back(x); }
void addIcon(const IconType &x) { this->icon.push_back(x); }
- void addApplicationService(const ApplicationServiceType &x)
+ void addAppControl(const AppControlType &x)
{
- this->applicationService.push_back(x);
+ this->appControl.push_back(x);
+ }
+ void addAppCategory(const AppCategoryType &x)
+ {
+ this->appCategory.push_back(x);
}
void serialize(xmlTextWriterPtr writer);
private:
CategoriesType categories;
std::list<LabelType> label;
std::list<IconType> icon;
- std::list<ApplicationServiceType> applicationService;
+ std::list<AppControlType> appControl;
+ std::list<AppCategoryType> appCategory;
};
typedef UiApplication UiApplicationType;
setWidgetManifest(manifest);
setWidgetOtherInfo(uiApp);
setAppServiceInfo(uiApp);
+ setAppCategory(uiApp);
manifest.addUiApplication(uiApp);
manifest.generate(path);
// x-tizen-svc=http://tizen.org/appcontrol/operation/pick|NULL|image;
FOREACH(it, appServiceList) {
- ApplicationService appService;
+ AppControl appControl;
if (!it->m_operation.empty()) {
- appService.addOperation(it->m_operation); //TODO: encapsulation?
+ appControl.addOperation(it->m_operation); //TODO: encapsulation?
}
if (!it->m_scheme.empty()) {
- appService.addUri(it->m_scheme);
+ appControl.addUri(it->m_scheme);
}
if (!it->m_mime.empty()) {
- appService.addMime(it->m_mime);
+ appControl.addMime(it->m_mime);
+ }
+ uiApp.addAppControl(appControl);
+ }
+}
+
+void TaskManifestFile::setAppCategory(UiApplication &uiApp)
+{
+ WrtDB::ConfigParserData::CategoryList categoryList =
+ m_context.widgetConfig.configInfo.categoryList;
+
+ if (categoryList.empty()) {
+ LogInfo("Widget doesn't contain application category");
+ return;
+ }
+ FOREACH(it, categoryList) {
+ if (!(*it).empty()) {
+ uiApp.addAppCategory(*it);
}
- uiApp.addApplicationService(appService);
}
}
void setWidgetManifest(Manifest & manifest);
void setWidgetOtherInfo(UiApplication & uiApp);
void setAppServiceInfo(UiApplication & uiApp);
+ void setAppCategory(UiApplication & uiApp);
void generateWidgetName(Manifest & manifest, UiApplication &uiApp, const DPL::OptionalString& tag, DPL::OptionalString name, bool & defaultNameSaved);
void generateWidgetIcon(UiApplication & uiApp, const DPL::OptionalString& tag, const DPL::String& language, bool & defaultIconSaved);