--- /dev/null
+/**
+ * Browser D-Bus Bridge, XPCOM version
+ *
+ * Copyright © 2008 Movial Creative Technologies Inc
+ * Contact: Movial Creative Technologies Inc, <info@movial.com>
+ * Authors: Lauri Mylläri, <lauri.myllari@movial.fi>
+ * Kalle Vahlman, <kalle.vahlman@movial.com>
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the Browser D-Bus Bridge, XPCOM version.
+ *
+ * The Initial Developer of the Original Code is Movial Creative Technologies
+ * Inc. Portions created by Initial Developer are Copyright (C) 2008
+ * Movial Creative Technologies Inc. All Rights Reserved.
+ *
+ */
+
+#include <stdio.h>
+#include <dbus/dbus.h>
+
+#include "DBusDataCarrier.h"
+
+#include "bdb-debug.h"
+
+
+NS_IMPL_ISUPPORTS1(DBusDataCarrier, IDBusDataCarrier)
+
+DBusDataCarrier::DBusDataCarrier() :
+ mSig(),
+ mValue(0)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+}
+
+DBusDataCarrier::~DBusDataCarrier()
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+}
+
+/* attribute ACString type; */
+NS_IMETHODIMP DBusDataCarrier::GetType(nsACString & aType)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ aType.Assign(mType);
+ return NS_OK;
+}
+NS_IMETHODIMP DBusDataCarrier::SetType(const nsACString & aType)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ mType.Assign(aType);
+ return NS_OK;
+}
+
+/* attribute ACString signature; */
+NS_IMETHODIMP DBusDataCarrier::GetSignature(nsACString & aSignature)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ aSignature.Assign(mSig);
+ return NS_OK;
+}
+NS_IMETHODIMP DBusDataCarrier::SetSignature(const nsACString & aSignature)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ mSig.Assign(aSignature);
+ return NS_OK;
+}
+
+/* attribute nsIVariant value; */
+NS_IMETHODIMP DBusDataCarrier::GetValue(nsIVariant * *aValue)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ *aValue = mValue;
+ return NS_OK;
+}
+NS_IMETHODIMP DBusDataCarrier::SetValue(nsIVariant * aValue)
+{
+ BDBLOG(("%s\n", __FUNCTION__));
+ mValue = aValue;
+ return NS_OK;
+}
+
--- /dev/null
+/**
+ * Browser D-Bus Bridge, XPCOM version
+ *
+ * Copyright © 2008 Movial Creative Technologies Inc
+ * Contact: Movial Creative Technologies Inc, <info@movial.com>
+ * Authors: Kalle Vahlman, <kalle.vahlman@movial.com>
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the Browser D-Bus Bridge, XPCOM version.
+ *
+ * The Initial Developer of the Original Code is Movial Creative Technologies
+ * Inc. Portions created by Initial Developer are Copyright (C) 2008
+ * Movial Creative Technologies Inc. All Rights Reserved.
+ *
+ */
+
+#ifndef __DBUSDATACARRIER_H__
+#define __DBUSDATACARRIER_H__
+
+#include "nsEmbedString.h"
+#include "nsWeakReference.h"
+#include "nsIXPConnect.h"
+
+#include "IDBusService.h"
+
+#define DBUSDATACARRIER_CID \
+{ \
+ 0x6dbaa8b4, \
+ 0x3d38, \
+ 0x4897, \
+ { 0x81, 0xb0, 0x52, 0xa1, 0xba, 0xfb, 0x38, 0xec } \
+}
+
+class DBusDataCarrier : public IDBusDataCarrier
+{
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_IDBUSDATACARRIER
+
+ DBusDataCarrier();
+
+private:
+ ~DBusDataCarrier();
+
+protected:
+
+ nsCString mType;
+ nsCString mSig;
+ nsCOMPtr<nsIVariant> mValue;
+};
+
+#endif /* __DBUSDATACARRIER_H__ */
+
+/* vim: set cindent ts=4 et sw=4: */
#include "DBusService.h"
#include "DBusMethod.h"
#include "DBusSignal.h"
+#include "DBusDataCarrier.h"
#include "DBusMarshaling.h"
#include "bdb-debug.h"
//
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DBusService, DBusService::GetSingleton);
+NS_GENERIC_FACTORY_CONSTRUCTOR(DBusDataCarrier);
static const nsModuleComponentInfo components[] =
{
DBUSSIGNAL_CID,
"@movial.fi/dbus/signal;1",
nsnull
+ },
+ {
+ "DBus data carrier",
+ DBUSDATACARRIER_CID,
+ "@movial.fi/dbus/datacarrier;1",
+ DBusDataCarrierConstructor
}
};
NS_IMPL_NSGETMODULE(nsDBusServiceModule, components);
-
-
-
/* vim: set cindent ts=4 et sw=4: */
};
-
+[scriptable, uuid(1b4d9698-c1e7-4940-80b9-76bab02149f9)]
+interface IDBusDataCarrier : nsISupports
+{
+ attribute ACString type;
+ attribute ACString signature;
+ attribute nsIVariant value;
+};
/* vim: set cindent ts=8 et sw=8: */