MetricManager.h
Go to the documentation of this file.
/*
* Copyright (C) 2013 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of version 3 of the GNU Lesser General Public License as published
* by the Free Software Foundation.
*
* 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 program. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Pete Woods <pete.woods@canonical.com>
*/
#ifndef USERMETRICSINPUT_METRICMANAGER_H_
#define USERMETRICSINPUT_METRICMANAGER_H_
#include <libusermetricsinput/Metric.h>
namespace UserMetricsInput {
class MetricManager;
class MetricParametersPrivate;
typedef QScopedPointer<MetricManager> MetricManagerPtr;
class Q_DECL_EXPORT MetricParameters {
public:
explicit MetricParameters(const QString &dataSourceId);
MetricParameters & formatString(const QString &formatString);
MetricParameters & emptyDataString(const QString &emptyDataString);
MetricParameters & textDomain(const QString &textDomain);
MetricParameters & minimum(double minimum);
MetricParameters & maximum(double maximum);
MetricParameters & type(MetricType type);
virtual ~MetricParameters();
QScopedPointer<MetricParametersPrivate> p;
};
class Q_DECL_EXPORT MetricManager: public QObject {
public:
explicit MetricManager(QObject *parent = 0);
virtual ~MetricManager();
static MetricManager * getInstance();
virtual MetricPtr add(const QString &dataSourceId,
const QString &formatString, const QString &emptyDataString = "",
const QString &textDomain = "") = 0;
virtual MetricPtr add(const MetricParameters &parameters) = 0;
};
}
#endif // USERMETRICSINPUT_METRICMANAGER_H_
UserMetricsInput::MetricManagerPtr
QScopedPointer< MetricManager > MetricManagerPtr
Shared pointer for the MetricManager.
Definition: MetricManager.h:34
UserMetricsInput::MetricManager
Central place for registering and updating user metrics.
Definition: MetricManager.h:69
UserMetricsInput::MetricParameters
Definition: MetricManager.h:41
UserMetricsInput::MetricPtr
QSharedPointer< Metric > MetricPtr
Definition: Metric.h:31
UserMetricsInput::MetricParameters::p
QScopedPointer< MetricParametersPrivate > p
Definition: MetricManager.h:60
UserMetricsInput::MetricType
MetricType
Definition: Metric.h:38
Metric.h