libmm-glib: new common object to handle SMS properties
To be used when requesting to create new SMS.
This commit is contained in:
@@ -36,6 +36,8 @@ libmm_glib_la_SOURCES = \
|
||||
mm-modem-location.c \
|
||||
mm-sim.h \
|
||||
mm-sim.c \
|
||||
mm-sms-properties.h \
|
||||
mm-sms-properties.c \
|
||||
mm-bearer-properties.h \
|
||||
mm-bearer-properties.c \
|
||||
mm-bearer-ip-config.h \
|
||||
@@ -58,6 +60,7 @@ include_HEADERS = \
|
||||
mm-modem-simple-status-properties.h \
|
||||
mm-modem-simple.h \
|
||||
mm-sim.h \
|
||||
mm-sms-properties.h \
|
||||
mm-bearer-properties.h \
|
||||
mm-bearer-ip-config.h \
|
||||
mm-bearer.h
|
||||
|
76
libmm-glib/mm-sms-properties.c
Normal file
76
libmm-glib/mm-sms-properties.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details:
|
||||
*
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
*/
|
||||
|
||||
#include "mm-sms-properties.h"
|
||||
|
||||
void
|
||||
mm_sms_properties_set_text (MMSmsProperties *self,
|
||||
const gchar *text)
|
||||
{
|
||||
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
|
||||
|
||||
mm_common_sms_properties_set_text (self, text);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sms_properties_set_number (MMSmsProperties *self,
|
||||
const gchar *number)
|
||||
{
|
||||
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
|
||||
|
||||
mm_common_sms_properties_set_number (self, number);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sms_properties_set_smsc (MMSmsProperties *self,
|
||||
const gchar *smsc)
|
||||
{
|
||||
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
|
||||
|
||||
mm_common_sms_properties_set_smsc (self, smsc);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sms_properties_set_validity (MMSmsProperties *self,
|
||||
guint validity)
|
||||
{
|
||||
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
|
||||
|
||||
mm_common_sms_properties_set_validity (self, validity);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sms_properties_set_class (MMSmsProperties *self,
|
||||
guint class)
|
||||
{
|
||||
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
|
||||
|
||||
mm_common_sms_properties_set_class (self, class);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSmsProperties *
|
||||
mm_sms_properties_new_from_string (const gchar *str,
|
||||
GError **error)
|
||||
{
|
||||
return mm_common_sms_properties_new_from_string (str, error);
|
||||
}
|
||||
|
||||
MMSmsProperties *
|
||||
mm_sms_properties_new (void)
|
||||
{
|
||||
return mm_common_sms_properties_new ();
|
||||
}
|
54
libmm-glib/mm-sms-properties.h
Normal file
54
libmm-glib/mm-sms-properties.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details:
|
||||
*
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
*/
|
||||
|
||||
#ifndef MM_SMS_PROPERTIES_H
|
||||
#define MM_SMS_PROPERTIES_H
|
||||
|
||||
#include <ModemManager.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <libmm-common.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef MMCommonSmsProperties MMSmsProperties;
|
||||
#define MM_TYPE_SMS_PROPERTIES(o) MM_TYPE_COMMON_SMS_PROPERTIES (o)
|
||||
#define MM_SMS_PROPERTIES(o) MM_COMMON_SMS_PROPERTIES(o)
|
||||
#define MM_IS_SMS_PROPERTIES(o) MM_IS_COMMON_SMS_PROPERTIES(o)
|
||||
|
||||
MMSmsProperties *mm_sms_properties_new (void);
|
||||
MMSmsProperties *mm_sms_properties_new_from_string (
|
||||
const gchar *str,
|
||||
GError **error);
|
||||
|
||||
void mm_sms_properties_set_text (
|
||||
MMSmsProperties *properties,
|
||||
const gchar *text);
|
||||
void mm_sms_properties_set_number (
|
||||
MMSmsProperties *properties,
|
||||
const gchar *number);
|
||||
void mm_sms_properties_set_smsc (
|
||||
MMSmsProperties *properties,
|
||||
const gchar *smsc);
|
||||
void mm_sms_properties_set_validity (
|
||||
MMSmsProperties *properties,
|
||||
guint validity);
|
||||
void mm_sms_properties_set_class (
|
||||
MMSmsProperties *properties,
|
||||
guint class);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* MM_SMS_PROPERTIES_H */
|
Reference in New Issue
Block a user