KGAPI2::Drive::File

#include <file.h>

Inheritance diagram for KGAPI2::Drive::File:

Classes

class  ImageMediaMetadata
 
class  IndexableText
 
class  Labels
 

Public Types

using ImageMediaMetadataPtr = QSharedPointer< ImageMediaMetadata >
 
using IndexableTextPtr = QSharedPointer< IndexableText >
 
using LabelsList = QList< LabelsPtr >
 
using LabelsPtr = QSharedPointer< Labels >
 
enum  SerializationOption { NoOptions = 0, ExcludeCreationDate = 1 }
 
typedef QFlags< SerializationOptionSerializationOptions
 
using ThumbnailPtr = QSharedPointer< Thumbnail >
 

Public Member Functions

 File (const File &other)
 
QUrl alternateLink () const
 
QDateTime createdDate () const
 
QString description () const
 
QUrl downloadUrl () const
 
bool editable () const
 
QUrl embedLink () const
 
bool explicitlyTrashed () const
 
QMap< QString, QUrlexportLinks () const
 
QString fileExtension () const
 
qlonglong fileSize () const
 
QUrl iconLink () const
 
QString id () const
 
File::ImageMediaMetadataPtr imageMediaMetadata () const
 
File::IndexableTextPtrindexableText ()
 
bool isFolder () const
 
File::LabelsPtr labels () const
 
UserPtr lastModifyingUser () const
 
QString lastModifyingUserName () const
 
QDateTime lastViewedByMeDate () const
 
QString md5Checksum () const
 
QString mimeType () const
 
QDateTime modifiedByMeDate () const
 
QDateTime modifiedDate () const
 
bool operator!= (const File &other) const
 
bool operator== (const File &other) const
 
QString originalFileName () const
 
QStringList ownerNames () const
 
UsersList owners () const
 
ParentReferencesList parents () const
 
qlonglong quotaBytesUsed () const
 
QUrl selfLink () const
 
void setDescription (const QString &description)
 
void setLabels (const LabelsPtr &labels)
 
void setLastViewedByMeDate (const QDateTime &lastViewedByMeDate)
 
void setMimeType (const QString &mimeType)
 
void setModifiedDate (const QDateTime &modifiedDate)
 
void setParents (const ParentReferencesList &parents)
 
void setTitle (const QString &title)
 
bool shared () const
 
QDateTime sharedWithMeDate () const
 
ThumbnailPtr thumbnail () const
 
QUrl thumbnailLink () const
 
QString title () const
 
PermissionPtr userPermission () const
 
qlonglong version () const
 
QUrl webContentLink () const
 
QUrl webViewLink () const
 
bool writersCanShare () const
 
- Public Member Functions inherited from KGAPI2::Object
 Object ()
 
 Object (const Object &other)
 
virtual ~Object ()
 
QString etag () const
 
bool operator== (const Object &other) const
 
void setEtag (const QString &etag)
 

Static Public Member Functions

static QString folderMimeType ()
 
static FilePtr fromJSON (const QByteArray &jsonData)
 
static FilePtr fromJSON (const QVariantMap &jsonData)
 
static FilesList fromJSONFeed (const QByteArray &jsonData, FeedData &feedData)
 
static QByteArray toJSON (const FilePtr &file, SerializationOptions options=NoOptions)
 

Detailed Description

File contains metadata for a file.

Getters and setters' documentation is based on Google Drive's API v2 reference

See also
Files
Since
2.0
Author
Andrius da Costa Ribas andri[email protected]usma[email protected][email protected][email protected]il.c[email protected]om
Daniel Vrátil dvrat[email protected][email protected][email protected]edhat[email protected].com

Definition at line 37 of file file.h.

Member Enumeration Documentation

JSON serialization options.

Since
5.3.1
Enumerator
NoOptions 

No option set.

ExcludeCreationDate 

Exclude 'createdDate' entry. This is necessary when renaming URLs.

Definition at line 306 of file file.h.

Member Function Documentation

QUrl KGAPI2::Drive::File::alternateLink ( ) const

Returns a link for opening the file in using a relevant Google editor or viewer.

QDateTime KGAPI2::Drive::File::createdDate ( ) const

Returns the create time for this file.

QString KGAPI2::Drive::File::description ( ) const

Returns a short description of the file.

QUrl KGAPI2::Drive::File::downloadUrl ( ) const

Returns a short lived download URL for the file.

This is only populated for files with content stored in Drive.

bool KGAPI2::Drive::File::editable ( ) const

Returns whether the file can be edited by the current user.

QUrl KGAPI2::Drive::File::embedLink ( ) const

Returns a link for embedding the file.

bool KGAPI2::Drive::File::explicitlyTrashed ( ) const

Returns whether this file has been explicitly trashed, as opposed to recursively trashed.

