File: mainpage.qdoc

package info (click to toggle)
content-hub 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,856 kB
  • sloc: cpp: 7,324; xml: 307; sh: 69; makefile: 35; ansic: 19
file content (146 lines) | stat: -rw-r--r-- 4,641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*!
\page index.html overview
\title Lomiri Content API

\contentspage {Lomiri Content API} {Contents}

\part Content Management & Exchange

\chapter Introduction

Unity and the overall Lomiri experience put heavy emphasis on the
notion of content, with Unity's dash offering streamlined access to
arbitrary content, both local to the device or online. More to this,
Unity's dash is the primary way of surfacing content on mobile form
factors without the need to access individual applications and their
respective content silos. The content-hub deals with
application-specific content management and implements an architecture
that allows an app to define its own content silo, exchange content
with other applications/the system, and a way to provide the user with
content picking functionality.

\section1 Definitions
To ease conversations, we start over with a set of definitions:

\list
  \li \b {Content item}: A content item is an entity that consists of meta-data
and data. E.g., an image is a content item, where the actual pixels
are the data, and information like size, image format, bit depth,
location etc. is considered meta data. See also \l ContentItem.

  \li \b {Content types}: A set of well-known content types. E.g., images or
   music files. See also \l {ContentType}

  \li \b {Content set}: A set of unique content items. Can be considered a
   content item itself, e.g., in the case of playlists.

  \li \b {Content owner}: The unique owner of a content item. A content item
   has to be owned by exactly one app. See also \l {ContentPeer}

  \li \b {Content store}: A container (think of it as a top-level folder in
   the filesystem) that contains content items of a certain
   type. Different stores exist for different scopes, where scope
   refers to either system-wide, user-wide or app-specific storage
   locations. See also \l {ContentStore}

  \li \b {Content transfer}: Transferring content item/s to and from a source
   or destination. A transfer is uniquely defined by a source, destination,
   direction (import or export), and a set of items that should be exchanged.
   See also \l {ContentTransfer}

  \li \b {Content picking}: Operation that allows a user to select content for
   subsequent import from a content source (e.g., an application). The
   content source is responsible for providing a UI to the user.
\endlist

\section1 Architectural Overview

The architecture enforces complete application isolation, both in
terms of content separation, sandboxing/confinement and in terms of
the application lifecycle. As we cannot assume that two apps that want
to exchange content are running at the same time, a system-level
component needs to mediate and control the content exchange operation,
making sure that neither app instance assumes the existence of the
other one. We refer to this component as the content hub. \sa {ContentHub}

\section1 Example usage - Importing Pictures

\qml
import QtQuick 2.0
import Lomiri.Components 1.1
import Lomiri.Content 1.1

Rectangle {
  id: root
  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: {
              root.activeTransfer = picSourceSingle.request()
          }
      }

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

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

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

\part General Topics
\list
    \li \l {ContentHub}
    \li \l {ContentPeer}
    \li \l {ContentPeerModel}
    \li \l {ContentPeerPicker}
    \li \l {ContentStore}
    \li \l {ContentTransfer}
    \li \l {ContentTransferHint}
    \li \l {ContentType}
\endlist

\part Reporting Bugs
If you find any problems with the or this documentation,
please file a bug in Lomiri Content API \l {https://bugs.launchpad.net/content-hub} {Launchpad page}

\part Components
Available through:
\code
    import Lomiri.Content 1.1
\endcode

*/