# ContentHub QML Type

The central manager for all content operations. More...

Import Statement: | import Lomiri.Content 1.1

- List of all members, including inherited members

## Signals

- exportRequested(ContentTransfer transfer)
- importRequested(ContentTransfer transfer)
- shareRequested(ContentTransfer transfer)

## Detailed Description

Example usage for importing content:

    import QtQuick 2.0
    import Lomiri.Components 0.1
    import Lomiri.Content 0.1

    MainView {
        id: root
        width: units.gu(60)
        height: units.gu(90)
        property list<ContentItem> importItems
        property var activeTransfer

        ContentPeer {
            id: picSourceSingle
            contentType: ContentType.Pictures
            handler: ContentHandler.Source
            selectionType: ContentTransfer.Single
        }

        ContentPeer {
            id: picSourceMulti
            contentType: ContentType.Pictures
            handler: ContentHandler.Source
            selectionType: ContentTransfer.Multiple
        }

        Row {
            Button {
                text: "Import single item"
                onClicked: {
                    activeTransfer = picSourceSingle.request()
                }
            }

            Button {
                text: "Import multiple items"
                onClicked: {
                    activeTransfer = picSourceMulti.request()
                }
            }
        }

        ContentTransferHint {
            id: importHint
            anchors.fill: parent
            activeTransfer: root.activeTransfer
        }

        Connections {
            target: root.activeTransfer
            onStateChanged: {
                if (root.activeTransfer.state === ContentTransfer.Charged)
                    importItems = root.activeTransfer.items;
            }
        }
    }

Example usage for providing a content export:

    import QtQuick 2.0
    import Lomiri.Content 0.1

    Rectangle {
        property list<ContentItem> selectedItems
        Connections {
            target: ContentHub
            onExportRequested: {
                // show content picker
                transfer.items = selectedItems;
                transfer.state = ContentTransfer.Charged;
            }
        }
    }

## Signal Documentation

exportRequested(ContentTransfer transfer)

The signal is triggered when an export is requested.

Note: The corresponding handler is `onExportRequested`.

importRequested(ContentTransfer transfer)

The signal is triggered when an import is requested.

Note: The corresponding handler is `onImportRequested`.

shareRequested(ContentTransfer transfer)

The signal is triggered when a share is requested.

Note: The corresponding handler is `onShareRequested`.