ekiga r5884 - in trunk: . lib/engine/presence/skel



Author: dsandras
Date: Mon Jan  7 20:43:40 2008
New Revision: 5884
URL: http://svn.gnome.org/viewvc/ekiga?rev=5884&view=rev

Log:
Added PresencePublisher.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/presence/skel/presence-core.cpp
   trunk/lib/engine/presence/skel/presence-core.h

Modified: trunk/lib/engine/presence/skel/presence-core.cpp
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.cpp	(original)
+++ trunk/lib/engine/presence/skel/presence-core.cpp	Mon Jan  7 20:43:40 2008
@@ -29,6 +29,7 @@
  *                         ------------------------------------------
  *   begin                : written in 2007 by Julien Puydt
  *   copyright            : (c) 2007 by Julien Puydt
+ *                          (c) 2008 by Damien Sandras
  *   description          : implementation of the main
  *                          presentity managing object
  *
@@ -170,6 +171,21 @@
     (*iter)->unfetch (uri);
 }
 
+void Ekiga::PresenceCore::add_presence_publisher (PresencePublisher &publisher)
+{
+  presence_publishers.insert (&publisher);
+}
+
+void Ekiga::PresenceCore::publish (const std::string & presence,
+                                   const std::string & extended_status)
+{
+  for (std::set<PresencePublisher *>::iterator iter
+	 = presence_publishers.begin ();
+       iter != presence_publishers.end ();
+       iter++)
+    (*iter)->publish (presence, extended_status);
+}
+
 bool
 Ekiga::PresenceCore::is_supported_uri (const std::string uri) const
 {

Modified: trunk/lib/engine/presence/skel/presence-core.h
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.h	(original)
+++ trunk/lib/engine/presence/skel/presence-core.h	Mon Jan  7 20:43:40 2008
@@ -29,6 +29,7 @@
  *                         ------------------------------------------
  *   begin                : written in 2007 by Julien Puydt
  *   copyright            : (c) 2007 by Julien Puydt
+ *                          (c) 2008 by Damien Sandras
  *   description          : declaration of the main
  *                          presentity managing object
  *
@@ -66,6 +67,16 @@
     sigc::signal<void, std::string, std::string> presence_received;
     sigc::signal<void, std::string, std::string> status_received;
   };
+
+  class PresencePublisher
+  {
+  public:
+
+    virtual ~PresencePublisher () {}
+
+    virtual void publish (const std::string & /*presence*/,
+                          const std::string & /*extended_status*/) = 0;
+  };
 };
 
 namespace Ekiga
@@ -149,6 +160,18 @@
 
     std::set<PresenceFetcher *> presence_fetchers;
 
+    /* help publishing presence */
+  public:
+
+    void add_presence_publisher (PresencePublisher &publisher);
+
+    void publish (const std::string & status, 
+                  const std::string & extended_status);
+
+  private:
+
+    std::set<PresencePublisher *> presence_publishers;
+
     /* help decide whether an uri is supported by runtime */
   public:
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]