Commit abbf0ada authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin

Initial C++ code and doc

parent 3f696bc8
......@@ -31,6 +31,7 @@ AC_CONFIG_FILES([libs/Makefile \
libs/utilspp/Makefile \
libs/utilspp/functor/Makefile \
libs/utilspp/singleton/Makefile])
AC_CONFIG_FILES([src/Makefile \
src/sflphone \
src/audio/Makefile \
......@@ -40,13 +41,19 @@ AC_CONFIG_FILES([src/Makefile \
src/gui/qt/Makefile \
src/gui/cli/Makefile \
src/gui/server/Makefile \
src/dbus/Makefile \
src/zeroconf/Makefile])
AC_CONFIG_FILES([skins/Makefile \
skins/metal/Makefile \
skins/gmetal/Makefile \
ringtones/Makefile])
AC_CONFIG_FILES([platform/debian/changelog platform/rpm/sflphone.spec \
platform/fedora/sflphone.spec platform/fedora/sflphone-fc6.spec])
AC_CONFIG_FILES([platform/debian/changelog \
platform/rpm/sflphone.spec \
platform/fedora/sflphone.spec \
platform/fedora/sflphone-fc6.spec])
dnl the file stamp-h.in should be there before (instead of AC_CONFIG_HEADERS(config.h))
AM_CONFIG_HEADER(config.h)
......
SUBDIRS =
EXTRA_DIST = *.xml
noinst_LTLIBRARIES = libdbus.la
libdbus_la_SOURCES = \
callmanager-glue.h
AM_CXXFLAGS = $(libccext2_CFLAGS)
libdbus_la_LIBADD = $(LIB_DNSSD)
To build a new dbus interface:
1. Define the API with a xml file.
2. Generate the glue.h header by running "dbusxx-xml2cpp file.xml --adaptor=file.h"
3. Inheritate from that glue.h class in your code.
/*
* This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT!
*/
#ifndef __dbusxx__callmanager_glue_h__ADAPTOR_MARSHAL_H
#define __dbusxx__callmanager_glue_h__ADAPTOR_MARSHAL_H
#include <dbus-c++/dbus.h>
namespace org {
namespace sflphone {
class CallManager
: public ::DBus::InterfaceAdaptor
{
public:
CallManager()
: ::DBus::InterfaceAdaptor("org.sflphone.CallManager")
{
register_method(CallManager, call, _call_stub);
register_method(CallManager, refuse, _refuse_stub);
register_method(CallManager, accept, _accept_stub);
register_method(CallManager, hangUp, _hangUp_stub);
register_method(CallManager, hold, _hold_stub);
register_method(CallManager, unhold, _unhold_stub);
register_method(CallManager, transfert, _transfert_stub);
register_method(CallManager, setVolume, _setVolume_stub);
register_method(CallManager, getVolume, _getVolume_stub);
register_method(CallManager, getVoiceMailCount, _getVoiceMailCount_stub);
register_method(CallManager, getCallDetails, _getCallDetails_stub);
register_method(CallManager, getCurrentCallID, _getCurrentCallID_stub);
}
::DBus::IntrospectedInterface* const introspect() const
{
static ::DBus::IntrospectedArgument call_args[] =
{
{ "accountID", "s", true },
{ "callID", "s", true },
{ "to", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument refuse_args[] =
{
{ "callID", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument accept_args[] =
{
{ "callID", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument hangUp_args[] =
{
{ "callID", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument hold_args[] =
{
{ "callID", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument unhold_args[] =
{
{ "callID", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument transfert_args[] =
{
{ "callID", "s", true },
{ "to", "s", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument setVolume_args[] =
{
{ "device", "s", true },
{ "value", "f", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getVolume_args[] =
{
{ "device", "s", true },
{ "value", "f", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getVoiceMailCount_args[] =
{
{ "count", "i", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getCallDetails_args[] =
{
{ "callID", "s", true },
{ "infos", "a{ss}", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getCurrentCallID_args[] =
{
{ "callID", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument incommingCall_args[] =
{
{ "accountID", "s", false },
{ "callID", "s", false },
{ "from", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument incommingMessage_args[] =
{
{ "accountID", "s", false },
{ "from", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument ring_args[] =
{
{ "callID", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument pickedUp_args[] =
{
{ "callID", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument hungUp_args[] =
{
{ "callID", "s", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument volumeChanged_args[] =
{
{ "device", "s", false },
{ "value", "f", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument error_args[] =
{
{ "details", "a{ss}", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedMethod CallManager_methods[] =
{
{ "call", call_args },
{ "refuse", refuse_args },
{ "accept", accept_args },
{ "hangUp", hangUp_args },
{ "hold", hold_args },
{ "unhold", unhold_args },
{ "transfert", transfert_args },
{ "setVolume", setVolume_args },
{ "getVolume", getVolume_args },
{ "getVoiceMailCount", getVoiceMailCount_args },
{ "getCallDetails", getCallDetails_args },
{ "getCurrentCallID", getCurrentCallID_args },
{ 0, 0 }
};
static ::DBus::IntrospectedMethod CallManager_signals[] =
{
{ "incommingCall", incommingCall_args },
{ "incommingMessage", incommingMessage_args },
{ "ring", ring_args },
{ "pickedUp", pickedUp_args },
{ "hungUp", hungUp_args },
{ "volumeChanged", volumeChanged_args },
{ "error", error_args },
{ 0, 0 }
};
static ::DBus::IntrospectedProperty CallManager_properties[] =
{
{ 0, 0, 0, 0 }
};
static ::DBus::IntrospectedInterface CallManager_interface =
{
"org.sflphone.CallManager",
CallManager_methods,
CallManager_signals,
CallManager_properties
};
return &CallManager_interface;
}
public:
/* properties exposed by this interface, use
* property() and property(value) to get and set a particular property
*/
public:
/* methods exported by this interface,
* you will have to implement them in your ObjectAdaptor
*/
virtual void call( const ::DBus::String& accountID, const ::DBus::String& callID, const ::DBus::String& to ) = 0;
virtual void refuse( const ::DBus::String& callID ) = 0;
virtual void accept( const ::DBus::String& callID ) = 0;
virtual void hangUp( const ::DBus::String& callID ) = 0;
virtual void hold( const ::DBus::String& callID ) = 0;
virtual void unhold( const ::DBus::String& callID ) = 0;
virtual void transfert( const ::DBus::String& callID, const ::DBus::String& to ) = 0;
virtual void setVolume( const ::DBus::String& device, const & value ) = 0;
virtual getVolume( const ::DBus::String& device ) = 0;
virtual ::DBus::Int32 getVoiceMailCount( ) = 0;
virtual std::map< ::DBus::String, ::DBus::String > getCallDetails( const ::DBus::String& callID ) = 0;
virtual ::DBus::String getCurrentCallID( ) = 0;
public:
/* signal emitters for this interface
*/
void incommingCall( const ::DBus::String& arg1, const ::DBus::String& arg2, const ::DBus::String& arg3 )
{
::DBus::SignalMessage sig("incommingCall");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
wi << arg2;
wi << arg3;
emit_signal(sig);
}
void incommingMessage( const ::DBus::String& arg1, const ::DBus::String& arg2 )
{
::DBus::SignalMessage sig("incommingMessage");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
wi << arg2;
emit_signal(sig);
}
void ring( const ::DBus::String& arg1 )
{
::DBus::SignalMessage sig("ring");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
emit_signal(sig);
}
void pickedUp( const ::DBus::String& arg1 )
{
::DBus::SignalMessage sig("pickedUp");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
emit_signal(sig);
}
void hungUp( const ::DBus::String& arg1 )
{
::DBus::SignalMessage sig("hungUp");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
emit_signal(sig);
}
void volumeChanged( const ::DBus::String& arg1, const & arg2 )
{
::DBus::SignalMessage sig("volumeChanged");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
wi << arg2;
emit_signal(sig);
}
void error( const std::map< ::DBus::String, ::DBus::String >& arg1 )
{
::DBus::SignalMessage sig("error");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
emit_signal(sig);
}
private:
/* unmarshalers (to unpack the DBus message before calling the actual interface method)
*/
::DBus::Message _call_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
::DBus::String argin2; ri >> argin2;
::DBus::String argin3; ri >> argin3;
call(argin1, argin2, argin3);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _refuse_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
refuse(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _accept_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
accept(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _hangUp_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
hangUp(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _hold_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
hold(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _unhold_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
unhold(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _transfert_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
::DBus::String argin2; ri >> argin2;
transfert(argin1, argin2);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _setVolume_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
argin2; ri >> argin2;
setVolume(argin1, argin2);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _getVolume_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
argout1 = getVolume(argin1);
::DBus::ReturnMessage reply(call);
::DBus::MessageIter wi = reply.writer();
wi << argout1;
return reply;
}
::DBus::Message _getVoiceMailCount_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::Int32 argout1 = getVoiceMailCount();
::DBus::ReturnMessage reply(call);
::DBus::MessageIter wi = reply.writer();
wi << argout1;
return reply;
}
::DBus::Message _getCallDetails_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argin1; ri >> argin1;
std::map< ::DBus::String, ::DBus::String > argout1 = getCallDetails(argin1);
::DBus::ReturnMessage reply(call);
::DBus::MessageIter wi = reply.writer();
wi << argout1;
return reply;
}
::DBus::Message _getCurrentCallID_stub( const ::DBus::CallMessage& call )
{
::DBus::MessageIter ri = call.reader();
::DBus::String argout1 = getCurrentCallID();
::DBus::ReturnMessage reply(call);
::DBus::MessageIter wi = reply.writer();
wi << argout1;
return reply;
}
};
} }
#endif//__dbusxx__callmanager_glue_h__ADAPTOR_MARSHAL_H
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment