summaryrefslogtreecommitdiffstats
path: root/quanta/project/projecturl.h
blob: 67299d90e5b69794ab0dedb381959bdd104510d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/***********************************************************************
                          projecturl.h  -  ProjectURL class definition
                             -------------------
    begin                : Wed Feb 18 2004
    copyright            : (C) 2004 by Andrei Berezin <aberezin@comcast.net>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PROJECT_URL_H
#define PROJECT_URL_H

#include <qdom.h>
#include <qdict.h>
#include <qstring.h>

#include <kurl.h>


/**
 * Project item.
 * Consists of URL and description text.
 */
class ProjectURL : public KURL
{
public:
  QString fileDesc;
  int uploadStatus; ///< The upload state, see UploadStatus
  bool documentFolder;
  QDomElement domElement;

  ProjectURL()
    : KURL(), uploadStatus(1), documentFolder(false) {}
  
  ProjectURL(const KURL& url)
    : KURL(url), uploadStatus(1), documentFolder(false) {}
  
  ProjectURL(const KURL& url, const QString& desc, int status, bool docFolder)
    : KURL(url), fileDesc(desc), uploadStatus(status), documentFolder(docFolder) {}
  
  ProjectURL(const KURL& url, const QString& desc, int status, bool docFolder, QDomElement el)
    : KURL(url), fileDesc(desc), uploadStatus(status), documentFolder(docFolder), domElement(el) {}
  
  virtual ~ProjectURL() {}

  /** The default state for a file when uploading */
  enum UploadStatus
  {
     NeverUpload = 0, ///< the files is not selected for upload, even if it was modified
     AlwaysUpload, ///< the file is automatically selected for upload if it was modified
     ConfirmUpload ///<the file is selected for upload, but the user must confirm the upload
  };
};

typedef QDict<ProjectURL> ProjectUrlList;

#endif // PROJECT_URL_H