summaryrefslogtreecommitdiffstats
path: root/ksysv/IOCore.h
blob: 37ac4e5e89884619097df419b9c28baf92a99cd7 (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
/***************************************************************************
                          ksv::IO.h  -  description
                             -------------------
    begin                : Sun Oct 3 1999
    copyright            : (C) 1997-99 by Peter Putzer
    email                : putzer@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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; version 2.                              *
 *                                                                         *
 ***************************************************************************/

#ifndef KSV_IOCORE_H
#define KSV_IOCORE_H

#include <qdir.h>
#include <qstring.h>

#include <ktrader.h>
#include <kservice.h>

template<class T> class QValueList;
class QFileInfo;
class QDataStream;

class KSVDragList;
class KSVData;

namespace ksv
{
  namespace IO
  {
    void removeFile (const QFileInfo& info, QDir& dir,
                     QString& rich, QString& plain);

    QString relToAbs (const QString& dir, const QString& rel);

    void makeSymlink (const KSVData& data, int runlevel, bool start,
                      QString& rich, QString& plain);

    void dissectFilename (const QString& file, QString& name, int& nr);

    QString makeRelativePath (const QString& from, const QString& to);

    bool saveConfiguration (QDataStream&,
                            KSVDragList** start,
                            KSVDragList** stop);

    bool loadSavedConfiguration (QDataStream&,
                                 QValueList<KSVData>* start,
                                 QValueList<KSVData>* stop);

    KTrader::OfferList servicesForFile (const QString& filename);
    KService::Ptr preferredServiceForFile (const QString& filename);

  } // namespace IO
} // namespace ksv

#endif