Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPlaceContent Class Reference

\inmodule QtLocation More...

#include <qplacecontent.h>

+ Collaboration diagram for QPlaceContent:

Public Types

enum  Type {
  NoType = 0 , ImageType , ReviewType , EditorialType ,
  CustomType = 0x0100
}
 Defines the type of content. More...
 
enum  DataTag {
  ContentSupplier , ContentUser , ContentAttribution , ImageId ,
  ImageUrl , ImageMimeType , EditorialTitle , EditorialText ,
  EditorialLanguage , ReviewId , ReviewDateTime , ReviewTitle ,
  ReviewText , ReviewLanguage , ReviewRating , CustomDataTag = 1000
}
 Defines the value entry of the content object. More...
 
typedef QMap< int, QPlaceContentCollection
 Synonym for QMap<int, QPlaceContent>.
 

Public Member Functions

 QPlaceContent (Type type=NoType)
 Constructs an content object for type.
 
 ~QPlaceContent ()
 Destroys the content object.
 
 QPlaceContent (const QPlaceContent &other) noexcept
 Constructs a new copy of other.
 
QPlaceContentoperator= (const QPlaceContent &other) noexcept
 Assigns the other content object to this and returns a reference to this content object.
 
 QPlaceContent (QPlaceContent &&other) noexcept=default
 
void swap (QPlaceContent &other) noexcept
 
void detach ()
 
bool operator== (const QPlaceContent &other) const
 Returns true if this content object is equivalent to other, otherwise returns false.
 
bool operator!= (const QPlaceContent &other) const
 Returns true if this content object is not equivalent to other, otherwise returns false.
 
QPlaceContent::Type type () const
 Returns the content type.
 
QList< DataTagdataTags () const
 Returns the list of data tags for which values are stored in this content objects.
 
QVariant value (DataTag tag) const
 Returns the value stored for the data tag, or an invalid QVariant if there is no data for that tag.
 
void setValue (DataTag tag, const QVariant &)
 Sets the value stored for the data tag to value.
 

Protected Member Functions

QPlaceContentPrivated_func ()
 
const QPlaceContentPrivated_func () const
 

Friends

class QPlaceContentPrivate
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlaceContent class holds content about places.

A QPlaceContent holds rich content such as images, reviews, or editorials, as well as attributes about the content such as the user or supplier of the content. Content objects might hold multiple data, e.g. an item holding a review typically includes the user that wrote the review. Use type() to inspect the type of content a QPlaceContent object represents, and dataTags() to see which data is held. Use value() to get the individual data as a QVariant.

{Note:} Some providers may {require} that the attribution string be displayed to the user whenever a piece of content is viewed.

The rich content of a place is typically made available as paginated items.

At present the QPlaceContent class is not extensible by 3rd parties.

Note: The Places API considers content objects to be 'retrieve-only' objects. Submission of content to a provider is not a supported use case.

Definition at line 21 of file qplacecontent.h.

Member Typedef Documentation

◆ Collection

Synonym for QMap<int, QPlaceContent>.

The key of the map is an int representing the index of the content. The value is the content object itself.

The {Collection} is intended to be a container where content items, that have been retrieved as pages, can be stored. This enables a developer to skip pages, for example indexes 0-9 may be stored in the collection, if the user skips to indexes 80-99, these can be stored in the collection as well.

Definition at line 24 of file qplacecontent.h.

Member Enumeration Documentation

◆ DataTag

Defines the value entry of the content object.

\value ContentSupplier The supplier who contributed this content \value ContentUser The user who contributed this content \value ContentAttribution Returns a rich text attribution string

Note
Some providers may require that the attribution of a particular content item always be displayed when the content item is shown. \value ImageId The image's identifier \value ImageUrl The image's url \value ImageMimeType The image's MIME type \value EditorialTitle The title of the editorial \value EditorialText A textual description of the place. Depending upon the provider, the text could be either rich (HTML based) text or plain text. \value EditorialLanguage The language of the editorial. Typically this would be a language code in the 2 letter ISO 639-1 format. \value ReviewId The identifier of the review \value ReviewDateTime The date and time that the review was submitted \value ReviewTitle The title of the review \value ReviewText The text of the review. Depending on the provider, the text could be rich (HTML based) or plain text. \value ReviewLanguage The language of the review. Typically this would be a language code in the 2 letter ISO 639-1 format. \value ReviewRating This review's rating of the place \value CustomDataTag
Enumerator
ContentSupplier 
ContentUser 
ContentAttribution 
ImageId 
ImageUrl 
ImageMimeType 
EditorialTitle 
EditorialText 
EditorialLanguage 
ReviewId 
ReviewDateTime 
ReviewTitle 
ReviewText 
ReviewLanguage 
ReviewRating 
CustomDataTag 

