1 /*
2  * Copyright (C) 2010 Stefan Walter
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation; either version 2.1 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
19 #error "Only <gcr/gcr.h> or <gcr/gcr-base.h> can be included directly."
20 #endif
21 
22 #ifndef __GCR_CERTIFICATE_RENDERER_H__
23 #define __GCR_CERTIFICATE_RENDERER_H__
24 
25 #include <glib-object.h>
26 #include <gtk/gtk.h>
27 
28 #include "gcr/gcr-certificate.h"
29 #include "gcr/gcr-types.h"
30 
31 #include "gcr-renderer.h"
32 
33 G_BEGIN_DECLS
34 
35 #define GCR_TYPE_CERTIFICATE_RENDERER               (gcr_certificate_renderer_get_type ())
36 #define GCR_CERTIFICATE_RENDERER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CERTIFICATE_RENDERER, GcrCertificateRenderer))
37 #define GCR_CERTIFICATE_RENDERER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CERTIFICATE_RENDERER, GcrCertificateRendererClass))
38 #define GCR_IS_CERTIFICATE_RENDERER(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CERTIFICATE_RENDERER))
39 #define GCR_IS_CERTIFICATE_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CERTIFICATE_RENDERER))
40 #define GCR_CERTIFICATE_RENDERER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CERTIFICATE_RENDERER, GcrCertificateRendererClass))
41 
42 typedef struct _GcrCertificateRenderer GcrCertificateRenderer;
43 typedef struct _GcrCertificateRendererClass GcrCertificateRendererClass;
44 typedef struct _GcrCertificateRendererPrivate GcrCertificateRendererPrivate;
45 
46 struct _GcrCertificateRenderer {
47 	GObject parent;
48 
49 	/*< private >*/
50 	GcrCertificateRendererPrivate *pv;
51 };
52 
53 struct _GcrCertificateRendererClass {
54 	GObjectClass parent_class;
55 };
56 
57 GType                     gcr_certificate_renderer_get_type           (void);
58 
59 GcrCertificateRenderer*   gcr_certificate_renderer_new                (GcrCertificate *certificate);
60 
61 GcrCertificateRenderer*   gcr_certificate_renderer_new_for_attributes (const gchar *label,
62                                                                        struct _GckAttributes *attrs);
63 
64 GcrCertificate*           gcr_certificate_renderer_get_certificate    (GcrCertificateRenderer *self);
65 
66 void                      gcr_certificate_renderer_set_certificate    (GcrCertificateRenderer *self,
67                                                                        GcrCertificate *certificate);
68 
69 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCertificateRenderer, g_object_unref)
70 
71 G_END_DECLS
72 
73 #endif /* __GCR_CERTIFICATE_RENDERER_H__ */
74