KGAPI2::Drive::File

Search for usage in LXR

#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.nosp@m.usma.nosp@m.o@gma.nosp@m.il.c.nosp@m.om
Daniel Vrátil dvrat.nosp@m.il@r.nosp@m.edhat.nosp@m..com

Definition at line 36 of file file.h.

Member Typedef Documentation

◆ ImageMediaMetadataPtr

◆ IndexableTextPtr

◆ LabelsList

Definition at line 130 of file file.h.

◆ LabelsPtr

Definition at line 129 of file file.h.

◆ SerializationOptions

◆ ThumbnailPtr

Definition at line 314 of file file.h.

Member Enumeration Documentation

◆ SerializationOption

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 320 of file file.h.

Member Function Documentation

◆ alternateLink()

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

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

◆ createdDate()

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

Returns the create time for this file.

◆ description()

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

Returns a short description of the file.

◆ downloadUrl()

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

Returns a short lived download URL for the file.

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

◆ editable()

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

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

◆ embedLink()

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

Returns a link for embedding the file.

◆ explicitlyTrashed()

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

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

This will only be populated if the file is trashed.

◆ exportLinks()

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.

◆ fileExtension()

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

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.

◆ fileSize()

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

Returns the size of the file in bytes.

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

◆ folderMimeType()

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

Returns mimetype of folders.

◆ id()

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

Returns the id of the file.

◆ imageMediaMetadata()

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.

◆ indexableText()

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

◆ labels()

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

Returns a group of labels for the file.

◆ lastModifyingUserName()

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

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

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

◆ lastViewedByMeDate()

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

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

◆ md5Checksum()

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

Returns an MD5 checksum for the content of this file.

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

◆ mimeType()

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

Returns the MIME type of the file.

◆ modifiedByMeDate()

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

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

◆ modifiedDate()

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

Returns the last time this file was modified by anyone.

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

◆ operator!=()

bool KGAPI2::Drive::File::operator!= ( const File & other) const
inline

Definition at line 330 of file file.h.

◆ originalFileName()

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

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.

◆ ownerNames()

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

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

◆ parents()

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.

◆ quotaBytesUsed()

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

Returns the number of quota bytes used by this file.

◆ selfLink()

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

Returns a link back to this file.

◆ setDescription()

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

Sets a short description of the file.

Parameters
description

◆ setLabels()

void KGAPI2::Drive::File::setLabels ( const LabelsPtr & labels)

Sets a group of labels for the file.

Parameters
labels

◆ setLastViewedByMeDate()

void KGAPI2::Drive::File::setLastViewedByMeDate ( const QDateTime & lastViewedByMeDate)

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

Parameters
lastViewedByMeDate

◆ setMimeType()

void KGAPI2::Drive::File::setMimeType ( const QString & mimeType)

Sets the MIME type of the file.

Parameters
mimeType

◆ setModifiedDate()

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

◆ setParents()

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

◆ setTitle()

void KGAPI2::Drive::File::setTitle ( const QString & title)

Sets the title of this file.

Used to identify file or folder name.

Parameters
title

◆ sharedWithMeDate()

QDateTime KGAPI2::Drive::File::sharedWithMeDate ( ) const
nodiscard

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

◆ thumbnail()

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

Returns thumbnail for the file.

◆ thumbnailLink()

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

Returns a link to the file's thumbnail.

◆ title()

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

Returns the title of this file.

Used to identify file or folder name.

◆ userPermission()

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

Returns the permissions for the authenticated user on this file.

◆ version()

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

Returns the version of the file;.

◆ webContentLink()

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

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.

◆ writersCanShare()

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

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-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:57:07 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.