~ubuntu-filemanager-dev/ubuntu-filemanager-app/trunk

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/smb/qsambaclient/src/smblocationitemfile.h

  • Committer: Bileto Bot
  • Date: 2017-04-04 17:06:41 UTC
  • mfrom: (588.1.19 fix-desktop-file)
  • Revision ID: ci-train-bot@canonical.com-20170404170641-1p15lmx8wodlx2ut
* Rename binary file to ubuntu-filemanager-app
* Join plugin packages into the main package 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************
2
 
 *
3
 
 * Copyright 2015 Canonical Ltd.
4
 
 * Copyright 2015 Carlos J Mazieri <carlos.mazieri@gmail.com>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU Lesser General Public License as published by
8
 
 * the Free Software Foundation; version 3.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU Lesser General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Lesser General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 *
18
 
 * File: smblocationitemfile.h
19
 
 * Date: 20/04/2015
20
 
 */
21
 
 
22
 
#ifndef SMBLOCATIONITEMFILE_H
23
 
#define SMBLOCATIONITEMFILE_H
24
 
 
25
 
#include "locationitemfile.h"
26
 
#include "smbobject.h"
27
 
#include "smbutil.h"
28
 
 
29
 
class SmbItemInfo;
30
 
 
31
 
 
32
 
/*!
33
 
 * \brief The SmbLocationItemFile class is similar to Qt QFile
34
 
 *
35
 
 */
36
 
class SmbLocationItemFile : public LocationItemFile, public SmbObject
37
 
{
38
 
    Q_OBJECT
39
 
public:
40
 
    explicit SmbLocationItemFile(QObject *parent = 0,  Const_SmbUtil_Ptr  smb  = 0);
41
 
    explicit SmbLocationItemFile(const QString& name, QObject *parent = 0,  Const_SmbUtil_Ptr  smb  = 0);
42
 
    ~SmbLocationItemFile();
43
 
public:
44
 
   virtual QString fileName() const;
45
 
   virtual bool   rename(const QString& newName);
46
 
   virtual bool   rename(const QString& oldname, const QString& newName);
47
 
   virtual bool   remove();
48
 
   virtual bool   remove(const QString& name);
49
 
   virtual bool   link(const QString& linkName);
50
 
   virtual bool   open(QFile::OpenMode mode) ;
51
 
   virtual qint64 read(char*, qint64);
52
 
   virtual qint64 write(const char *, qint64);
53
 
   virtual void   close();
54
 
   virtual bool   atEnd() const;
55
 
   virtual qint64 size() const;
56
 
   virtual bool   isOpen() const;
57
 
   virtual bool   setPermissions(const QString& filename, QFile::Permissions perm);
58
 
   virtual bool   setPermissions(QFile::Permissions perm);
59
 
   virtual QFile::Permissions permissions() const;
60
 
private: 
61
 
   bool           private_remove(const QString& smb_path);
62
 
   void           createContext();             // destroys the context if exists
63
 
   void           createContextIfNotExists();  // creates only if there is no context
64
 
private:  
65
 
   Smb::FileHandler     m_fd;
66
 
   Smb::Context         m_context;
67
 
   qint64               m_curReadPosition;
68
 
   QFile::OpenMode      m_openMode;
69
 
};
70
 
 
71
 
#endif // SMBLOCATIONITEMFILE_H