summaryrefslogtreecommitdiff
path: root/common/cachemanagerdbus.h
blob: ff94f55f3046cd19c3c9b4460f741eb718b32aa0 (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
/**
 * Copyright (C) 2014, Pelagicore
 *
 * Author: Jonatan PĂ„lsson <jonatan.palsson@pelagicore.com>
 *
 * This file is part of the GENIVI project Browser Proof-Of-Concept
 * For further information, see http://genivi.org/
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef CACHEMANAGERDBUS_H
#define CACHEMANAGERDBUS_H

#include <QObject>
#include <QQmlListProperty>

#include "icachemanager_interface.h"
#include "../common/bookmark.h"

class CacheManagerDbus : public QObject
{
    Q_OBJECT

public:
    explicit CacheManagerDbus(QObject *parent = 0);

    void connectdbussession(QString id);
    Q_INVOKABLE qulonglong getCacheSize();
    Q_INVOKABLE conn::brw::CACHE_POLICY getCachePolicy();
    Q_INVOKABLE void setCachePolicy(conn::brw::CACHE_POLICY);
    Q_INVOKABLE qulonglong getMaximumCacheSize();
    Q_INVOKABLE void clearCache();

signals:
    void onCacheChanged();

private:
    QString m_instanceId;
    bool m_isconnected;
    conn::brw::ICacheManager *m_cachemanager = NULL;

    void registertypes();
};

#endif // CACHEMANAGERDBUS_H