Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

Sailfish Share

API Documentation
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Detailed Description

ShareResource QML Type

Import Statement: import Sailfish.Share 1.0
  • List of all members, including inherited members

Properties

  • data : string
  • filePath : string
  • name : string
  • type : int

Detailed Description

Type for resources from ShareProvider::triggered. This type can not be created directly from QML.

Resources can have two different types: ShareResource.StringDataType and ShareResource.FilePathType. Depending on which type the resource is, different properties can be accessed. ShareResource::type can be always accessed.

Property Documentation

data : string

This is the content of the shared resource if resource's type is ShareResource.StringDataType.


filePath : string

This is a path to the shared file if resource's type is ShareResource.FilePathType.


name : string

This is the name of the shared resource if resource's type is ShareResource.StringDataType.


type : int

ShareResource's type. Either ShareResource.StringDataType or ShareResource.FilePathType.

You may alter your application's behaviour based on this value:

 function handleResource(resource) {
     if (resource.type === ShareResource.FilePathType) {
     handleSharedFilePath(resource.filePath)
     } else if (resource.type === ShareResource.StringDataType) {
         handleSharedData(resource.name, resource.data)
     } else {
         console.warn("Unknown resource type:", resource.type)
         showSharingError()
     }
 }

  • Legal
  • Contact Us
  • Jollyboys Ltd © 2024

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn