ngDBusConnection.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN NIGHTINGALE GPL
4 //
5 // This file is part of the Nightingale web player.
6 //
7 // http://getnightingale.com
8 //
9 // This file may be licensed under the terms of of the
10 // GNU General Public License Version 2 (the "GPL").
11 //
12 // Software distributed under the License is distributed
13 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
14 // express or implied. See the GPL for the specific language
15 // governing rights and limitations.
16 //
17 // You should have received a copy of the GPL along with this
18 // program. If not, go to http://www.gnu.org/licenses/gpl.html
19 // or write to the Free Software Foundation, Inc.,
20 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 //
22 // END NIGHTINGALE GPL
23 //
24 */
25 
26 /*
27  * Written by Logan F. Smyth Š 2009
28  * http://logansmyth.com
29  * me@logansmyth.com
30  */
31 
32 
33 
34 #ifndef __DEFINE_NGMPRIS_H__
35 #define __DEFINE_NGMPRIS_H__
36 
37 #include "ngIMpris.h"
38 
39 #include <deque>
40 
41 #include <dbus/dbus.h>
42 #include <nsAutoPtr.h>
43 #include <nsCOMPtr.h>
44 #include <nsIObserver.h>
45 
46 class sbDBusConnection;
47 class nsITimer;
48 
49 
50 union ngDBusBasicValue { char* string; unsigned char bytes[8]; };
51 
52 /* Header file */
54 {
55 public:
57  NS_DECL_NSIOBSERVER
58  NS_DECL_NGIDBUSCONNECTION
59 
61  virtual ~ngDBusConnection();
62 
63 private:
64  NS_IMETHOD Check();
65  const char* ngTypeToDBusType(const int ngType) const;
66 
67 protected:
68  nsAutoPtr<sbDBusConnection> mConn;
69  DBusMessage *signal_msg;
71  std::deque<DBusMessageIter*> outgoing_args;
72  DBusMessageIter incoming_args;
73  nsCOMPtr<nsITimer> mTimer;
74  /* additional members */
75 };
76 
77 #endif
NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER NS_DECL_NGIDBUSCONNECTION ngDBusConnection()
std::deque< DBusMessageIter * > outgoing_args
DBusMessageIter incoming_args
nsAutoPtr< sbDBusConnection > mConn
virtual ~ngDBusConnection()
DBusMessage * signal_msg
ngIMethodHandler * mHandler
unsigned char bytes[8]
nsCOMPtr< nsITimer > mTimer