[ekiga] Made the Opal::Bank an Ekiga::ContactDecorator and Ekiga::PresentityDecorator



commit 21f16237823bb0f2ac8af644e7557bc38963bfc9
Author: Julien Puydt <jpuydt free fr>
Date:   Tue Jan 29 10:02:18 2013 +0100

    Made the Opal::Bank an Ekiga::ContactDecorator and Ekiga::PresentityDecorator
    
    But it still doesn't do anything, as I'm waiting for feedback on what the
    current code does with the uri to understand how to properly move it.

 lib/engine/components/opal/opal-bank.cpp |   23 +++++++++++++++++++++++
 lib/engine/components/opal/opal-bank.h   |   20 ++++++++++++++++++++
 lib/engine/components/opal/opal-main.cpp |    2 ++
 3 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index 42ae57e..abb1e0c 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -113,6 +113,29 @@ Opal::Bank::populate_menu (Ekiga::MenuBuilder & builder)
   return true;
 }
 
+bool
+Opal::Bank::populate_menu (Ekiga::ContactPtr contact,
+			   const std::string uri,
+			   Ekiga::MenuBuilder& builder)
+{
+  return populate_menu_helper (contact->get_name (), uri, builder);
+}
+
+bool
+Opal::Bank::populate_menu (Ekiga::PresentityPtr presentity,
+			   const std::string uri,
+			   Ekiga::MenuBuilder& builder)
+{
+  return populate_menu_helper (presentity->get_name (), uri, builder);
+}
+
+bool
+Opal::Bank::populate_menu_helper (const std::string fullname,
+				  const std::string& uri,
+				  Ekiga::MenuBuilder& builder)
+{
+  return false; // FIXME: to implement properly
+}
 
 void
 Opal::Bank::new_account (Account::Type acc_type,
diff --git a/lib/engine/components/opal/opal-bank.h b/lib/engine/components/opal/opal-bank.h
index 659da66..b59ea49 100644
--- a/lib/engine/components/opal/opal-bank.h
+++ b/lib/engine/components/opal/opal-bank.h
@@ -38,6 +38,9 @@
 #ifndef __OPAL_BANK_H__
 #define __OPAL_BANK_H__
 
+#include "contact-core.h"
+#include "presence-core.h"
+
 #include "opal-account.h"
 
 namespace Opal
@@ -51,6 +54,8 @@ namespace Opal
       public Ekiga::BankImpl<Account>,
       public Ekiga::PresencePublisher,
       public Ekiga::PresenceFetcher,
+      public Ekiga::ContactDecorator,
+      public Ekiga::PresentityDecorator,
       public Ekiga::Service
   {
 public:
@@ -80,6 +85,21 @@ public:
                       std::string username = "",
                       std::string password = "");
 
+    /*
+     * this object is an Ekiga::ContactDecorator and an Ekiga::PresentityDecorator
+     */
+    bool populate_menu (Ekiga::ContactPtr contact,
+			const std::string uri,
+			Ekiga::MenuBuilder& builder);
+
+    bool populate_menu (Ekiga::PresentityPtr presentity,
+			const std::string uri,
+			Ekiga::MenuBuilder& builder);
+
+    bool populate_menu_helper (const std::string fullname,
+			       const std::string& uri,
+			       Ekiga::MenuBuilder& builder);
+
     /** Find the account with the given address of record in the Bank
      * @param aor is the address of record of the Account or the host to look 
      *        for
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index e05c33e..25555c5 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -137,6 +137,8 @@ struct OPALSpark: public Ekiga::Spark
       boost::shared_ptr<Bank> bank (new Bank (core));
       account_core->add_bank (bank);
       core.add (bank);
+      contact_core->add_contact_decorator (bank);
+      presence_core->add_presentity_decorator (bank);
       sip_manager->update_bank (bank);
       call_manager->ready.connect (boost::bind (&Opal::Bank::call_manager_ready, &*bank));
       presence_core->add_presence_publisher (bank);



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