mu/lib: merge mu-contacts.h => mu-contacts.hh
This commit is contained in:
@ -20,6 +20,14 @@
|
||||
#ifndef __MU_CONTACTS_HH__
|
||||
#define __MU_CONTACTS_HH__
|
||||
|
||||
#include <glib.h>
|
||||
#include <time.h>
|
||||
|
||||
struct _MuContacts;
|
||||
typedef struct _MuContacts MuContacts;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <chrono>
|
||||
@ -27,9 +35,6 @@
|
||||
#include <time.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
|
||||
#include "mu-contacts.h"
|
||||
|
||||
namespace Mu {
|
||||
|
||||
/// Data-structure representing information about some contact.
|
||||
@ -151,6 +156,50 @@ private:
|
||||
std::unique_ptr<Private> priv_;
|
||||
};
|
||||
|
||||
}; // namespace Mu
|
||||
} // namespace Mu
|
||||
|
||||
#endif /*__cplusplus*/
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
/**
|
||||
* return the number of contacts
|
||||
*
|
||||
* @param self a contacts object
|
||||
*
|
||||
* @return the number of contacts
|
||||
*/
|
||||
size_t mu_contacts_count (MuContacts *self);
|
||||
|
||||
/**
|
||||
* Function called for mu_contacts_foreach; returns the e-mail address, name
|
||||
* (which may be NULL) , whether the message is 'personal', the timestamp for
|
||||
* the address (when it was last seen), and the frequency (in how many message
|
||||
* did this contact participate) and the tstamp (last modification)
|
||||
*
|
||||
*/
|
||||
typedef void (*MuContactsForeachFunc) (const char *full_address,
|
||||
const char *email, const char *name,
|
||||
gboolean personal,
|
||||
time_t last_seen, unsigned freq,
|
||||
gint64 tstamp, gpointer user_data);
|
||||
|
||||
/**
|
||||
* call a function for either each contact, or each contact satisfying
|
||||
* a regular expression,
|
||||
*
|
||||
* @param self contacts object
|
||||
* @param func callback function to be called for each
|
||||
* @param user_data user data to pass to the callback
|
||||
*
|
||||
* @return TRUE if the function succeeded, or FALSE if the provide regular
|
||||
* expression was invalid (and not NULL)
|
||||
*/
|
||||
gboolean mu_contacts_foreach (MuContacts *self,
|
||||
MuContactsForeachFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __MU_CONTACTS_HH__ */
|
||||
|
||||
Reference in New Issue
Block a user