This will only be populated if the file is trashed.

QMap< QString , QUrl > KGAPI2::Drive::File::exportLinks ( ) const

Returns the links for exporting Google Docs to specific formats.

This is a map from the export format to URL.

QString KGAPI2::Drive::File::fileExtension ( ) const

Returns the file extension used when downloading this file.

This field is read only. To set the extension, include it on title when creating the file. This is populated only for files with content stored in Drive.

qlonglong KGAPI2::Drive::File::fileSize ( ) const

Returns the size of the file in bytes.

This is populated only for files with content stored in Drive.

static QString KGAPI2::Drive::File::folderMimeType ( )
static

Returns mimetype of folders.

QString KGAPI2::Drive::File::id ( ) const

Returns the id of the file.

File::ImageMediaMetadataPtr KGAPI2::Drive::File::imageMediaMetadata ( ) const

Returns metadata about image media.

This will only be present for image types, and its contents will depend on what can be parsed from the image content.

File::IndexableTextPtr& KGAPI2::Drive::File::indexableText ( )

Returns the indexable text attributes for the file.

This property can only be written, and is not returned by files.get

File::LabelsPtr KGAPI2::Drive::File::labels ( ) const

Returns a group of labels for the file.

QString KGAPI2::Drive::File::lastModifyingUserName ( ) const

Returns the name of the last user to modify this file.

This will only be populated if a user has edited this file.

QDateTime KGAPI2::Drive::File::lastViewedByMeDate ( ) const

Returns the last time this file was viewed by the user.

QString KGAPI2::Drive::File::md5Checksum ( ) const

Returns an MD5 checksum for the content of this file.

This is populated only for files with content stored in Drive.

QString KGAPI2::Drive::File::mimeType ( ) const

Returns the MIME type of the file.

QDateTime KGAPI2::Drive::File::modifiedByMeDate ( ) const

Returns the last time this file was modified by the currently authenticated user.

QDateTime KGAPI2::Drive::File::modifiedDate ( ) const

Returns the last time this file was modified by anyone.

This is only mutable on update when the setModifiedDate parameter is set.

QString KGAPI2::Drive::File::originalFileName ( ) const

Returns the original filename if the file was uploaded manually, or the original title if the file was inserted through the API.

Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.

QStringList KGAPI2::Drive::File::ownerNames ( ) const

Return the name(s) of the owner(s) of this file.

ParentReferencesList KGAPI2::Drive::File::parents ( ) const

Returns the collection of parent folders which contain this file.

Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.

qlonglong KGAPI2::Drive::File::quotaBytesUsed ( ) const

Returns the number of quota bytes used by this file.

QUrl KGAPI2::Drive::File::selfLink ( ) const

Returns a link back to this file.

void KGAPI2::Drive::File::setDescription ( const QString description)

Sets a short description of the file.

Parameters
description
void KGAPI2::Drive::File::setLabels ( const LabelsPtr labels)

Sets a group of labels for the file.

Parameters
labels
void KGAPI2::Drive::File::setLastViewedByMeDate ( const QDateTime lastViewedByMeDate)

Sets the last time this file was viewed by the user.

Parameters
lastViewedByMeDate
void KGAPI2::Drive::File::setMimeType ( const QString mimeType)

Sets the MIME type of the file.

Parameters
mimeType
void KGAPI2::Drive::File::setModifiedDate ( const QDateTime modifiedDate)

Sets the last time this file was modified by anyone.

This is only mutable on update when the setModifiedDate parameter is set.

Parameters
modifiedDate
void KGAPI2::Drive::File::setParents ( const ParentReferencesList parents)

Sets the collection of parent folders which contain this file.

Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.

Parameters
parents
void KGAPI2::Drive::File::setTitle ( const QString title)

Sets the title of this file.

Used to identify file or folder name.

Parameters
title
QDateTime KGAPI2::Drive::File::sharedWithMeDate ( ) const

Returns the time at which this file was shared with the user.

ThumbnailPtr KGAPI2::Drive::File::thumbnail ( ) const

Returns thumbnail for the file.

QUrl KGAPI2::Drive::File::thumbnailLink ( ) const

Returns a link to the file's thumbnail.

QString KGAPI2::Drive::File::title ( ) const

Returns the title of this file.

Used to identify file or folder name.

PermissionPtr KGAPI2::Drive::File::userPermission ( ) const

Returns the permissions for the authenticated user on this file.

qlonglong KGAPI2::Drive::File::version ( ) const

Returns the version of the file;.

QUrl KGAPI2::Drive::File::webContentLink ( ) const

Returns a link for downloading the content of the file in a browser using cookie based authentication.

In cases where the content is shared publicly, the content can be downloaded without any credentials.

bool KGAPI2::Drive::File::writersCanShare ( ) const

Returns whether writers can share the document with other users.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:11:42 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.