Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'progress' into 'master'
Transfer progress API Intended for the Messages app, so that it can show MMS send/receive progress. D-Bus interface for the list of transfers goes like this: <interface name="org.nemomobile.MmsEngine.TransferList"> <method name="Get"> <arg name="list" type="ao" direction="out"/> </method> <signal name="TransferStarted"> <arg name="path" type="o"/> </signal> <signal name="TransferFinished"> <arg name="path" type="o"/> </signal> </interface> D-Bus interface for individual transfers (identified by path): <interface name="org.nemomobile.MmsEngine.Transfer"> <method name="GetAll"> <arg name="version" type="u" direction="out"/> <arg name="bytes_sent" type="u" direction="out"/> <arg name="bytes_to_send" type="u" direction="out"/> <arg name="bytes_received" type="u" direction="out"/> <arg name="bytes_to_receive" type="u" direction="out"/> </method> <method name="EnableUpdates"> <!-- 1 - send, 2 - receive, 3 - both --> <arg name="flags" type="u" direction="in"/> <arg name="cookie" type="u" direction="out"/> </method> <method name="DisableUpdates"> <arg name="cookie" type="u" direction="in"/> </method> <method name="GetInterfaceVersion"> <arg name="version" type="u" direction="out"/> </method> <method name="GetSendProgress"> <arg name="bytes_sent" type="u" direction="out"/> <arg name="bytes_to_send" type="u" direction="out"/> </method> <method name="GetReceiveProgress"> <arg name="bytes_received" type="u" direction="out"/> <arg name="bytes_to_receive" type="u" direction="out"/> </method> <signal name="SendProgressChanged"> <arg name="bytes_sent" type="u"/> <arg name="bytes_to_send" type="u"/> </signal> <signal name="ReceiveProgressChanged"> <arg name="bytes_received" type="u"/> <arg name="bytes_to_receive" type="u"/> </signal> <signal name="Finished"/> </interface> Progress signals are not emitted unless there's at least one D-Bus client expressed an interest by calling EnableUpdates with appropriate flags. Request for updates can be revoked with DisableUpdates. This complicates things a bit but I think it's worth the trouble. See merge request !9
- Loading branch information
Showing
49 changed files
with
1,818 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright (C) 2016 Jolla Ltd. | ||
* Contact: Slava Monich <slava.monich@jolla.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
#ifndef JOLLA_MMS_TRANSFER_LIST_H | ||
#define JOLLA_MMS_TRANSFER_LIST_H | ||
|
||
#include "mms_message.h" | ||
|
||
/* Instance */ | ||
struct mms_transfer_list { | ||
GObject object; | ||
}; | ||
|
||
/* Class */ | ||
typedef struct mms_transfer_list_class { | ||
GObjectClass parent; | ||
void (*fn_transfer_started)( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type); /* Transfer type */ | ||
void (*fn_transfer_finished)( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type); /* Transfer type */ | ||
void (*fn_send_progress)( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type, /* Transfer type */ | ||
guint bytes_sent, /* Bytes sent so far */ | ||
guint bytes_total); /* Total bytes to send */ | ||
void (*fn_receive_progress)( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type, /* Transfer type */ | ||
guint bytes_received, /* Bytes received so far */ | ||
guint bytes_total); /* Total bytes to receive*/ | ||
} MMSTransferListClass; | ||
|
||
GType mms_transfer_list_get_type(void); | ||
#define MMS_TYPE_TRANSFER_LIST (mms_transfer_list_get_type()) | ||
|
||
MMSTransferList* | ||
mms_transfer_list_ref( | ||
MMSTransferList* list); | ||
|
||
void | ||
mms_transfer_list_unref( | ||
MMSTransferList* list); | ||
|
||
void | ||
mms_transfer_list_transfer_started( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type); /* Transfer type */ | ||
|
||
void | ||
mms_transfer_list_transfer_finished( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type); /* Transfer type */ | ||
|
||
void | ||
mms_transfer_list_transfer_send_progress( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type, /* Transfer type */ | ||
guint bytes_sent, /* Bytes sent so far */ | ||
guint bytes_total); /* Total bytes to send */ | ||
|
||
void | ||
mms_transfer_list_transfer_receive_progress( | ||
MMSTransferList* list, /* Instance */ | ||
char* id, /* Message ID */ | ||
char* type, /* Transfer type */ | ||
guint bytes_received, /* Bytes received so far */ | ||
guint bytes_total); /* Total bytes to receive*/ | ||
|
||
#endif /* JOLLA_MMS_TRANSFER_LIST_H */ | ||
|
||
/* | ||
* Local Variables: | ||
* mode: C | ||
* c-basic-offset: 4 | ||
* indent-tabs-mode: nil | ||
* End: | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.