Definition at line 34 of file qplacecontent.h.

◆ Type

Defines the type of content.

\value NoType The content object is default constructed, any other content type may be assigned to this content object \value ImageType The content object is an image \value ReviewType The content object is a review \value EditorialType The content object is an editorial \value CustomType The content object is of a custom type

Enumerator
NoType 
ImageType 
ReviewType 
EditorialType 
CustomType 

Definition at line 26 of file qplacecontent.h.

Constructor & Destructor Documentation

◆ QPlaceContent() [1/3]

QPlaceContent::QPlaceContent ( Type type = NoType)

Constructs an content object for type.

Definition at line 128 of file qplacecontent.cpp.

◆ ~QPlaceContent()

QPlaceContent::~QPlaceContent ( )
default

Destroys the content object.

◆ QPlaceContent() [2/3]

QPlaceContent::QPlaceContent ( const QPlaceContent & other)
defaultnoexcept

Constructs a new copy of other.

◆ QPlaceContent() [3/3]

QPlaceContent::QPlaceContent ( QPlaceContent && other)
defaultnoexcept

Member Function Documentation

◆ d_func() [1/2]

QT_USE_NAMESPACE QPlaceContentPrivate * QPlaceContent::d_func ( )
inlineprotected

Definition at line 9 of file qplacecontent.cpp.

References QExplicitlySharedDataPointer< T >::data().

+ Here is the call graph for this function:

◆ d_func() [2/2]

const QPlaceContentPrivate * QPlaceContent::d_func ( ) const
inlineprotected

Definition at line 14 of file qplacecontent.cpp.

References QExplicitlySharedDataPointer< T >::constData().

+ Here is the call graph for this function:

◆ dataTags()

QList< QPlaceContent::DataTag > QPlaceContent::dataTags ( ) const

Returns the list of data tags for which values are stored in this content objects.

Definition at line 195 of file qplacecontent.cpp.

References d.

◆ detach()

void QPlaceContent::detach ( )

Definition at line 151 of file qplacecontent.cpp.

References QExplicitlySharedDataPointer< T >::detach().

Referenced by setValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=()

bool QPlaceContent::operator!= ( const QPlaceContent & other) const

Returns true if this content object is not equivalent to other, otherwise returns false.

Definition at line 186 of file qplacecontent.cpp.

References other().

+ Here is the call graph for this function:

◆ operator=()

QPlaceContent & QPlaceContent::operator= ( const QPlaceContent & other)
defaultnoexcept

Assigns the other content object to this and returns a reference to this content object.

◆ operator==()

bool QPlaceContent::operator== ( const QPlaceContent & other) const

Returns true if this content object is equivalent to other, otherwise returns false.

Definition at line 170 of file qplacecontent.cpp.

References QPlaceContentPrivate::compare(), other(), and type().

+ Here is the call graph for this function:

◆ setValue()

void QPlaceContent::setValue ( QPlaceContent::DataTag tag,
const QVariant & value )

Sets the value stored for the data tag to value.

Definition at line 214 of file qplacecontent.cpp.

References d, detach(), and tag.

+ Here is the call graph for this function:

◆ swap()

void QPlaceContent::swap ( QPlaceContent & other)
inlinenoexcept

Definition at line 61 of file qplacecontent.h.

References other().

+ Here is the call graph for this function:

◆ type()

QPlaceContent::Type QPlaceContent::type ( ) const

Returns the content type.

Definition at line 159 of file qplacecontent.cpp.

References NoType, and QPlaceContentPrivate::type().

Referenced by QDeclarativePlaceContentModel::data(), QDeclarativePlaceContentModel::initializeCollection(), and operator==().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ value()

QVariant QPlaceContent::value ( QPlaceContent::DataTag tag) const

Returns the value stored for the data tag, or an invalid QVariant if there is no data for that tag.

Definition at line 205 of file qplacecontent.cpp.

References d, and tag.

Referenced by QDeclarativePlaceContentModel::data(), and QDeclarativePlaceContentModel::initializeCollection().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QPlaceContentPrivate

friend class QPlaceContentPrivate
friend

Definition at line 97 of file qplacecontent.h.


The documentation for this class was generated from the following files: