This file is indexed.

/usr/include/QtZeitgeist/datasourceregistry.h is in libqzeitgeist-dev 0.7.0-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * This file is part of QtZeitgeist.
 *
 * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */


#ifndef QTZEITGEIST_DATASOURCEREGISTRY_H_
#define QTZEITGEIST_DATASOURCEREGISTRY_H_

#include <QObject>
#include <QDBusPendingReply>

#include "QtZeitgeist/DataModel/DataSource"
#include "QtZeitgeist/DataModel/Event"

namespace QtZeitgeist
{

class DataSourceRegistryPrivate;

/**
 * @class DataSourceRegistry datasourceregistry.h datasourceregistry.h
 * @brief Primary access point for accessing the Zeitgeist data-sources.
 *
 * @DataSourceRegistry encapsulates the low level access to the Zeitgeist
 * data-sources. You can use it to manage the data-sources by registering
 * a data source, enabling/disabling data-sources and getting all data-sources.
 *
 * It's important to realize that the @DataSourceRegistry class does not expose
 * any API that does synchronous communications with the message bus -
 * everything is asynchronous. Thus, instead of the real result, each
 * asynchronous operation will return a DBus pending reply object, that can
 * be used to watch and fetch the real operation return/result.
 *
 * @see Event
 *
 * @author Jeremy Whiting <jeremy.whiting@collabora.co.uk>
 */
class Q_DECL_EXPORT DataSourceRegistry : public QObject
{
    Q_OBJECT
    Q_DISABLE_COPY(DataSourceRegistry)

public:

    /**
     * Default constructor.
     */
    explicit DataSourceRegistry(QObject *parent = 0);

    /**
     * Destructor.
     */
    virtual ~DataSourceRegistry();

    /**
     * Asynchronously register a data source.
     *
     * Register a data-source as currently running. If the data-source was
     * already in the database, its metadata (name, description and
     * event_templates) are updated.
     *
     * @param unique_id unique ASCII string identifying the data-source.
     * @param name data-source name (may be translated).
     * @param description data-source description (may be translated).
     * @param event_templates optional templates of events the datasource logs.
     *
     * @returns Enabled, true if the datasource is enabled, false if it's
     * disabled.
     */
    QDBusPendingReply<bool> registerDataSource(const QString &unique_id,
        const QString &name, const QString &description,
        DataModel::EventList &event_templates);

    /**
     * Asynchronously get the existing data sources.
     *
     * Get the list of known data-sources.
     *
     * @returns a list of data sources.
     */
    QDBusPendingReply<QtZeitgeist::DataModel::DataSourceList> getDataSources();

    /**
     * Asynchronously enable or disable a data source.
     *
     * @param unique_id unique string identifying a data-source.
     * @param enabled whether the data-source is to be enabled or disabled.
     */
    void setDataSourceEnabled(const QString &unique_id, bool enabled);

Q_SIGNALS:
    /**
     * This signal is emitted whenever the last running instance of a
     * data-source disconnects.
     */
    void dataSourceDisconnected(const QtZeitgeist::DataModel::DataSource&);

    /**
     * This signal is emitted whenever a data-source is enabled or disabled.
     */
    void dataSourceEnabled(const QString &, bool);

    /**
     * This signal is emitted whenever a data-source registers itself.
     */
    void dataSourceRegistered(const QtZeitgeist::DataModel::DataSource &);

private:

    // D Pointer.
    class DataSourceRegistryPrivate * const d;
};

};

#endif // QTZEITGEIST_DATASOURCEREGISTRY_H_