melunko@117
|
1 |
/**
|
melunko@117
|
2 |
* GMyth Library
|
melunko@117
|
3 |
*
|
melunko@117
|
4 |
* @file gmyth/gmyth_backend_info.h
|
melunko@117
|
5 |
*
|
rosfran@420
|
6 |
* @brief <p> This component represents all the MythTV backend server
|
rosfran@420
|
7 |
* configuration information.
|
melunko@117
|
8 |
*
|
melunko@117
|
9 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
melunko@117
|
10 |
* @author Hallyson Melo <hallyson.melo@indt.org.br>
|
rosfran@420
|
11 |
* @author Rosfran Borges <rosfran.borges@indt.org.br>
|
melunko@117
|
12 |
*
|
rosfran@701
|
13 |
*
|
rosfran@701
|
14 |
* This program is free software; you can redistribute it and/or modify
|
rosfran@701
|
15 |
* it under the terms of the GNU Lesser General Public License as published by
|
rosfran@701
|
16 |
* the Free Software Foundation; either version 2 of the License, or
|
rosfran@701
|
17 |
* (at your option) any later version.
|
rosfran@701
|
18 |
*
|
rosfran@701
|
19 |
* This program is distributed in the hope that it will be useful,
|
rosfran@701
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
rosfran@701
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
rosfran@701
|
22 |
* GNU General Public License for more details.
|
rosfran@701
|
23 |
*
|
rosfran@701
|
24 |
* You should have received a copy of the GNU Lesser General Public License
|
rosfran@701
|
25 |
* along with this program; if not, write to the Free Software
|
rosfran@701
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
rosfran@701
|
27 |
*/
|
melunko@117
|
28 |
|
melunko@117
|
29 |
#ifndef __GMYTH_BACKEND_INFO_H__
|
melunko@117
|
30 |
#define __GMYTH_BACKEND_INFO_H__
|
melunko@117
|
31 |
|
melunko@117
|
32 |
#include <glib-object.h>
|
melunko@117
|
33 |
|
rosfran@307
|
34 |
#include "gmyth_uri.h"
|
renatofilho@769
|
35 |
#include "gmyth_socket.h"
|
rosfran@307
|
36 |
|
melunko@117
|
37 |
G_BEGIN_DECLS
|
renatofilho@755
|
38 |
#define GMYTH_BACKEND_INFO_TYPE \
|
renatofilho@755
|
39 |
(gmyth_backend_info_get_type ())
|
renatofilho@755
|
40 |
#define GMYTH_BACKEND_INFO(obj) \
|
renatofilho@755
|
41 |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfo))
|
renatofilho@755
|
42 |
#define GMYTH_BACKEND_INFO_CLASS(klass) \
|
renatofilho@755
|
43 |
(G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfoClass))
|
renatofilho@755
|
44 |
#define IS_GMYTH_BACKEND_INFO(obj) \
|
renatofilho@755
|
45 |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_BACKEND_INFO_TYPE))
|
renatofilho@755
|
46 |
#define IS_GMYTH_BACKEND_INFO_CLASS(klass) \
|
renatofilho@755
|
47 |
(G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_BACKEND_INFO_TYPE))
|
renatofilho@755
|
48 |
#define GMYTH_BACKEND_INFO_GET_CLASS(obj) \
|
renatofilho@755
|
49 |
(G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfoClass))
|
renatofilho@755
|
50 |
|
rosfran@698
|
51 |
typedef struct _GMythBackendInfo GMythBackendInfo;
|
rosfran@698
|
52 |
typedef struct _GMythBackendInfoClass GMythBackendInfoClass;
|
melunko@117
|
53 |
|
renatofilho@754
|
54 |
struct _GMythBackendInfoClass {
|
renatofilho@754
|
55 |
GObjectClass parent_class;
|
melunko@117
|
56 |
|
renatofilho@754
|
57 |
/*
|
renatofilho@754
|
58 |
* callbacks
|
renatofilho@754
|
59 |
*/
|
renatofilho@754
|
60 |
/*
|
renatofilho@754
|
61 |
* no one for now
|
renatofilho@754
|
62 |
*/
|
renatofilho@750
|
63 |
};
|
melunko@117
|
64 |
|
renatofilho@754
|
65 |
struct _GMythBackendInfo {
|
melunko@818
|
66 |
GObject parent;
|
renatofilho@754
|
67 |
/** The backend hostname or ip address. */
|
melunko@818
|
68 |
gchar *hostname;
|
melunko@818
|
69 |
/** The backend port. */
|
melunko@818
|
70 |
gint port;
|
renatofilho@754
|
71 |
/** The username to connect to the mysql server. */
|
melunko@818
|
72 |
gchar *username;
|
renatofilho@754
|
73 |
/** The password to connect to the mysql server. */
|
melunko@818
|
74 |
gchar *password;
|
renatofilho@754
|
75 |
/** The mythtv's mysql database name. */
|
melunko@818
|
76 |
gchar *db_name;
|
melunko@818
|
77 |
/** The mysql database port */
|
melunko@818
|
78 |
gint db_port;
|
renatofilho@754
|
79 |
/** The backend status port for http connection */
|
melunko@818
|
80 |
gint status_port;
|
renatofilho@769
|
81 |
|
renatofilho@769
|
82 |
/* Private */
|
renatofilho@769
|
83 |
GMythSocket *sock;
|
renatofilho@750
|
84 |
};
|
melunko@117
|
85 |
|
melunko@117
|
86 |
|
renatofilho@755
|
87 |
GType gmyth_backend_info_get_type (void) G_GNUC_CONST;;
|
renatofilho@755
|
88 |
GMythBackendInfo* gmyth_backend_info_new (void);
|
renatofilho@755
|
89 |
GMythBackendInfo* gmyth_backend_info_new_full (const gchar *hostname,
|
renatofilho@755
|
90 |
const gchar *username,
|
renatofilho@755
|
91 |
const gchar *password,
|
renatofilho@755
|
92 |
const gchar *db_name,
|
renatofilho@755
|
93 |
gint port);
|
renatofilho@755
|
94 |
GMythBackendInfo* gmyth_backend_info_new_with_uri (const gchar *uri_str);
|
renatofilho@755
|
95 |
void gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info,
|
renatofilho@755
|
96 |
const gchar *hostname);
|
renatofilho@755
|
97 |
void gmyth_backend_info_set_username (GMythBackendInfo *backend_info,
|
renatofilho@755
|
98 |
const gchar *username);
|
renatofilho@755
|
99 |
void gmyth_backend_info_set_password (GMythBackendInfo *backend_info,
|
renatofilho@755
|
100 |
const gchar *password);
|
renatofilho@755
|
101 |
void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info,
|
renatofilho@755
|
102 |
const gchar *db_name);
|
melunko@818
|
103 |
void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info,
|
melunko@818
|
104 |
gint db_port);
|
renatofilho@755
|
105 |
void gmyth_backend_info_set_port (GMythBackendInfo *backend_info,
|
renatofilho@755
|
106 |
gint port);
|
renatofilho@755
|
107 |
void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info,
|
renatofilho@755
|
108 |
gint port);
|
renatofilho@755
|
109 |
const gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info);
|
renatofilho@755
|
110 |
const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info);
|
renatofilho@755
|
111 |
const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info);
|
renatofilho@755
|
112 |
const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info);
|
melunko@818
|
113 |
gint gmyth_backend_info_get_db_port (GMythBackendInfo *backend_info);
|
renatofilho@755
|
114 |
gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info);
|
renatofilho@755
|
115 |
GMythURI* gmyth_backend_info_get_uri (GMythBackendInfo *backend_info);
|
renatofilho@755
|
116 |
gboolean gmyth_backend_info_is_local_file (GMythBackendInfo *backend_info);
|
renatofilho@769
|
117 |
GMythSocket* gmyth_backend_info_get_connected_socket
|
renatofilho@769
|
118 |
(GMythBackendInfo *backend_info);
|
renatofilho@769
|
119 |
|
rosfran@529
|
120 |
|
melunko@117
|
121 |
G_END_DECLS
|
renatofilho@754
|
122 |
#endif /* __GMYTH_BACKEND_INFO_H__ */
|