| 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
| 2 |
* |
| 3 |
* Copyright (C) 2009 Richard Hughes <[email protected]> |
| 4 |
* |
| 5 |
* Licensed under the GNU Lesser General Public License Version 2.1 |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Lesser General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2.1 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public |
| 18 |
* License along with this library; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
#if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION) |
| 23 |
#error "Only <packagekit.h> can be included directly." |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifndef __PK_CATEGORY_H |
| 27 |
#define __PK_CATEGORY_H |
| 28 |
|
| 29 |
#include <glib-object.h> |
| 30 |
|
| 31 |
#include <packagekit-glib2/pk-source.h> |
| 32 |
|
| 33 |
G_BEGIN_DECLS |
| 34 |
|
| 35 |
#define PK_TYPE_CATEGORY (pk_category_get_type ()) |
| 36 |
#define PK_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_CATEGORY, PkCategory)) |
| 37 |
#define PK_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_CATEGORY, PkCategoryClass)) |
| 38 |
#define PK_IS_CATEGORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_CATEGORY)) |
| 39 |
#define PK_IS_CATEGORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_CATEGORY)) |
| 40 |
#define PK_CATEGORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_CATEGORY, PkCategoryClass)) |
| 41 |
|
| 42 |
typedef struct _PkCategoryPrivate PkCategoryPrivate; |
| 43 |
typedef struct _PkCategory PkCategory; |
| 44 |
typedef struct _PkCategoryClass PkCategoryClass; |
| 45 |
|
| 46 |
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC |
| 47 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(PkCategory, g_object_unref) |
| 48 |
#endif |
| 49 |
|
| 50 |
struct _PkCategory |
| 51 |
{ |
| 52 |
PkSource parent; |
| 53 |
PkCategoryPrivate *priv; |
| 54 |
}; |
| 55 |
|
| 56 |
struct _PkCategoryClass |
| 57 |
{ |
| 58 |
PkSourceClass parent_class; |
| 59 |
/* padding for future expansion */ |
| 60 |
void (*_pk_reserved1) (void); |
| 61 |
void (*_pk_reserved2) (void); |
| 62 |
void (*_pk_reserved3) (void); |
| 63 |
void (*_pk_reserved4) (void); |
| 64 |
void (*_pk_reserved5) (void); |
| 65 |
}; |
| 66 |
|
| 67 |
GType pk_category_get_type (void); |
| 68 |
PkCategory *pk_category_new (void); |
| 69 |
|
| 70 |
/* accessors */ |
| 71 |
const gchar *pk_category_get_parent_id (PkCategory *category); |
| 72 |
void pk_category_set_parent_id (PkCategory *category, |
| 73 |
const gchar *parent_id); |
| 74 |
const gchar *pk_category_get_id (PkCategory *category); |
| 75 |
void pk_category_set_id (PkCategory *category, |
| 76 |
const gchar *cat_id); |
| 77 |
const gchar *pk_category_get_name (PkCategory *category); |
| 78 |
void pk_category_set_name (PkCategory *category, |
| 79 |
const gchar *name); |
| 80 |
const gchar *pk_category_get_summary (PkCategory *category); |
| 81 |
void pk_category_set_summary (PkCategory *category, |
| 82 |
const gchar *summary); |
| 83 |
const gchar *pk_category_get_icon (PkCategory *category); |
| 84 |
void pk_category_set_icon (PkCategory *category, |
| 85 |
const gchar *icon); |
| 86 |
|
| 87 |
G_END_DECLS |
| 88 |
|
| 89 |
#endif /* __PK_CATEGORY_H */ |
| 90 |
|