GCF LOGO VCL LOGO
GCF::IGDriveLiteContentSharingModel Class Referenceabstract

This interface provides access to permissions of a file/folder item

#include <GCF3/IGDriveLiteContentSharingModel>
. More...

Public Types

enum  Field {
  Kind = Qt::UserRole+1, ETag, PermissionId, Id = PermissionId,
  Name, EMailAddress, Domain, RoleType,
  RoleTypeStr, Title
}
 
enum  ShareRole {
  Owner = 1, Reader = 2, Writer = 4, Commenter = 8,
  Unknown = 0
}
 

Public Member Functions

 ~IGDriveLiteContentSharingModel ()
 
virtual QString contentItemId () const =0
 
virtual GCF::GDriveContent::Item contentItem () const =0
 
virtual Q_INVOKABLE QUrl shareLink () const =0
 
virtual void setColumns (const QList< int > &fields)=0
 
virtual QList< int > columns () const =0
 
virtual Q_INVOKABLE GCF::Result share (const GCF::GDriveLiteShareRequest &request)=0
 
virtual Q_INVOKABLE GCF::Result unshare (const QModelIndex &index)=0
 
virtual Q_INVOKABLE GCF::Result modifyShareRole (const QModelIndex &index, int role)=0
 
virtual Q_SIGNAL void modified ()=0
 
virtual Q_SIGNAL void error (const QString &msg)=0
 

Detailed Description

Using this interface you can add/remove/edit share permissions for a file or folder. Instances of this interface can be created using the GCF::IGDriveLite::createSharingModel() method. Once created the interface fetches current sharing permissions using Google Drive API. This interface implements QAbstractItemModel to provide a model-like access to permissions against the file identified by contentItemId(). You can visualize the sharing permissions in a list-view or also using QML!

sharing-model-qml.png

You can use the share(), unshare(), modifyShareRole() methods to edit share permissions.

Member Enumeration Documentation

The enumeration values of Field represents specific property of sharing information of an item.

This enumeration values are also used to construct columns and order of it using GCF::IGDriveLiteContentSharingModel::setColumns(const QList<int> &columns).

Enumerator
Kind 

kind of sharing information. [Role-name: "shareKind"]

ETag 

etag of sharing information. [Role-name: "shareETag"]

PermissionId 

permission ID of sharing information. [Role-name: "sharePermissionId"]

Id 

alias of GCF::IGDriveLiteContentSharingModel::PermissionId. [Role-name: "sharePermissionId"]

Name 

name of user in sharing information. [Role-name: "shareUserName"]

EMailAddress 

email id of user in sharing information. [Role-name: "shareEMailAddress"]

Domain 

domain present in sharing information. [Role-name: "shareDomain"]

RoleType 

role type of sharing information.

RoleTypeStr 

role type string of sharing information. [Role-name: "shareRoleType"]

Title 

title of sharing information. [Role-name: "shareTitle"]

The enumeration values of ShareRole represents types of roles in google drive.

Enumerator
Owner 

user role is Owner.

Reader 

user role is Reader.

Writer 

user role is Writer.

Commenter 

user role is Commenter.

Unknown 

user role is not known.

Constructor & Destructor Documentation

GCF::IGDriveLiteContentSharingModel::~IGDriveLiteContentSharingModel ( )

Destructor.

Member Function Documentation

GCF::IGDriveLiteContentSharingModel::contentItemId ( ) const
pure virtual

Returns id of the sharing model's item.

Returns
QString id of item
GCF::IGDriveLiteContentSharingModel::contentItem ( ) const
pure virtual

Returns sharing model's item.

Returns
GCF::GDriveContent::Item
GCF::IGDriveLiteContentSharingModel::shareLink ( ) const
pure virtual

Url which will should be used to share the current item.

GCF::IGDriveLiteContentSharingModel::setColumns ( const QList< int > &  fields)
pure virtual

Sets the columns of this according to 'fields' parameter. QList<Field> &fields is a list of enumeration values of GCF::IGDriveLiteContentSharingModel::Field. The columns are constructed based on the given enumeration values and the order of it.

Parameters
fieldslist of enumeration values of GCF::IGDriveLiteContentSharingModel::Field based upon which model's columns need to be constructed.
GCF::IGDriveLiteContentSharingModel::columns ( ) const
pure virtual

Returns the columns of content model. QList<int> will contain the values of GCF::IGDriveLiteContentSharingModel::Field the order in which the columns are set in the model.

Returns
QList<int> list of enumeration values of GCF::IGDriveLiteContentSharingModel::Field.
GCF::IGDriveLiteContentSharingModel::share ( const GCF::GDriveLiteShareRequest &  request)
pure virtual

Shares the item represented by share model. GCF::GDriveLiteShareRequest is a structure which contains the fields necessary for sharing the file.

Returns
GCF::Result which contains the success or failure information regarding whether sharing was successful or not.
GCF::IGDriveLiteContentSharingModel::unshare ( const QModelIndex &  index)
pure virtual

Unshares the item with user in sharing information at specified index.

Parameters
indexindex of permission.
Returns
GCF::Result which contains the success or failure information regarding whether unsharing was successful or not.
GCF::IGDriveLiteContentSharingModel::modifyShareRole ( const QModelIndex &  index,
int  role 
)
pure virtual

Modifies the current item permission for a user corresponding to sharing information at index.

Parameters
rolenew role of the user.
indexindex of permission.
Returns
GCF::Result which contains the success or failure information regarding whether the modifying sharing permission was successful or not.
GCF::IGDriveLiteContentSharingModel::modified ( )
pure virtual

This signal is emitted when the sharing information stored in the sharing model is modified.

GCF::IGDriveLiteContentSharingModel::error ( const QString &  msg)
pure virtual

This signal is emitted when some error occurs while fetching the sharing information.