Skip to content
  • SharedTemplate
  • class Esri::ArcGISRuntime::SharedTemplate

    Describes features that can be created across layers within a geodatabase. More...

    Header: #include <SharedTemplate.h>
    Since: Esri::ArcGISRuntime 300.0
    Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable

    Public Functions

    virtual ~SharedTemplate() override
    QVariantMap constructionToolOptions(Esri::ArcGISRuntime::GeometryConstructionTool *tool) const
    QFuture<QImage> createSwatchAsync(qint64 layerId)
    Esri::ArcGISRuntime::GeometryConstructionTool *defaultConstructionTool(qint64 layerId) const
    Esri::ArcGISRuntime::TemplateDefinition *definition() const
    QString description() const
    QList<Esri::ArcGISRuntime::Field> fields(qint64 layerId) const
    bool isToolApplicable(Esri::ArcGISRuntime::GeometryConstructionToolType toolType, qint64 layerId) const
    bool isVisible() const
    QList<qint64> layerIds() const
    QString name() const
    QStringList tags() const
    qint64 templateId() const
    Esri::ArcGISRuntime::SharedTemplateSource *templateSource() const
    Esri::ArcGISRuntime::SharedTemplateType type() const

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual void retryLoad() override

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    Specifies default attributes, symbology, tools, and settings for geometry construction and transformation.

    Member Function Documentation

    [override virtual noexcept] SharedTemplate::~SharedTemplate()

    Destructor.

    [override virtual] void SharedTemplate::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    Cancels loading the metadata if the object is loading and always calls doneLoading.

    QVariantMap SharedTemplate::constructionToolOptions(Esri::ArcGISRuntime::GeometryConstructionTool *tool) const

    Returns the configuration setting for the specified geometry construction tool.

    • tool - The geometry construction tool.

    Use this method to get options for a selected tool. For example, GeometryConstructionToolType::Line can generate a densified line by adding extra vertices at regular intervals. The optional settings specify whether to densify, the sample distance, and the linear unit to use.

    See Point construction tools, and Polyline and polygon construction tools for more information.

    An empty dictionary is expected when no available options are found for the specified tool.

    See Internal data structures with case-insensitive string keys for further details.

    QFuture<QImage> SharedTemplate::createSwatchAsync(qint64 layerId)

    Creates a swatch image with the template's thumbnail or symbology from the specified layer.

    • layerId - An ID that identifies the layer for which a swatch image is requested.

    In the absence of a thumbnail for this template, the symbology from the specified layer is used to determine a swatch image, provided this layer is loaded and is one of the layerIds.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    Esri::ArcGISRuntime::GeometryConstructionTool *SharedTemplate::defaultConstructionTool(qint64 layerId) const

    Returns the template's construction tool or a determined default.

    • layerId - An ID that identifies the layer for which a default construction tool is requested.

    In the absence of a default construction tool for this template, the geometry type of the specified layer is used to determine a default construction tool, provided this layer is loaded and is one of the layerIds. A nullptr value is expected when:

    • the template is used to create a non-spatial related record
    • the default construction tool is nullptr, and the layer's geometry type is unknown

    Esri::ArcGISRuntime::TemplateDefinition *SharedTemplate::definition() const

    Defines and returns how the primary, related, part, or preset features are created.

    This definition is nullptr until the shared template is loaded.

    QString SharedTemplate::description() const

    Returns additional information about this template.

    [signal] void SharedTemplate::doneLoading(const Esri::ArcGISRuntime::Error &loadError)

    Signal emitted when this object is done loading.

    • loadError - Details about any error that may have occurred.

    Note: If there is a load error it will also be emitted on the errorOccurred signal.

    See also Loadable and Object.

    QList<Esri::ArcGISRuntime::Field> SharedTemplate::fields(qint64 layerId) const

    Returns the collection of Field objects for features created with this template.

    • layerId - An ID that identifies the layer for which the fields are requested.

    Use this to determine how to display or convert attribute values into the proper data type and whether they are required by the template.

    The fields returned are from the specified layer's definition, provided this layer is loaded and is one of the SharedTemplateQueryParameters::layerIds. They may also be from field overrides from the layer's subtype matching this template's subtype if available.

    bool SharedTemplate::isToolApplicable(Esri::ArcGISRuntime::GeometryConstructionToolType toolType, qint64 layerId) const

    Determines and returns true whether the specified construction tool is applicable for the specified layer.

    • toolType - The type of geometry construction tool to check for applicability.
    • layerId - An ID that identifies the layer for which the construction tool is being evaluated.

    A construction tool is not applicable when it appears in the template's list of excluded tools, which is available only after the template has loaded.

    A construction tool may also be deemed not applicable based on the geometry type of the specified layer, provided this layer is loaded and is one of the layerIds.

    bool SharedTemplate::isVisible() const

    Returns true if this template can be shown in a template picker, false otherwise.

    A template that can be used to create standalone or primary features can be shown in a template picker and is marked visible. Conversely, a template that cannot independently create features should not be displayed in a template picker and is marked as not visible.

    QList<qint64> SharedTemplate::layerIds() const

    Returns a collection of IDs that identify the layers where this template can be used.

    This can be used to query the database for these layers. A given layer helps determine available fields, symbology, default and applicable tools, default values, and relationships.

    [override virtual] void SharedTemplate::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded and always calls doneLoading.

    [override virtual] Esri::ArcGISRuntime::Error SharedTemplate::loadError() const

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See also Error.

    [override virtual] Esri::ArcGISRuntime::LoadStatus SharedTemplate::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See also LoadStatus.

    [signal] void SharedTemplate::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Signal emitted when the loadStatus property changes.

    See also Loadable.

    QString SharedTemplate::name() const

    Returns the name assigned to this template.

    [override virtual] void SharedTemplate::retryLoad()

    Reimplements: Loadable::retryLoad().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.

    QStringList SharedTemplate::tags() const

    Returns the collection of tags for organizing and searching this template.

    This can be used to query the database for specific tags.

    qint64 SharedTemplate::templateId() const

    Returns a system-generated unique identifier.

    This can be used to query the database for specific templates. The value is -1 for templates returned from SharedTemplateQuerySourceType::Layer source.

    Esri::ArcGISRuntime::SharedTemplateSource *SharedTemplate::templateSource() const

    Returns the SharedTemplateSource from which this template was queried.

    Use this to get table instances for the applicable layers, and to create and add the features from this template.

    Esri::ArcGISRuntime::SharedTemplateType SharedTemplate::type() const

    Returns the type of the shared template.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.