summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor/qextfileinfo.h
blob: 86dd2923d9dfcca781a56f7767f523640f832a14 (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
65
66
67
68
69
70
71
72
73
74
75
76
/*
    From WebMaker - KDE HTML Editor
    Copyright (C) 1998, 1999 Alexei Dets <dets@services.ru>
    Rewritten for Quanta Plus: (C) 2002 Andras Mantia <amantia@freemail.hu>

    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 _TQEXTFILEINFO_H_
#define _TQEXTFILEINFO_H_

#include <tdeio/global.h>
#include <tdeio/job.h>
#include <kurl.h>
#include <tdefileitem.h>

#include <tqobject.h>
#include <tqptrlist.h>
#include <tqregexp.h>

class QExtFileInfo:public TQObject
{
 Q_OBJECT
  
public:
  QExtFileInfo() {};
  ~QExtFileInfo() {};

  /** create to ralative short name */
  static KURL toRelative(const KURL& urlToConvert,const KURL& baseURL);
  /** convert relative filename to absolute */
  static KURL toAbsolute(const KURL& urlToConvert,const KURL& baseURL);
  /** recurse function for all files in dir */
  static KURL::List allFiles( const KURL& path, const TQString &mask);
  static KURL::List allFilesRelative( const KURL& path, const TQString &mask);
  /** create dir if don't exists */
  static bool createDir(const KURL & path );
  static KURL cdUp(const KURL &dir);
  static TQString shortName(const TQString &fname );
  static KURL path(const KURL &);
  static KURL home();
  static bool exists(const KURL& url);
  static bool copy( const KURL& src, const KURL& dest, int permissions=-1,
                    bool overwrite=false, bool resume=false, TQWidget* window = 0L );

  void enter_loop();

private:
  bool internalExists(const KURL& url);
  bool internalCopy(const KURL& src, const KURL& target, int permissions,
                    bool overwrite, bool resume, TQWidget* window);

  bool bJobOK;
  static TQString lastErrorMsg;
  TDEIO::UDSEntry m_entry;
  KURL::List dirListItems;
  TQPtrList<TQRegExp> lstFilters;

  /** No descriptions */
  KURL::List allFilesInternal(const KURL& startURL, const TQString& mask);

//  friend class I_like_this_class;

private slots:
   void slotResult( TDEIO::Job * job );
   void slotNewEntries(TDEIO::Job *job, const TDEIO::UDSEntryList& udsList);
public slots: // Public slots
  /** Timeout occured while waiting for some network function to return. */
  void slotTimeout();
};


#endif