~kamstrup/unity-lens-applications/include-gsettings-schema

« back to all changes in this revision

Viewing changes to src/unity-ratings-db.h

  • Committer: Mikkel Kamstrup Erlandsen
  • Date: 2011-09-23 12:52:49 UTC
  • mfrom: (232.1.21 ratings-query)
  • Revision ID: mikkel.kamstrup@gmail.com-20110923125249-s1a37i06uerthbw0
MergeĀ lp:~kamstrup/unity-lens-applications/ratings-query

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
 
17
 *
 
18
 */
 
19
 
 
20
 
 
21
#ifndef _UNITY_RATINGS_DB_H_
 
22
#define _UNITY_RATINGS_DB_H_
 
23
 
 
24
 
 
25
#include <glib.h>
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
/* This struct *must* start with 3 32 bit integers, to smoothly be able
 
30
 * to store the results we read from the Software Center Ratings DB */
 
31
typedef struct {
 
32
  gint32        average_rating;
 
33
  gint32        total_rating;
 
34
  gint32        dampened_rating;
 
35
} UnityRatingsResult;
 
36
 
 
37
typedef struct _UnityRatingsDatabase UnityRatingsDatabase;
 
38
 
 
39
UnityRatingsDatabase* unity_ratings_database_new   (GError                **error);
 
40
 
 
41
void                  unity_ratings_database_free  (UnityRatingsDatabase   *self);
 
42
 
 
43
gboolean              unity_ratings_database_query (UnityRatingsDatabase   *self,
 
44
                                                    const gchar            *pkgname,
 
45
                                                    UnityRatingsResult     *out_result);
 
46
 
 
47
 
 
48
G_END_DECLS
 
49
 
 
50
#endif /* _UNITY_RATINGS_DB_H_ */