ZIMA CAD Parts
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
baseremotedatasource.h
Go to the documentation of this file.
1 /*
2  ZIMA-CAD-Parts
3  http://www.zima-construction.cz/software/ZIMA-Parts
4 
5  Copyright (C) 2011-2012 Jakub Skokan <aither@havefun.cz>
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef BASEREMOTEDATASOURCE_H
22 #define BASEREMOTEDATASOURCE_H
23 
24 #include "basedatasource.h"
25 
26 class Item;
27 struct File;
28 
30 {
31  Q_OBJECT
32 public:
33  virtual QString internalName() = 0;
34  virtual QIcon itemIcon(Item *item);
35  virtual QIcon dataSourceIcon();
36  static QString cacheDirPath();
37  QString pathToDataRoot();
38  QString getTechSpecPathForItem(Item *item);
39  QString getPathForItem(Item *item);
40  QString getRelativePathForItem(Item *item);
41  QString name();
42 
43  // FIXME: make protected
46 
47 public slots:
48  void sendTechSpecUrl(Item* item);
49  virtual void loadRootItem(Item *item) = 0;
50  virtual void loadDirectory(Item* item) = 0;
51  virtual void deleteFiles(QList<File*> files) = 0;
52  virtual void addFileToDownload(File *f) = 0;
53  virtual void downloadFiles(QList<File*> files, QString dir) = 0;
54  virtual void downloadFile(File* file) = 0;
55  virtual void abort() = 0;
56 protected:
57  void loadItemLogo(Item *item);
58  void checkAndSendTechSpecUrl(Item *item);
59 
63 
64 };
65 
66 #endif // BASEREMOTEDATASOURCE_H
virtual void loadRootItem(Item *item)=0
virtual void loadDirectory(Item *item)=0
virtual void deleteFiles(QList< File * > files)=0
QString getRelativePathForItem(Item *item)
Definition: baseremotedatasource.cpp:110
int remotePort
Definition: baseremotedatasource.h:45
QString getTechSpecPathForItem(Item *item)
Definition: baseremotedatasource.cpp:100
QString getPathForItem(Item *item)
Definition: baseremotedatasource.cpp:105
virtual QString internalName()=0
Definition: item.h:130
void sendTechSpecUrl(Item *item)
Definition: baseremotedatasource.cpp:41
Definition: baseremotedatasource.h:29
virtual void downloadFile(File *file)=0
Definition: basedatasource.h:50
virtual QIcon dataSourceIcon()
Definition: baseremotedatasource.cpp:36
Definition: item.h:41
bool techSpecFilesUpdated
Definition: baseremotedatasource.h:62
Item * techSpecItem
Definition: baseremotedatasource.h:60
static QString cacheDirPath()
Definition: baseremotedatasource.cpp:120
QString pathToDataRoot()
Definition: baseremotedatasource.cpp:125
void loadItemLogo(Item *item)
Definition: baseremotedatasource.cpp:87
virtual void abort()=0
bool techSpecUrlSent
Definition: baseremotedatasource.h:61
void checkAndSendTechSpecUrl(Item *item)
Definition: baseremotedatasource.cpp:49
QString remoteHost
Definition: baseremotedatasource.h:44
virtual void addFileToDownload(File *f)=0
QString remoteLogin
Definition: baseremotedatasource.h:44
virtual QIcon itemIcon(Item *item)
Definition: baseremotedatasource.cpp:29
QString remoteBaseDir
Definition: baseremotedatasource.h:44
QString name()
Definition: baseremotedatasource.cpp:115
virtual void downloadFiles(QList< File * > files, QString dir)=0
QString remotePassword
Definition: baseremotedatasource.h:44