Add enum value and definition for HEIF image format
[platform/upstream/libmtp.git] / src / libmtp.h.in
1 /**
2  * \file libmtp.h
3  * Interface to the Media Transfer Protocol library.
4  *
5  * Copyright (C) 2005-2013 Linus Walleij <triad@df.lth.se>
6  * Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com>
7  * Copyright (C) 2007 Ted Bullock <tbullock@canada.com>
8  * Copyright (C) 2008 Florent Mertens <flomertens@gmail.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  *
25  * <code>
26  * #include <libmtp.h>
27  * </code>
28  */
29 #ifndef LIBMTP_H_INCLUSION_GUARD
30 #define LIBMTP_H_INCLUSION_GUARD
31
32 #define LIBMTP_VERSION @VERSION@
33 #define LIBMTP_VERSION_STRING "@VERSION@"
34
35 /* This handles MSVC pecularities */
36 #ifdef _MSC_VER
37 #include <windows.h>
38 #define __WIN32__
39 #define snprintf _snprintf
40 #define ssize_t SSIZE_T
41 /*
42  * Types that do not exist in Windows
43  * sys/types.h, but they exist in mingw32
44  * sys/types.h.
45  */
46 typedef char int8_t;
47 typedef unsigned char uint8_t;
48 typedef __int16 int16_t;
49 typedef unsigned __int16 uint16_t;
50 typedef __int32 int32_t;
51 typedef unsigned __int32 uint32_t;
52 typedef unsigned __int64 uint64_t;
53 #endif
54
55 #include <stdio.h>
56 #include <stdint.h>
57 /* We use time_t */
58 #include <time.h>
59
60 /**
61  * @defgroup types libmtp global type definitions
62  * @{
63  */
64
65 /**
66  * The debug flags defined here are the external flags used
67  * by the libmtp library interface.
68  *
69  * Please keep this list in sync with libmtp.c.
70  */
71 #define LIBMTP_DEBUG_NONE               0x00
72 #define LIBMTP_DEBUG_PTP                0x01
73 #define LIBMTP_DEBUG_PLST               0x02
74 #define LIBMTP_DEBUG_USB                0x04
75 #define LIBMTP_DEBUG_DATA               0x08
76 #define LIBMTP_DEBUG_ALL                0xFF
77
78
79 /**
80  * The filetypes defined here are the external types used
81  * by the libmtp library interface. The types used internally
82  * as PTP-defined enumerator types is something different.
83  */
84 typedef enum {
85   LIBMTP_FILETYPE_FOLDER,
86   LIBMTP_FILETYPE_WAV,
87   LIBMTP_FILETYPE_MP3,
88   LIBMTP_FILETYPE_WMA,
89   LIBMTP_FILETYPE_OGG,
90   LIBMTP_FILETYPE_AUDIBLE,
91   LIBMTP_FILETYPE_MP4,
92   LIBMTP_FILETYPE_UNDEF_AUDIO,
93   LIBMTP_FILETYPE_WMV,
94   LIBMTP_FILETYPE_AVI,
95   LIBMTP_FILETYPE_MPEG,
96   LIBMTP_FILETYPE_ASF,
97   LIBMTP_FILETYPE_QT,
98   LIBMTP_FILETYPE_UNDEF_VIDEO,
99   LIBMTP_FILETYPE_JPEG,
100   LIBMTP_FILETYPE_JFIF,
101   LIBMTP_FILETYPE_TIFF,
102   LIBMTP_FILETYPE_BMP,
103   LIBMTP_FILETYPE_GIF,
104   LIBMTP_FILETYPE_PICT,
105   LIBMTP_FILETYPE_PNG,
106   LIBMTP_FILETYPE_VCALENDAR1,
107   LIBMTP_FILETYPE_VCALENDAR2,
108   LIBMTP_FILETYPE_VCARD2,
109   LIBMTP_FILETYPE_VCARD3,
110   LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT,
111   LIBMTP_FILETYPE_WINEXEC,
112   LIBMTP_FILETYPE_TEXT,
113   LIBMTP_FILETYPE_HTML,
114   LIBMTP_FILETYPE_FIRMWARE,
115   LIBMTP_FILETYPE_AAC,
116   LIBMTP_FILETYPE_MEDIACARD,
117   LIBMTP_FILETYPE_FLAC,
118   LIBMTP_FILETYPE_MP2,
119   LIBMTP_FILETYPE_M4A,
120   LIBMTP_FILETYPE_DOC,
121   LIBMTP_FILETYPE_XML,
122   LIBMTP_FILETYPE_XLS,
123   LIBMTP_FILETYPE_PPT,
124   LIBMTP_FILETYPE_MHT,
125   LIBMTP_FILETYPE_JP2,
126   LIBMTP_FILETYPE_JPX,
127   LIBMTP_FILETYPE_ALBUM,
128   LIBMTP_FILETYPE_PLAYLIST,
129   LIBMTP_FILETYPE_UNKNOWN,
130 #ifdef TIZEN_EXT
131   //helper enum value
132   LIBMTP_FILETYPE_ALL,
133   LIBMTP_FILETYPE_ALL_IMAGE,
134   LIBMTP_FILETYPE_HEIF,
135 #endif /* TIZEN_EXT */
136 } LIBMTP_filetype_t;
137
138 /**
139  * \def LIBMTP_FILETYPE_IS_AUDIO
140  * Audio filetype test.
141  *
142  * For filetypes that can be either audio
143  * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO
144  */
145 #define LIBMTP_FILETYPE_IS_AUDIO(a)\
146 (a == LIBMTP_FILETYPE_WAV ||\
147  a == LIBMTP_FILETYPE_MP3 ||\
148  a == LIBMTP_FILETYPE_MP2 ||\
149  a == LIBMTP_FILETYPE_WMA ||\
150  a == LIBMTP_FILETYPE_OGG ||\
151  a == LIBMTP_FILETYPE_FLAC ||\
152  a == LIBMTP_FILETYPE_AAC ||\
153  a == LIBMTP_FILETYPE_M4A ||\
154  a == LIBMTP_FILETYPE_AUDIBLE ||\
155  a == LIBMTP_FILETYPE_UNDEF_AUDIO)
156
157 /**
158  *  \def LIBMTP_FILETYPE_IS_VIDEO
159  *  Video filetype test.
160  *
161  * For filetypes that can be either audio
162  * or video, use LIBMTP_FILETYPE_IS_AUDIOVIDEO
163  */
164 #define LIBMTP_FILETYPE_IS_VIDEO(a)\
165 (a == LIBMTP_FILETYPE_WMV ||\
166  a == LIBMTP_FILETYPE_AVI ||\
167  a == LIBMTP_FILETYPE_MPEG ||\
168  a == LIBMTP_FILETYPE_UNDEF_VIDEO)
169
170 /**
171  *  \def LIBMTP_FILETYPE_IS_AUDIOVIDEO
172  *  Audio and&slash;or video filetype test.
173  */
174 #define LIBMTP_FILETYPE_IS_AUDIOVIDEO(a)\
175 (a == LIBMTP_FILETYPE_MP4 ||\
176  a == LIBMTP_FILETYPE_ASF ||\
177  a == LIBMTP_FILETYPE_QT)
178
179 /**
180  *  \def LIBMTP_FILETYPE_IS_TRACK
181  *  Test if filetype is a track.
182  *  Use this to determine if the File API or Track API
183  *  should be used to upload or download an object.
184  */
185 #define LIBMTP_FILETYPE_IS_TRACK(a)\
186 (LIBMTP_FILETYPE_IS_AUDIO(a) ||\
187  LIBMTP_FILETYPE_IS_VIDEO(a) ||\
188  LIBMTP_FILETYPE_IS_AUDIOVIDEO(a))
189
190 /**
191  *  \def LIBMTP_FILETYPE_IS_IMAGE
192  *  Image filetype test
193  */
194 #define LIBMTP_FILETYPE_IS_IMAGE(a)\
195 (a == LIBMTP_FILETYPE_JPEG ||\
196 a == LIBMTP_FILETYPE_JFIF ||\
197 a == LIBMTP_FILETYPE_TIFF ||\
198 a == LIBMTP_FILETYPE_BMP ||\
199 a == LIBMTP_FILETYPE_GIF ||\
200 a == LIBMTP_FILETYPE_PICT ||\
201 a == LIBMTP_FILETYPE_PNG ||\
202 a == LIBMTP_FILETYPE_JP2 ||\
203 a == LIBMTP_FILETYPE_JPX ||\
204 a == LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT)
205
206 /**
207  *  \def LIBMTP_FILETYPE_IS_ADDRESSBOOK
208  *  Addressbook and Business card filetype test
209  */
210 #define LIBMTP_FILETYPE_IS_ADDRESSBOOK(a)\
211 (a == LIBMTP_FILETYPE_VCARD2 ||\
212 a == LIBMTP_FILETYPE_VCARD3)
213
214 /**
215  *  \def LIBMTP_FILETYPE_IS_CALENDAR
216  *  Calendar and Appointment filetype test
217  */
218 #define LIBMTP_FILETYPE_IS_CALENDAR(a)\
219 (a == LIBMTP_FILETYPE_VCALENDAR1 ||\
220 a == LIBMTP_FILETYPE_VCALENDAR2)
221
222 /**
223  * The properties defined here are the external types used
224  * by the libmtp library interface.
225  */
226 typedef enum {
227   LIBMTP_PROPERTY_StorageID,
228   LIBMTP_PROPERTY_ObjectFormat,
229   LIBMTP_PROPERTY_ProtectionStatus,
230   LIBMTP_PROPERTY_ObjectSize,
231   LIBMTP_PROPERTY_AssociationType,
232   LIBMTP_PROPERTY_AssociationDesc,
233   LIBMTP_PROPERTY_ObjectFileName,
234   LIBMTP_PROPERTY_DateCreated,
235   LIBMTP_PROPERTY_DateModified,
236   LIBMTP_PROPERTY_Keywords,
237   LIBMTP_PROPERTY_ParentObject,
238   LIBMTP_PROPERTY_AllowedFolderContents,
239   LIBMTP_PROPERTY_Hidden,
240   LIBMTP_PROPERTY_SystemObject,
241   LIBMTP_PROPERTY_PersistantUniqueObjectIdentifier,
242   LIBMTP_PROPERTY_SyncID,
243   LIBMTP_PROPERTY_PropertyBag,
244   LIBMTP_PROPERTY_Name,
245   LIBMTP_PROPERTY_CreatedBy,
246   LIBMTP_PROPERTY_Artist,
247   LIBMTP_PROPERTY_DateAuthored,
248   LIBMTP_PROPERTY_Description,
249   LIBMTP_PROPERTY_URLReference,
250   LIBMTP_PROPERTY_LanguageLocale,
251   LIBMTP_PROPERTY_CopyrightInformation,
252   LIBMTP_PROPERTY_Source,
253   LIBMTP_PROPERTY_OriginLocation,
254   LIBMTP_PROPERTY_DateAdded,
255   LIBMTP_PROPERTY_NonConsumable,
256   LIBMTP_PROPERTY_CorruptOrUnplayable,
257   LIBMTP_PROPERTY_ProducerSerialNumber,
258   LIBMTP_PROPERTY_RepresentativeSampleFormat,
259   LIBMTP_PROPERTY_RepresentativeSampleSize,
260   LIBMTP_PROPERTY_RepresentativeSampleHeight,
261   LIBMTP_PROPERTY_RepresentativeSampleWidth,
262   LIBMTP_PROPERTY_RepresentativeSampleDuration,
263   LIBMTP_PROPERTY_RepresentativeSampleData,
264   LIBMTP_PROPERTY_Width,
265   LIBMTP_PROPERTY_Height,
266   LIBMTP_PROPERTY_Duration,
267   LIBMTP_PROPERTY_Rating,
268   LIBMTP_PROPERTY_Track,
269   LIBMTP_PROPERTY_Genre,
270   LIBMTP_PROPERTY_Credits,
271   LIBMTP_PROPERTY_Lyrics,
272   LIBMTP_PROPERTY_SubscriptionContentID,
273   LIBMTP_PROPERTY_ProducedBy,
274   LIBMTP_PROPERTY_UseCount,
275   LIBMTP_PROPERTY_SkipCount,
276   LIBMTP_PROPERTY_LastAccessed,
277   LIBMTP_PROPERTY_ParentalRating,
278   LIBMTP_PROPERTY_MetaGenre,
279   LIBMTP_PROPERTY_Composer,
280   LIBMTP_PROPERTY_EffectiveRating,
281   LIBMTP_PROPERTY_Subtitle,
282   LIBMTP_PROPERTY_OriginalReleaseDate,
283   LIBMTP_PROPERTY_AlbumName,
284   LIBMTP_PROPERTY_AlbumArtist,
285   LIBMTP_PROPERTY_Mood,
286   LIBMTP_PROPERTY_DRMStatus,
287   LIBMTP_PROPERTY_SubDescription,
288   LIBMTP_PROPERTY_IsCropped,
289   LIBMTP_PROPERTY_IsColorCorrected,
290   LIBMTP_PROPERTY_ImageBitDepth,
291   LIBMTP_PROPERTY_Fnumber,
292   LIBMTP_PROPERTY_ExposureTime,
293   LIBMTP_PROPERTY_ExposureIndex,
294   LIBMTP_PROPERTY_DisplayName,
295   LIBMTP_PROPERTY_BodyText,
296   LIBMTP_PROPERTY_Subject,
297   LIBMTP_PROPERTY_Priority,
298   LIBMTP_PROPERTY_GivenName,
299   LIBMTP_PROPERTY_MiddleNames,
300   LIBMTP_PROPERTY_FamilyName,
301   LIBMTP_PROPERTY_Prefix,
302   LIBMTP_PROPERTY_Suffix,
303   LIBMTP_PROPERTY_PhoneticGivenName,
304   LIBMTP_PROPERTY_PhoneticFamilyName,
305   LIBMTP_PROPERTY_EmailPrimary,
306   LIBMTP_PROPERTY_EmailPersonal1,
307   LIBMTP_PROPERTY_EmailPersonal2,
308   LIBMTP_PROPERTY_EmailBusiness1,
309   LIBMTP_PROPERTY_EmailBusiness2,
310   LIBMTP_PROPERTY_EmailOthers,
311   LIBMTP_PROPERTY_PhoneNumberPrimary,
312   LIBMTP_PROPERTY_PhoneNumberPersonal,
313   LIBMTP_PROPERTY_PhoneNumberPersonal2,
314   LIBMTP_PROPERTY_PhoneNumberBusiness,
315   LIBMTP_PROPERTY_PhoneNumberBusiness2,
316   LIBMTP_PROPERTY_PhoneNumberMobile,
317   LIBMTP_PROPERTY_PhoneNumberMobile2,
318   LIBMTP_PROPERTY_FaxNumberPrimary,
319   LIBMTP_PROPERTY_FaxNumberPersonal,
320   LIBMTP_PROPERTY_FaxNumberBusiness,
321   LIBMTP_PROPERTY_PagerNumber,
322   LIBMTP_PROPERTY_PhoneNumberOthers,
323   LIBMTP_PROPERTY_PrimaryWebAddress,
324   LIBMTP_PROPERTY_PersonalWebAddress,
325   LIBMTP_PROPERTY_BusinessWebAddress,
326   LIBMTP_PROPERTY_InstantMessengerAddress,
327   LIBMTP_PROPERTY_InstantMessengerAddress2,
328   LIBMTP_PROPERTY_InstantMessengerAddress3,
329   LIBMTP_PROPERTY_PostalAddressPersonalFull,
330   LIBMTP_PROPERTY_PostalAddressPersonalFullLine1,
331   LIBMTP_PROPERTY_PostalAddressPersonalFullLine2,
332   LIBMTP_PROPERTY_PostalAddressPersonalFullCity,
333   LIBMTP_PROPERTY_PostalAddressPersonalFullRegion,
334   LIBMTP_PROPERTY_PostalAddressPersonalFullPostalCode,
335   LIBMTP_PROPERTY_PostalAddressPersonalFullCountry,
336   LIBMTP_PROPERTY_PostalAddressBusinessFull,
337   LIBMTP_PROPERTY_PostalAddressBusinessLine1,
338   LIBMTP_PROPERTY_PostalAddressBusinessLine2,
339   LIBMTP_PROPERTY_PostalAddressBusinessCity,
340   LIBMTP_PROPERTY_PostalAddressBusinessRegion,
341   LIBMTP_PROPERTY_PostalAddressBusinessPostalCode,
342   LIBMTP_PROPERTY_PostalAddressBusinessCountry,
343   LIBMTP_PROPERTY_PostalAddressOtherFull,
344   LIBMTP_PROPERTY_PostalAddressOtherLine1,
345   LIBMTP_PROPERTY_PostalAddressOtherLine2,
346   LIBMTP_PROPERTY_PostalAddressOtherCity,
347   LIBMTP_PROPERTY_PostalAddressOtherRegion,
348   LIBMTP_PROPERTY_PostalAddressOtherPostalCode,
349   LIBMTP_PROPERTY_PostalAddressOtherCountry,
350   LIBMTP_PROPERTY_OrganizationName,
351   LIBMTP_PROPERTY_PhoneticOrganizationName,
352   LIBMTP_PROPERTY_Role,
353   LIBMTP_PROPERTY_Birthdate,
354   LIBMTP_PROPERTY_MessageTo,
355   LIBMTP_PROPERTY_MessageCC,
356   LIBMTP_PROPERTY_MessageBCC,
357   LIBMTP_PROPERTY_MessageRead,
358   LIBMTP_PROPERTY_MessageReceivedTime,
359   LIBMTP_PROPERTY_MessageSender,
360   LIBMTP_PROPERTY_ActivityBeginTime,
361   LIBMTP_PROPERTY_ActivityEndTime,
362   LIBMTP_PROPERTY_ActivityLocation,
363   LIBMTP_PROPERTY_ActivityRequiredAttendees,
364   LIBMTP_PROPERTY_ActivityOptionalAttendees,
365   LIBMTP_PROPERTY_ActivityResources,
366   LIBMTP_PROPERTY_ActivityAccepted,
367   LIBMTP_PROPERTY_Owner,
368   LIBMTP_PROPERTY_Editor,
369   LIBMTP_PROPERTY_Webmaster,
370   LIBMTP_PROPERTY_URLSource,
371   LIBMTP_PROPERTY_URLDestination,
372   LIBMTP_PROPERTY_TimeBookmark,
373   LIBMTP_PROPERTY_ObjectBookmark,
374   LIBMTP_PROPERTY_ByteBookmark,
375   LIBMTP_PROPERTY_LastBuildDate,
376   LIBMTP_PROPERTY_TimetoLive,
377   LIBMTP_PROPERTY_MediaGUID,
378   LIBMTP_PROPERTY_TotalBitRate,
379   LIBMTP_PROPERTY_BitRateType,
380   LIBMTP_PROPERTY_SampleRate,
381   LIBMTP_PROPERTY_NumberOfChannels,
382   LIBMTP_PROPERTY_AudioBitDepth,
383   LIBMTP_PROPERTY_ScanDepth,
384   LIBMTP_PROPERTY_AudioWAVECodec,
385   LIBMTP_PROPERTY_AudioBitRate,
386   LIBMTP_PROPERTY_VideoFourCCCodec,
387   LIBMTP_PROPERTY_VideoBitRate,
388   LIBMTP_PROPERTY_FramesPerThousandSeconds,
389   LIBMTP_PROPERTY_KeyFrameDistance,
390   LIBMTP_PROPERTY_BufferSize,
391   LIBMTP_PROPERTY_EncodingQuality,
392   LIBMTP_PROPERTY_EncodingProfile,
393   LIBMTP_PROPERTY_BuyFlag,
394   LIBMTP_PROPERTY_UNKNOWN
395 } LIBMTP_property_t;
396
397 /**
398  * These are the data types
399  */
400 typedef enum {
401   LIBMTP_DATATYPE_INT8,
402   LIBMTP_DATATYPE_UINT8,
403   LIBMTP_DATATYPE_INT16,
404   LIBMTP_DATATYPE_UINT16,
405   LIBMTP_DATATYPE_INT32,
406   LIBMTP_DATATYPE_UINT32,
407   LIBMTP_DATATYPE_INT64,
408   LIBMTP_DATATYPE_UINT64,
409 } LIBMTP_datatype_t;
410
411 /**
412  * These are device capabilities
413  */
414 typedef enum {
415   /**
416    * This capability tells whether you can call the funcion getting
417    * partial objects, @see LIBMTP_GetPartialObject()
418    */
419   LIBMTP_DEVICECAP_GetPartialObject,
420   /**
421    * This capability tells whether you can call the function sending
422    * partial objects. @see LIBMTP_SendPartialObject()
423    */
424   LIBMTP_DEVICECAP_SendPartialObject,
425   /**
426    * This capability tells whether you can call the functions editing
427    * objects in-place on a device.
428    * @see LIBMTP_BeginEditObject()
429    * @see LIBMTP_EndEditObject()
430    * @see LIBMTP_TruncateObject()
431    */
432   LIBMTP_DEVICECAP_EditObjects,
433 } LIBMTP_devicecap_t;
434
435 /**
436  * These are the numbered error codes. You can also
437  * get string representations for errors.
438  */
439 typedef enum {
440   LIBMTP_ERROR_NONE,
441   LIBMTP_ERROR_GENERAL,
442   LIBMTP_ERROR_PTP_LAYER,
443   LIBMTP_ERROR_USB_LAYER,
444   LIBMTP_ERROR_MEMORY_ALLOCATION,
445   LIBMTP_ERROR_NO_DEVICE_ATTACHED,
446   LIBMTP_ERROR_STORAGE_FULL,
447   LIBMTP_ERROR_CONNECTING,
448   LIBMTP_ERROR_CANCELLED
449 } LIBMTP_error_number_t;
450
451 typedef struct LIBMTP_device_entry_struct LIBMTP_device_entry_t; /**< @see LIBMTP_device_entry_struct */
452 typedef struct LIBMTP_raw_device_struct LIBMTP_raw_device_t; /**< @see LIBMTP_raw_device_struct */
453 typedef struct LIBMTP_error_struct LIBMTP_error_t; /**< @see LIBMTP_error_struct */
454 typedef struct LIBMTP_allowed_values_struct LIBMTP_allowed_values_t; /**< @see LIBMTP_allowed_values_struct */
455 typedef struct LIBMTP_device_extension_struct LIBMTP_device_extension_t; /** < @see LIBMTP_device_extension_struct */
456 typedef struct LIBMTP_mtpdevice_struct LIBMTP_mtpdevice_t; /**< @see LIBMTP_mtpdevice_struct */
457 typedef struct LIBMTP_file_struct LIBMTP_file_t; /**< @see LIBMTP_file_struct */
458 typedef struct LIBMTP_track_struct LIBMTP_track_t; /**< @see LIBMTP_track_struct */
459 typedef struct LIBMTP_playlist_struct LIBMTP_playlist_t; /**< @see LIBMTP_playlist_struct */
460 typedef struct LIBMTP_album_struct LIBMTP_album_t; /**< @see LIBMTP_album_struct */
461 typedef struct LIBMTP_folder_struct LIBMTP_folder_t; /**< @see LIBMTP_folder_t */
462 typedef struct LIBMTP_object_struct LIBMTP_object_t; /**< @see LIBMTP_object_t */
463 typedef struct LIBMTP_filesampledata_struct LIBMTP_filesampledata_t; /**< @see LIBMTP_filesample_t */
464 typedef struct LIBMTP_devicestorage_struct LIBMTP_devicestorage_t; /**< @see LIBMTP_devicestorage_t */
465
466 /**
467  * The callback type definition. Notice that a progress percentage ratio
468  * is easy to calculate by dividing <code>sent</code> by
469  * <code>total</code>.
470  * @param sent the number of bytes sent so far
471  * @param total the total number of bytes to send
472  * @param data a user-defined dereferencable pointer
473  * @return if anything else than 0 is returned, the current transfer will be
474  *         interrupted / cancelled.
475  */
476 typedef int (* LIBMTP_progressfunc_t) (uint64_t const sent, uint64_t const total,
477                                 void const * const data);
478
479 /**
480  * Callback function for get by handler function
481  * @param params the device parameters
482  * @param priv a user-defined dereferencable pointer
483  * @param wantlen the number of bytes wanted
484  * @param data a buffer to write the data to
485  * @param gotlen pointer to the number of bytes actually written
486  *        to data
487  * @return LIBMTP_HANDLER_RETURN_OK if successful,
488  *         LIBMTP_HANDLER_RETURN_ERROR on error or
489  *         LIBMTP_HANDLER_RETURN_CANCEL to cancel the transfer
490  */
491 typedef uint16_t (* MTPDataGetFunc)     (void* params, void* priv,
492                                         uint32_t wantlen, unsigned char *data, uint32_t *gotlen);
493
494 /**
495  * Callback function for put by handler function
496  * @param params the device parameters
497  * @param priv a user-defined dereferencable pointer
498  * @param sendlen the number of bytes available
499  * @param data a buffer to read the data from
500  * @param putlen pointer to the number of bytes actually read
501  *        from data
502  * @return LIBMTP_HANDLER_RETURN_OK if successful,
503  *         LIBMTP_HANDLER_RETURN_ERROR on error or
504  *         LIBMTP_HANDLER_RETURN_CANCEL to cancel the transfer
505  */
506 typedef uint16_t (* MTPDataPutFunc)     (void* params, void* priv,
507                                         uint32_t sendlen, unsigned char *data, uint32_t *putlen);
508
509 /**
510  * The return codes for the get/put functions
511  */
512 #define LIBMTP_HANDLER_RETURN_OK 0
513 #define LIBMTP_HANDLER_RETURN_ERROR 1
514 #define LIBMTP_HANDLER_RETURN_CANCEL 2
515
516 /**
517  * @}
518  * @defgroup structar libmtp data structures
519  * @{
520  */
521
522 /**
523  * A data structure to hold MTP device entries.
524  */
525 struct LIBMTP_device_entry_struct {
526   char *vendor; /**< The vendor of this device */
527   uint16_t vendor_id; /**< Vendor ID for this device */
528   char *product; /**< The product name of this device */
529   uint16_t product_id; /**< Product ID for this device */
530   uint32_t device_flags; /**< Bugs, device specifics etc */
531 };
532
533 /**
534  * A data structure to hold a raw MTP device connected
535  * to the bus.
536  */
537 struct LIBMTP_raw_device_struct {
538   LIBMTP_device_entry_t device_entry; /**< The device entry for this raw device */
539   uint32_t bus_location; /**< Location of the bus, if device available */
540   uint8_t devnum; /**< Device number on the bus, if device available */
541   uint8_t portnum; /**< Port number on the bus, if device available */
542 };
543
544 /**
545  * A data structure to hold errors from the library.
546  */
547 struct LIBMTP_error_struct {
548   LIBMTP_error_number_t errornumber;
549   char *error_text;
550   LIBMTP_error_t *next;
551 };
552
553 /**
554  * A data structure to hold allowed ranges of values
555  */
556 struct LIBMTP_allowed_values_struct {
557   uint8_t   u8max;
558   uint8_t   u8min;
559   uint8_t   u8step;
560   uint8_t*  u8vals;
561   int8_t    i8max;
562   int8_t    i8min;
563   int8_t    i8step;
564   int8_t*   i8vals;
565   uint16_t  u16max;
566   uint16_t  u16min;
567   uint16_t  u16step;
568   uint16_t* u16vals;
569   int16_t   i16max;
570   int16_t   i16min;
571   int16_t   i16step;
572   int16_t*  i16vals;
573   uint32_t  u32max;
574   uint32_t  u32min;
575   uint32_t  u32step;
576   uint32_t* u32vals;
577   int32_t   i32max;
578   int32_t   i32min;
579   int32_t   i32step;
580   int32_t*  i32vals;
581   uint64_t  u64max;
582   uint64_t  u64min;
583   uint64_t  u64step;
584   uint64_t* u64vals;
585   int64_t   i64max;
586   int64_t   i64min;
587   int64_t   i64step;
588   int64_t*  i64vals;
589   /**
590    * Number of entries in the vals array
591    */
592   uint16_t  num_entries;
593   /**
594    * The datatype specifying which of the above is used
595   */
596   LIBMTP_datatype_t datatype;
597   /**
598    * Non zero for range, 0 for enum
599   */
600   int is_range;
601 };
602
603 /**
604  * MTP device extension holder struct
605  */
606 struct LIBMTP_device_extension_struct {
607   /**
608    * Name of extension e.g. "foo.com"
609    */
610   char *name;
611   /**
612    * Major revision of extension
613    */
614   int major;
615   /**
616    * Minor revision of extension
617    */
618   int minor;
619   /**
620    * Pointer to the next extension or NULL if this is the
621    * last extension.
622    */
623   LIBMTP_device_extension_t *next;
624 };
625
626 /**
627  * Main MTP device object struct
628  */
629 struct LIBMTP_mtpdevice_struct {
630   /**
631    * Object bitsize, typically 32 or 64.
632    */
633   uint8_t object_bitsize;
634   /**
635    * Parameters for this device, must be cast into
636    * \c (PTPParams*) before internal use.
637    */
638   void *params;
639   /**
640    * USB device for this device, must be cast into
641    * \c (PTP_USB*) before internal use.
642    */
643   void *usbinfo;
644   /**
645    * The storage for this device, do not use strings in here without
646    * copying them first, and beware that this list may be rebuilt at
647    * any time.
648    * @see LIBMTP_Get_Storage()
649    */
650   LIBMTP_devicestorage_t *storage;
651   /**
652    * The error stack. This shall be handled using the error getting
653    * and clearing functions, not by dereferencing this list.
654    */
655   LIBMTP_error_t *errorstack;
656   /** The maximum battery level for this device */
657   uint8_t maximum_battery_level;
658   /** Default music folder */
659   uint32_t default_music_folder;
660   /** Default playlist folder */
661   uint32_t default_playlist_folder;
662   /** Default picture folder */
663   uint32_t default_picture_folder;
664   /** Default video folder */
665   uint32_t default_video_folder;
666   /** Default organizer folder */
667   uint32_t default_organizer_folder;
668   /** Default ZENcast folder (only Creative devices...) */
669   uint32_t default_zencast_folder;
670   /** Default Album folder */
671   uint32_t default_album_folder;
672   /** Default Text folder */
673   uint32_t default_text_folder;
674   /** Per device iconv() converters, only used internally */
675   void *cd;
676   /** Extension list */
677   LIBMTP_device_extension_t *extensions;
678   /** Whether the device uses caching, only used internally */
679   int cached;
680
681   /** Pointer to next device in linked list; NULL if this is the last device */
682   LIBMTP_mtpdevice_t *next;
683 };
684
685 /**
686  * MTP file struct
687  */
688 struct LIBMTP_file_struct {
689   uint32_t item_id; /**< Unique item ID */
690   uint32_t parent_id; /**< ID of parent folder */
691   uint32_t storage_id; /**< ID of storage holding this file */
692   char *filename; /**< Filename of this file */
693   uint64_t filesize; /**< Size of file in bytes */
694   time_t modificationdate; /**< Date of last alteration of the file */
695   LIBMTP_filetype_t filetype; /**< Filetype used for the current file */
696   LIBMTP_file_t *next; /**< Next file in list or NULL if last file */
697 };
698
699 /**
700  * MTP track struct
701  */
702 struct LIBMTP_track_struct {
703   uint32_t item_id; /**< Unique item ID */
704   uint32_t parent_id; /**< ID of parent folder */
705   uint32_t storage_id; /**< ID of storage holding this track */
706   char *title; /**< Track title */
707   char *artist; /**< Name of recording artist */
708   char *composer; /**< Name of recording composer */
709   char *genre; /**< Genre name for track */
710   char *album; /**< Album name for track */
711   char *date; /**< Date of original recording as a string */
712   char *filename; /**< Original filename of this track */
713   uint16_t tracknumber; /**< Track number (in sequence on recording) */
714   uint32_t duration; /**< Duration in milliseconds */
715   uint32_t samplerate; /**< Sample rate of original file, min 0x1f80 max 0xbb80 */
716   uint16_t nochannels; /**< Number of channels in this recording 0 = unknown, 1 or 2 */
717   uint32_t wavecodec; /**< FourCC wave codec name */
718   uint32_t bitrate; /**< (Average) bitrate for this file min=1 max=0x16e360 */
719   uint16_t bitratetype; /**< 0 = unused, 1 = constant, 2 = VBR, 3 = free */
720   uint16_t rating; /**< User rating 0-100 (0x00-0x64) */
721   uint32_t usecount; /**< Number of times used/played */
722   uint64_t filesize; /**< Size of track file in bytes */
723   time_t modificationdate; /**< Date of last alteration of the track */
724   LIBMTP_filetype_t filetype; /**< Filetype used for the current track */
725   LIBMTP_track_t *next; /**< Next track in list or NULL if last track */
726 };
727
728 /**
729  * MTP Playlist structure
730  */
731 struct LIBMTP_playlist_struct {
732   uint32_t playlist_id; /**< Unique playlist ID */
733   uint32_t parent_id; /**< ID of parent folder */
734   uint32_t storage_id; /**< ID of storage holding this playlist */
735   char *name; /**< Name of playlist */
736   uint32_t *tracks; /**< The tracks in this playlist */
737   uint32_t no_tracks; /**< The number of tracks in this playlist */
738   LIBMTP_playlist_t *next; /**< Next playlist or NULL if last playlist */
739 };
740
741 /**
742  * MTP Album structure
743  */
744 struct LIBMTP_album_struct {
745   uint32_t album_id; /**< Unique playlist ID */
746   uint32_t parent_id; /**< ID of parent folder */
747   uint32_t storage_id; /**< ID of storage holding this album */
748   char *name; /**< Name of album */
749   char *artist; /**< Name of album artist */
750   char *composer; /**< Name of recording composer */
751   char *genre; /**< Genre of album */
752   uint32_t *tracks; /**< The tracks in this album */
753   uint32_t no_tracks; /**< The number of tracks in this album */
754   LIBMTP_album_t *next; /**< Next album or NULL if last album */
755 };
756
757 /**
758  * MTP Folder structure
759  */
760 struct LIBMTP_folder_struct {
761   uint32_t folder_id; /**< Unique folder ID */
762   uint32_t parent_id; /**< ID of parent folder */
763   uint32_t storage_id; /**< ID of storage holding this folder */
764   char *name; /**< Name of folder */
765   LIBMTP_folder_t *sibling; /**< Next folder at same level or NULL if no more */
766   LIBMTP_folder_t *child; /**< Child folder or NULL if no children */
767 };
768
769 /**
770  * LIBMTP Object RepresentativeSampleData Structure
771  */
772 struct LIBMTP_filesampledata_struct {
773   uint32_t width; /**< Width of sample if it is an image */
774   uint32_t height; /**< Height of sample if it is an image */
775   uint32_t duration; /**< Duration in milliseconds if it is audio */
776   LIBMTP_filetype_t filetype; /**< Filetype used for the sample */
777   uint64_t size; /**< Size of sample data in bytes */
778   char *data; /**< Sample data */
779 };
780
781 /**
782  * LIBMTP Device Storage structure
783  */
784 struct LIBMTP_devicestorage_struct {
785   uint32_t id; /**< Unique ID for this storage */
786   uint16_t StorageType; /**< Storage type */
787   uint16_t FilesystemType; /**< Filesystem type */
788   uint16_t AccessCapability; /**< Access capability */
789   uint64_t MaxCapacity; /**< Maximum capability */
790   uint64_t FreeSpaceInBytes; /**< Free space in bytes */
791   uint64_t FreeSpaceInObjects; /**< Free space in objects */
792   char *StorageDescription; /**< A brief description of this storage */
793   char *VolumeIdentifier; /**< A volume identifier */
794   LIBMTP_devicestorage_t *next; /**< Next storage, follow this link until NULL */
795   LIBMTP_devicestorage_t *prev; /**< Previous storage */
796 };
797
798 #ifdef TIZEN_EXT
799 struct _MTPObjectInfo {
800         uint32_t StorageID;
801         uint16_t ObjectFormat;
802         uint16_t ProtectionStatus;
803         /* In the regular objectinfo this is 32bit,
804          * but we keep the general object size here
805          * that also arrives via other methods and so
806          * use 64bit */
807         uint64_t ObjectCompressedSize;
808         uint16_t ThumbFormat;
809         uint32_t ThumbCompressedSize;
810         uint32_t ThumbPixWidth;
811         uint32_t ThumbPixHeight;
812         uint32_t ImagePixWidth;
813         uint32_t ImagePixHeight;
814         uint32_t ImageBitDepth;
815         uint32_t ParentObject;
816         uint16_t AssociationType;
817         uint32_t AssociationDesc;
818         uint32_t SequenceNumber;
819         char    *Filename;
820         time_t  CaptureDate;
821         time_t  ModificationDate;
822         char    *Keywords;
823 };
824 typedef struct _MTPObjectInfo MTPObjectInfo;
825 #endif /* TIZEN_EXT */
826
827 /**
828  * LIBMTP Event structure
829  * TODO: add all externally visible events here
830  */
831 enum LIBMTP_event_enum {
832   LIBMTP_EVENT_NONE,
833   LIBMTP_EVENT_STORE_ADDED,
834   LIBMTP_EVENT_STORE_REMOVED,
835   LIBMTP_EVENT_OBJECT_ADDED,
836   LIBMTP_EVENT_OBJECT_REMOVED,
837 };
838 typedef enum LIBMTP_event_enum LIBMTP_event_t;
839
840 /** @} */
841
842 /* Make functions available for C++ */
843 #ifdef __cplusplus
844 extern "C" {
845 #endif
846
847 extern int LIBMTP_debug;
848
849 /**
850  * @defgroup internals The libmtp internals API.
851  * @{
852  */
853 void LIBMTP_Set_Debug(int);
854 void LIBMTP_Init(void);
855 int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const);
856 /**
857  * @}
858  * @defgroup basic The basic device management API.
859  * @{
860  */
861 LIBMTP_error_number_t LIBMTP_Detect_Raw_Devices(LIBMTP_raw_device_t **, int *);
862 int LIBMTP_Check_Specific_Device(int busno, int devno);
863 LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *);
864 LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device_Uncached(LIBMTP_raw_device_t *);
865 /* Begin old, legacy interface */
866 LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void);
867 LIBMTP_error_number_t LIBMTP_Get_Connected_Devices(LIBMTP_mtpdevice_t **);
868 uint32_t LIBMTP_Number_Devices_In_List(LIBMTP_mtpdevice_t *);
869 void LIBMTP_Release_Device_List(LIBMTP_mtpdevice_t*);
870 /* End old, legacy interface */
871 void LIBMTP_Release_Device(LIBMTP_mtpdevice_t*);
872 void LIBMTP_Dump_Device_Info(LIBMTP_mtpdevice_t*);
873 int LIBMTP_Reset_Device(LIBMTP_mtpdevice_t*);
874 char *LIBMTP_Get_Manufacturername(LIBMTP_mtpdevice_t*);
875 char *LIBMTP_Get_Modelname(LIBMTP_mtpdevice_t*);
876 char *LIBMTP_Get_Serialnumber(LIBMTP_mtpdevice_t*);
877 char *LIBMTP_Get_Deviceversion(LIBMTP_mtpdevice_t*);
878 char *LIBMTP_Get_Friendlyname(LIBMTP_mtpdevice_t*);
879 int LIBMTP_Set_Friendlyname(LIBMTP_mtpdevice_t*, char const * const);
880 char *LIBMTP_Get_Syncpartner(LIBMTP_mtpdevice_t*);
881 int LIBMTP_Set_Syncpartner(LIBMTP_mtpdevice_t*, char const * const);
882 int LIBMTP_Get_Batterylevel(LIBMTP_mtpdevice_t *,
883                             uint8_t * const,
884                             uint8_t * const);
885 int LIBMTP_Get_Secure_Time(LIBMTP_mtpdevice_t *, char ** const);
886 int LIBMTP_Get_Device_Certificate(LIBMTP_mtpdevice_t *, char ** const);
887 int LIBMTP_Get_Supported_Filetypes(LIBMTP_mtpdevice_t *, uint16_t ** const, uint16_t * const);
888 int LIBMTP_Check_Capability(LIBMTP_mtpdevice_t *, LIBMTP_devicecap_t);
889 LIBMTP_error_t *LIBMTP_Get_Errorstack(LIBMTP_mtpdevice_t*);
890 void LIBMTP_Clear_Errorstack(LIBMTP_mtpdevice_t*);
891 void LIBMTP_Dump_Errorstack(LIBMTP_mtpdevice_t*);
892
893 #define LIBMTP_STORAGE_SORTBY_NOTSORTED 0
894 #define LIBMTP_STORAGE_SORTBY_FREESPACE 1
895 #define LIBMTP_STORAGE_SORTBY_MAXSPACE  2
896
897 int LIBMTP_Get_Storage(LIBMTP_mtpdevice_t *, int const);
898 int LIBMTP_Format_Storage(LIBMTP_mtpdevice_t *, LIBMTP_devicestorage_t *);
899 #ifdef TIZEN_EXT
900 int LIBMTP_Get_Object_Handles(LIBMTP_mtpdevice_t *device, uint32_t storage,
901         uint32_t format, uint32_t parent, uint32_t **object_list, uint32_t *object_num);
902 MTPObjectInfo *LIBMTP_Get_Object_Info(LIBMTP_mtpdevice_t *device, uint32_t object_id);
903 int LIBMTP_Get_Num_Objects(LIBMTP_mtpdevice_t *device, uint32_t format, uint32_t *object_num);
904 #endif /* TIZEN_EXT */
905
906 /**
907  * Get/set arbitrary properties.  These do not update the cache; should only be used on
908  * properties not stored in structs
909  */
910 char *LIBMTP_Get_String_From_Object(LIBMTP_mtpdevice_t *, uint32_t const, LIBMTP_property_t const);
911 uint64_t LIBMTP_Get_u64_From_Object(LIBMTP_mtpdevice_t *, uint32_t const,
912       LIBMTP_property_t const, uint64_t const);
913 uint32_t LIBMTP_Get_u32_From_Object(LIBMTP_mtpdevice_t *, uint32_t const,
914       LIBMTP_property_t const, uint32_t const);
915 uint16_t LIBMTP_Get_u16_From_Object(LIBMTP_mtpdevice_t *, uint32_t const,
916       LIBMTP_property_t const, uint16_t const);
917 uint8_t LIBMTP_Get_u8_From_Object(LIBMTP_mtpdevice_t *, uint32_t const,
918       LIBMTP_property_t const, uint8_t const);
919 int LIBMTP_Set_Object_String(LIBMTP_mtpdevice_t *, uint32_t const,
920       LIBMTP_property_t const, char const * const);
921 int LIBMTP_Set_Object_u32(LIBMTP_mtpdevice_t *, uint32_t const,
922       LIBMTP_property_t const, uint32_t const);
923 int LIBMTP_Set_Object_u16(LIBMTP_mtpdevice_t *, uint32_t const,
924       LIBMTP_property_t const, uint16_t const);
925 int LIBMTP_Set_Object_u8(LIBMTP_mtpdevice_t *, uint32_t const,
926       LIBMTP_property_t const, uint8_t const);
927 char const * LIBMTP_Get_Property_Description(LIBMTP_property_t inproperty);
928 int LIBMTP_Is_Property_Supported(LIBMTP_mtpdevice_t*, LIBMTP_property_t const,
929             LIBMTP_filetype_t const);
930 int LIBMTP_Get_Allowed_Property_Values(LIBMTP_mtpdevice_t*, LIBMTP_property_t const,
931             LIBMTP_filetype_t const, LIBMTP_allowed_values_t*);
932 void LIBMTP_destroy_allowed_values_t(LIBMTP_allowed_values_t*);
933
934 /**
935  * @}
936  * @defgroup files The file management API.
937  * @{
938  */
939 LIBMTP_file_t *LIBMTP_new_file_t(void);
940 void LIBMTP_destroy_file_t(LIBMTP_file_t*);
941 char const * LIBMTP_Get_Filetype_Description(LIBMTP_filetype_t);
942 LIBMTP_file_t *LIBMTP_Get_Filelisting(LIBMTP_mtpdevice_t *);
943 LIBMTP_file_t *LIBMTP_Get_Filelisting_With_Callback(LIBMTP_mtpdevice_t *,
944       LIBMTP_progressfunc_t const, void const * const);
945 LIBMTP_file_t * LIBMTP_Get_Files_And_Folders(LIBMTP_mtpdevice_t *,
946                                              uint32_t const,
947                                              uint32_t const);
948 LIBMTP_file_t *LIBMTP_Get_Filemetadata(LIBMTP_mtpdevice_t *, uint32_t const);
949 int LIBMTP_Get_File_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * const,
950                         LIBMTP_progressfunc_t const, void const * const);
951 int LIBMTP_Get_File_To_File_Descriptor(LIBMTP_mtpdevice_t*,
952                                        uint32_t const,
953                                        int const,
954                                        LIBMTP_progressfunc_t const,
955                                        void const * const);
956 int LIBMTP_Get_File_To_Handler(LIBMTP_mtpdevice_t *,
957                                uint32_t const,
958                                MTPDataPutFunc,
959                                void *,
960                                LIBMTP_progressfunc_t const,
961                                void const * const);
962 int LIBMTP_Send_File_From_File(LIBMTP_mtpdevice_t *,
963                                char const * const,
964                                LIBMTP_file_t * const,
965                                LIBMTP_progressfunc_t const,
966                                void const * const);
967 int LIBMTP_Send_File_From_File_Descriptor(LIBMTP_mtpdevice_t *,
968                                           int const,
969                                           LIBMTP_file_t * const,
970                                           LIBMTP_progressfunc_t const,
971                                           void const * const);
972 int LIBMTP_Send_File_From_Handler(LIBMTP_mtpdevice_t *,
973                                   MTPDataGetFunc, void *,
974                                   LIBMTP_file_t * const,
975                                   LIBMTP_progressfunc_t const,
976                                   void const * const);
977 int LIBMTP_Set_File_Name(LIBMTP_mtpdevice_t *,
978                          LIBMTP_file_t *,
979                          const char *);
980 LIBMTP_filesampledata_t *LIBMTP_new_filesampledata_t(void);
981 void LIBMTP_destroy_filesampledata_t(LIBMTP_filesampledata_t *);
982 int LIBMTP_Get_Representative_Sample_Format(LIBMTP_mtpdevice_t *,
983                         LIBMTP_filetype_t const,
984                         LIBMTP_filesampledata_t **);
985 int LIBMTP_Send_Representative_Sample(LIBMTP_mtpdevice_t *, uint32_t const,
986                           LIBMTP_filesampledata_t *);
987 int LIBMTP_Get_Representative_Sample(LIBMTP_mtpdevice_t *, uint32_t const,
988                           LIBMTP_filesampledata_t *);
989 int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const,
990                          unsigned char **data, unsigned int *size);
991 #ifdef TIZEN_EXT
992 int LIBMTP_Get_Thumbnail_From_Exif_Data(LIBMTP_mtpdevice_t *, uint32_t const,
993                          unsigned char **data, unsigned int *size);
994 #endif /* TIZEN_EXT */
995
996 /**
997  * @}
998  * @defgroup tracks The track management API.
999  * @{
1000  */
1001 LIBMTP_track_t *LIBMTP_new_track_t(void);
1002 void LIBMTP_destroy_track_t(LIBMTP_track_t*);
1003 LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*);
1004 LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback(LIBMTP_mtpdevice_t*,
1005       LIBMTP_progressfunc_t const, void const * const);
1006 LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback_For_Storage(LIBMTP_mtpdevice_t*, uint32_t const,
1007       LIBMTP_progressfunc_t const, void const * const);
1008 LIBMTP_track_t *LIBMTP_Get_Trackmetadata(LIBMTP_mtpdevice_t*, uint32_t const);
1009 int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * const,
1010                         LIBMTP_progressfunc_t const, void const * const);
1011 int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const, int const,
1012                         LIBMTP_progressfunc_t const, void const * const);
1013 int LIBMTP_Get_Track_To_Handler(LIBMTP_mtpdevice_t *, uint32_t const, MTPDataPutFunc,
1014       void *, LIBMTP_progressfunc_t const, void const * const);
1015 int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *,
1016                          char const * const, LIBMTP_track_t * const,
1017                          LIBMTP_progressfunc_t const,
1018                          void const * const);
1019 int LIBMTP_Send_Track_From_File_Descriptor(LIBMTP_mtpdevice_t *,
1020                          int const, LIBMTP_track_t * const,
1021                          LIBMTP_progressfunc_t const,
1022                          void const * const);
1023 int LIBMTP_Send_Track_From_Handler(LIBMTP_mtpdevice_t *,
1024                          MTPDataGetFunc, void *, LIBMTP_track_t * const,
1025                          LIBMTP_progressfunc_t const,
1026                          void const * const);
1027 int LIBMTP_Update_Track_Metadata(LIBMTP_mtpdevice_t *,
1028                         LIBMTP_track_t const * const);
1029 int LIBMTP_Track_Exists(LIBMTP_mtpdevice_t *, uint32_t const);
1030 int LIBMTP_Set_Track_Name(LIBMTP_mtpdevice_t *, LIBMTP_track_t *, const char *);
1031 /** @} */
1032
1033 /**
1034  * @}
1035  * @defgroup folders The folder management API.
1036  * @{
1037  */
1038 LIBMTP_folder_t *LIBMTP_new_folder_t(void);
1039 void LIBMTP_destroy_folder_t(LIBMTP_folder_t*);
1040 LIBMTP_folder_t *LIBMTP_Get_Folder_List(LIBMTP_mtpdevice_t*);
1041 LIBMTP_folder_t *LIBMTP_Get_Folder_List_For_Storage(LIBMTP_mtpdevice_t*,
1042                                                     uint32_t const);
1043 LIBMTP_folder_t *LIBMTP_Find_Folder(LIBMTP_folder_t*, uint32_t const);
1044 uint32_t LIBMTP_Create_Folder(LIBMTP_mtpdevice_t*, char *, uint32_t, uint32_t);
1045 int LIBMTP_Set_Folder_Name(LIBMTP_mtpdevice_t *, LIBMTP_folder_t *, const char *);
1046 /** @} */
1047
1048
1049 /**
1050  * @}
1051  * @defgroup playlists The audio/video playlist management API.
1052  * @{
1053  */
1054 LIBMTP_playlist_t *LIBMTP_new_playlist_t(void);
1055 void LIBMTP_destroy_playlist_t(LIBMTP_playlist_t *);
1056 LIBMTP_playlist_t *LIBMTP_Get_Playlist_List(LIBMTP_mtpdevice_t *);
1057 LIBMTP_playlist_t *LIBMTP_Get_Playlist(LIBMTP_mtpdevice_t *, uint32_t const);
1058 int LIBMTP_Create_New_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const);
1059 int LIBMTP_Update_Playlist(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t * const);
1060 int LIBMTP_Set_Playlist_Name(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, const char *);
1061
1062 /**
1063  * @}
1064  * @defgroup albums The audio/video album management API.
1065  * @{
1066  */
1067 LIBMTP_album_t *LIBMTP_new_album_t(void);
1068 void LIBMTP_destroy_album_t(LIBMTP_album_t *);
1069 LIBMTP_album_t *LIBMTP_Get_Album_List(LIBMTP_mtpdevice_t *);
1070 LIBMTP_album_t *LIBMTP_Get_Album_List_For_Storage(LIBMTP_mtpdevice_t *, uint32_t const);
1071 LIBMTP_album_t *LIBMTP_Get_Album(LIBMTP_mtpdevice_t *, uint32_t const);
1072 int LIBMTP_Create_New_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t * const);
1073 int LIBMTP_Update_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t const * const);
1074 int LIBMTP_Set_Album_Name(LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const char *);
1075
1076 /**
1077  * @}
1078  * @defgroup objects The object management API.
1079  * @{
1080  */
1081 int LIBMTP_Delete_Object(LIBMTP_mtpdevice_t *, uint32_t);
1082 int LIBMTP_Set_Object_Filename(LIBMTP_mtpdevice_t *, uint32_t , char *);
1083 int LIBMTP_GetPartialObject(LIBMTP_mtpdevice_t *, uint32_t const,
1084                             uint32_t, uint32_t,
1085                             unsigned char **, unsigned int *);
1086 int LIBMTP_SendPartialObject(LIBMTP_mtpdevice_t *, uint32_t const,
1087                              uint64_t, unsigned char *, unsigned int);
1088 int LIBMTP_BeginEditObject(LIBMTP_mtpdevice_t *, uint32_t const);
1089 int LIBMTP_EndEditObject(LIBMTP_mtpdevice_t *, uint32_t const);
1090 int LIBMTP_TruncateObject(LIBMTP_mtpdevice_t *, uint32_t const, uint64_t);
1091
1092 /**
1093  * @}
1094  * @defgroup files The events API.
1095  * @{
1096  */
1097 int LIBMTP_Read_Event(LIBMTP_mtpdevice_t *, LIBMTP_event_t *, uint32_t *);
1098
1099 /** @} */
1100
1101 /* End of C++ exports */
1102 #ifdef __cplusplus
1103 }
1104 #endif
1105
1106 #endif /* LIBMTP_H_INCLUSION_GUARD */
1107