OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
BluezOBEXTransfer.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  */
10 #ifndef BLUEZOBEXTRANSFER_H_
11 #define BLUEZOBEXTRANSFER_H_
12 #include <gio/gio.h>
13 #include <string>
14 
19 {
20  public:
21  enum Status {
27  };
28 
33 
37  virtual ~BluezOBEXTransfer();
38 
39  bool init(GDBusConnection* connection, const std::string& objectPath);
40 
41  bool isInitialized();
42 
43  void clean();
44 
45  bool cancel();
46 
47  bool suspend();
48 
49  bool resume();
50 
51  Status getStatus();
52 
53  typedef void (*StatusChangeCallback) (Status status, void* userData);
54 
55  void setCallback(StatusChangeCallback cb, void* userData);
56 
57  private:
62 
66  BluezOBEXTransfer& operator=(BluezOBEXTransfer const &other);
67 
68  enum InitResult
69  {
70  eInitResultNotInitialized = 0,
71  eInitResultOK,
72  eInitResultFail
73  };
74  static void propertiesChangedHandler(GDBusProxy *proxy,
75  GVariant *changed_properties,
76  GStrv invalidated_properties,
77  gpointer user_data);
78 
79  static void* threadFuncTransfer(void* ptr);
80 
81  GDBusProxy* transfer1Proxy;
82  GDBusConnection* connection;
83  GMainLoop* mainLoop;
84  pthread_t eventsThread;
85  bool threadCreated;
86  std::string path;
87  Status status;
88  InitResult initResult;
89  StatusChangeCallback callback;
90  void* callbackUserData;
91 };
92 #endif // BLUEZOBEXTRANSFER_H_
bool resume()
Definition: BluezOBEXTransfer.cpp:180
bool isInitialized()
Definition: BluezOBEXTransfer.cpp:110
Documentation for class BluezOBEXTransfer.
Definition: BluezOBEXTransfer.hpp:18
bool init(GDBusConnection *connection, const std::string &objectPath)
Definition: BluezOBEXTransfer.cpp:68
virtual ~BluezOBEXTransfer()
Destructor, virtual by default.
Definition: BluezOBEXTransfer.cpp:115
bool suspend()
Definition: BluezOBEXTransfer.cpp:153
void(* StatusChangeCallback)(Status status, void *userData)
Definition: BluezOBEXTransfer.hpp:53
BluezOBEXTransfer()
Constructor.
Definition: BluezOBEXTransfer.cpp:16
Definition: BluezOBEXTransfer.hpp:23
bool cancel()
Definition: BluezOBEXTransfer.cpp:120
Definition: BluezOBEXTransfer.hpp:22
Definition: BluezOBEXTransfer.hpp:26
void clean()
Definition: BluezOBEXTransfer.cpp:90
Status
Definition: BluezOBEXTransfer.hpp:21
void setCallback(StatusChangeCallback cb, void *userData)
Definition: BluezOBEXTransfer.cpp:212
Status getStatus()
Definition: BluezOBEXTransfer.cpp:207
Definition: BluezOBEXTransfer.hpp:24
Definition: BluezOBEXTransfer.hpp:25