-
Notifications
You must be signed in to change notification settings - Fork 2
/
mthemedaemonclient.h
74 lines (57 loc) · 2.23 KB
/
mthemedaemonclient.h
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
/***************************************************************************
**
** Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef MTHEMEDAEMONCLIENT_H
#define MTHEMEDAEMONCLIENT_H
#include <QString>
#include <QSize>
#include <QSet>
#include <QList>
#include <QDataStream>
#include <QColor>
#include "mthemedaemonprotocol.h"
class QLocalSocket;
class ImageResource;
class MImageDirectory;
class MThemeImagesDirectory;
//! \internal
class MThemeDaemonClient
{
public:
MThemeDaemonClient(QIODevice *socket, const QString &clientName, const QStringList &themes);
~MThemeDaemonClient();
bool reinit(const QString &clientName, const QStringList &themes);
QString name() const;
QDataStream &stream();
ImageResource *pixmapResource(const M::MThemeDaemonProtocol::PixmapIdentifier &id);
// tries to find an image from this client specific image paths
// returns NULL if not found.
ImageResource *findImageResource(const QString &imageId);
// this is called when theme has changed.
void reloadImagePaths(const QStringList &themes);
void addCustomImageDirectory(const QString &path, M::RecursionMode recursionMode);
QStringList removeAddedImageDirectories();
void themeChangeApplied();
QHash<M::MThemeDaemonProtocol::PixmapIdentifier, ImageResource *> pixmaps;
// a list off all requested pixmaps before a theme change. after a theme
// change this list will contain all pixmaps the client did not free.
// the themedaemon will then reload these pixmaps.
QList<M::MThemeDaemonProtocol::PixmapIdentifier> pixmapsToReload;
private:
QString clientName;
QDataStream dataStream;
QList<MThemeImagesDirectory *> themeImageDirs;
QList<MThemeImagesDirectory *> toBeDeletedThemeImageDirs;
QHash<QString, MImageDirectory *> customImageDirs;
QStringList themes;
};
//! \internal_end
#endif