2012-05-07 14:50:25 -07:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
2012-08-20 20:21:24 -07:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-07 14:50:25 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_ipc_dbus_gonk_dbusthread_h__
|
|
|
|
#define mozilla_ipc_dbus_gonk_dbusthread_h__
|
|
|
|
|
2013-01-14 02:50:27 -08:00
|
|
|
#include "nscore.h"
|
|
|
|
|
|
|
|
class nsIRunnable;
|
2012-06-02 11:23:16 -07:00
|
|
|
|
2012-05-07 14:50:25 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
2013-01-14 02:50:27 -08:00
|
|
|
/**
|
2012-06-02 11:23:16 -07:00
|
|
|
* Starts the DBus thread, which handles returning signals to objects
|
|
|
|
* that call asynchronous functions. This should be called from the
|
|
|
|
* main thread at startup.
|
|
|
|
*
|
|
|
|
* @return True on thread starting correctly, false otherwise
|
|
|
|
*/
|
2012-05-07 14:50:25 -07:00
|
|
|
bool StartDBus();
|
|
|
|
|
2013-01-14 02:50:27 -08:00
|
|
|
/**
|
2012-06-02 11:23:16 -07:00
|
|
|
* Stop the DBus thread, assuming it's currently running. Should be
|
|
|
|
* called from main thread.
|
|
|
|
*
|
|
|
|
* @return True on thread stopping correctly, false otherwise
|
|
|
|
*/
|
2012-05-07 14:50:25 -07:00
|
|
|
bool StopDBus();
|
2012-06-02 11:23:16 -07:00
|
|
|
|
2013-01-14 02:50:27 -08:00
|
|
|
/**
|
|
|
|
* Dispatch an event to the DBus thread
|
|
|
|
*
|
|
|
|
* @param event An nsIRunnable to run in the DBus thread
|
|
|
|
* @return NS_OK on success, or an error code otherwise
|
|
|
|
*/
|
|
|
|
nsresult
|
|
|
|
DispatchToDBusThread(nsIRunnable* event);
|
|
|
|
|
2012-05-07 14:50:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-14 02:50:27 -08:00
|
|
|
#endif
|