~saviq/unity/phablet-mods.bump-release

« back to all changes in this revision

Viewing changes to UnityCore/GLibWrapper.h

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-03-21 20:19:33 UTC
  • mfrom: (3227.3.8 gcancellable)
  • Revision ID: tarmac-20130321201933-awbehlr4ig3zva61
GLibWrapper: added glib::Cancellable.

Approved by PS Jenkins bot, Andrea Azzarone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <string>
26
26
 
27
27
#include <boost/utility.hpp>
 
28
#include <gio/gio.h>
28
29
#include <glib.h>
29
30
#include <glib-object.h>
30
31
 
125
126
  gchar* string_;
126
127
};
127
128
 
 
129
class Cancellable : boost::noncopyable
 
130
{
 
131
public:
 
132
  Cancellable();
 
133
  ~Cancellable();
 
134
 
 
135
  operator GCancellable*();
 
136
  operator Object<GCancellable>();
 
137
 
 
138
  Object<GCancellable> Get() const;
 
139
  bool IsCancelled() const;
 
140
  bool IsCancelled(glib::Error &error) const;
 
141
  void Cancel();
 
142
  void Reset();
 
143
  void Renew();
 
144
 
 
145
private:
 
146
  Object<GCancellable> cancellable_;
 
147
};
 
148
 
 
149
bool operator==(Cancellable const& lhs, Cancellable const& rhs);
 
150
bool operator!=(Cancellable const& lhs, Cancellable const& rhs);
 
151
bool operator==(GCancellable* lhs, Cancellable const& rhs);
 
152
bool operator!=(GCancellable* lhs, Cancellable const& rhs);
 
153
bool operator==(Object<GCancellable> const& lhs, Cancellable const& rhs);
 
154
bool operator!=(Object<GCancellable> const& lhs, Cancellable const& rhs);
 
155
 
128
156
std::ostream& operator<<(std::ostream& o, Error const& e);
129
157
std::ostream& operator<<(std::ostream& o, String const& s);
130
158