diff options
author | Mathias Hasselmann <hasselmm@gnome.org> | 2010-01-10 00:43:02 +0100 |
---|---|---|
committer | Mathias Hasselmann <hasselmm@gnome.org> | 2010-01-10 00:43:03 +0100 |
commit | 9f8ee8d8bb0fde950650560d77f79aec1e81512a (patch) | |
tree | d1a7196906915b84255d4a037542355908f03b39 /src/browser-extension/tgChannelProxy.h | |
parent | bcea784a38f6bb23b51c83066eff1c5e222279ee (diff) |
Add a browser extension which provides a D-Bus interface for accessing
Faceboook without violating their terms of service.
Diffstat (limited to 'src/browser-extension/tgChannelProxy.h')
-rw-r--r-- | src/browser-extension/tgChannelProxy.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/browser-extension/tgChannelProxy.h b/src/browser-extension/tgChannelProxy.h new file mode 100644 index 0000000..98a7bec --- /dev/null +++ b/src/browser-extension/tgChannelProxy.h @@ -0,0 +1,68 @@ +/* telepathy-gruschler - A Telepathy connection manager for social networks. + * Copyright (C) 2009 Mathias Hasselmann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __TG_CHANNEL_PROXY_H__ +#define __TG_CHANNEL_PROXY_H__ + +#include "nsCOMPtr.h" +#include "nsIChannel.h" +#include "nsIStreamListener.h" +#include "nsITimer.h" +#include "tgDBusService.h" + +#define TG_CHANNEL_PROXY_DBUS_PATH "/org/freedesktop/Telepathy/Gruschler/ChannelProxy/" +#define TG_CHANNEL_PROXY_DBUS_INTERFACE "org.freedesktop.Telepathy.Gruschler.ChannelProxy" + +class tgChannelProxy: + public nsIStreamListener, + public tgDBusService +{ + NS_DECL_ISUPPORTS; + NS_DECL_NSIREQUESTOBSERVER; + NS_DECL_NSISTREAMLISTENER; + +public: + tgChannelProxy(); + +private: + ~tgChannelProxy(); + +public: + NS_METHOD Init(nsIChannel * aChannel, DBusConnection * aConnection); + NS_IMETHOD GetObjectPath(nsCString & aObjectPath); + +protected: + virtual DBusMessage * OnMethodCall(DBusConnection * aConnection, DBusMessage * aMessage); + +private: + static void OnProxyTimeout(nsITimer *aTimer, void * aClosure); + + DBusMessage * OnIntrospect(DBusConnection * aConnection, DBusMessage * aMessage); + DBusMessage * OnOpen(DBusConnection * aConnection, DBusMessage * aMessage); + +private: + nsCOMPtr<nsIChannel> channel; + nsCOMPtr<nsITimer> timer; + + DBusConnection * connection; + nsCString objectPath; + static int lastId; + +}; + +#endif /* __CHANNEL_PROXY_H__ */ + |