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