~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kcontrol/kfontinst/kio/KioFonts.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __KIO_FONTS_H__
 
2
#define __KIO_FONTS_H__
 
3
 
 
4
/*
 
5
 * KFontInst - KDE Font Installer
 
6
 *
 
7
 * Copyright 2003-2007 Craig Drummond <craig@kde.org>
 
8
 *
 
9
 * ----
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 *
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
 * General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; see the file COPYING.  If not, write to
 
23
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
24
 * Boston, MA 02110-1301, USA.
 
25
 */
 
26
 
 
27
#include <KDE/KIO/SlaveBase>
 
28
#include <QtDBus/QtDBus>
 
29
#include <sys/types.h>
 
30
 
 
31
class KTempDir;
 
32
 
 
33
namespace KFI
 
34
{
 
35
 
 
36
class Family;
 
37
class Style;
 
38
class FontInstInterface;
 
39
 
 
40
class CKioFonts : public KIO::SlaveBase
 
41
{
 
42
    public:
 
43
 
 
44
    enum EFolder
 
45
    {
 
46
        FOLDER_USER,
 
47
        FOLDER_SYS,
 
48
        FOLDER_ROOT,
 
49
        FOLDER_UNKNOWN
 
50
    };
 
51
 
 
52
    CKioFonts(const QByteArray &pool, const QByteArray &app);
 
53
    virtual ~CKioFonts();
 
54
 
 
55
    void listDir(const KUrl &url);
 
56
    void put(const KUrl &url, int permissions, KIO::JobFlags flags);
 
57
    void get(const KUrl &url);
 
58
    void del(const KUrl &url, bool isFile);
 
59
    void copy(const KUrl &src, const KUrl &dest, int mode, KIO::JobFlags flags);
 
60
    void rename(const KUrl &src, const KUrl &dest, KIO::JobFlags flags);
 
61
    void stat(const KUrl &url);
 
62
    void special(const QByteArray &a);
 
63
 
 
64
    private:
 
65
 
 
66
    int     listFolder(KIO::UDSEntry &entry, EFolder folder);
 
67
    QString getUserName(uid_t uid);
 
68
    QString getGroupName(gid_t gid);
 
69
    bool    createStatEntry(KIO::UDSEntry &entry, const KUrl &url, EFolder folder);
 
70
    void    createUDSEntry(KIO::UDSEntry &entry, EFolder folder);
 
71
    bool    createUDSEntry(KIO::UDSEntry &entry, EFolder folder, const Family &family, const Style &style);
 
72
    Family  getFont(const KUrl &url, EFolder folder);
 
73
    void    handleResp(int resp, const QString &file, const QString &tempFile=QString());
 
74
 
 
75
    private:
 
76
 
 
77
    FontInstInterface       *itsInterface;
 
78
    KTempDir                *itsTempDir;
 
79
    QHash<uid_t, QString>   itsUserCache;
 
80
    QHash<gid_t, QString>   itsGroupCache;
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif