Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

953 řádky
37 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_FILE_INFO_H__
  26. #define __G_FILE_INFO_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_FILE_INFO (g_file_info_get_type ())
  30. #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
  31. #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
  32. #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
  33. #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
  34. #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
  35. /**
  36. * GFileInfo:
  37. *
  38. * Stores information about a file system object referenced by a #GFile.
  39. **/
  40. typedef struct _GFileInfoClass GFileInfoClass;
  41. /* Common Attributes: */
  42. /**
  43. * G_FILE_ATTRIBUTE_STANDARD_TYPE:
  44. *
  45. * A key in the "standard" namespace for storing file types.
  46. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  47. * The value for this key should contain a #GFileType.
  48. **/
  49. #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
  50. /**
  51. * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
  52. *
  53. * A key in the "standard" namespace for checking if a file is hidden.
  54. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  55. **/
  56. #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
  57. /**
  58. * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
  59. *
  60. * A key in the "standard" namespace for checking if a file is a backup file.
  61. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  62. **/
  63. #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
  64. /**
  65. * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
  66. *
  67. * A key in the "standard" namespace for checking if the file is a symlink.
  68. * Typically the actual type is something else, if we followed the symlink
  69. * to get the type.
  70. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  71. **/
  72. #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
  73. /**
  74. * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
  75. *
  76. * A key in the "standard" namespace for checking if a file is virtual.
  77. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  78. **/
  79. #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
  80. /**
  81. * G_FILE_ATTRIBUTE_STANDARD_NAME:
  82. *
  83. * A key in the "standard" namespace for getting the name of the file.
  84. * The name is the on-disk filename which may not be in any known encoding,
  85. * and can thus not be generally displayed as is.
  86. * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
  87. * name in a user interface.
  88. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
  89. **/
  90. #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
  91. /**
  92. * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
  93. *
  94. * A key in the "standard" namespace for getting the display name of the file.
  95. * A display name is guaranteed to be in UTF8 and can thus be displayed in
  96. * the UI.
  97. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  98. **/
  99. #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
  100. /**
  101. * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
  102. *
  103. * A key in the "standard" namespace for edit name of the file.
  104. * An edit name is similar to the display name, but it is meant to be
  105. * used when you want to rename the file in the UI. The display name
  106. * might contain information you don't want in the new filename (such as
  107. * "(invalid unicode)" if the filename was in an invalid encoding).
  108. *
  109. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  110. **/
  111. #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
  112. /**
  113. * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
  114. *
  115. * A key in the "standard" namespace for getting the copy name of the file.
  116. * The copy name is an optional version of the name. If available it's always
  117. * in UTF8, and corresponds directly to the original filename (only transcoded to
  118. * UTF8). This is useful if you want to copy the file to another filesystem that
  119. * might have a different encoding. If the filename is not a valid string in the
  120. * encoding selected for the filesystem it is in then the copy name will not be set.
  121. *
  122. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  123. **/
  124. #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
  125. /**
  126. * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
  127. *
  128. * A key in the "standard" namespace for getting the description of the file.
  129. * The description is a utf8 string that describes the file, generally containing
  130. * the filename, but can also contain furter information. Example descriptions
  131. * could be "filename (on hostname)" for a remote file or "filename (in trash)"
  132. * for a file in the trash. This is useful for instance as the window title
  133. * when displaying a directory or for a bookmarks menu.
  134. *
  135. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  136. **/
  137. #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
  138. /**
  139. * G_FILE_ATTRIBUTE_STANDARD_ICON:
  140. *
  141. * A key in the "standard" namespace for getting the icon for the file.
  142. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
  143. * The value for this key should contain a #GIcon.
  144. **/
  145. #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
  146. /**
  147. * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
  148. *
  149. * A key in the "standard" namespace for getting the content type of the file.
  150. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  151. * The value for this key should contain a valid content type.
  152. **/
  153. #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
  154. /**
  155. * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
  156. *
  157. * A key in the "standard" namespace for getting the fast content type.
  158. * The fast content type isn't as reliable as the regular one, as it
  159. * only uses the filename to guess it, but it is faster to calculate than the
  160. * regular content type.
  161. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  162. *
  163. **/
  164. #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
  165. /**
  166. * G_FILE_ATTRIBUTE_STANDARD_SIZE:
  167. *
  168. * A key in the "standard" namespace for getting the file's size (in bytes).
  169. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
  170. **/
  171. #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
  172. /**
  173. * G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE:
  174. *
  175. * A key in the "standard" namespace for getting the amount of disk space
  176. * that is consumed by the file (in bytes). This will generally be larger
  177. * than the file size (due to block size overhead) but can occasionally be
  178. * smaller (for example, for sparse files).
  179. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
  180. *
  181. * Since: 2.20
  182. **/
  183. #define G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE "standard::allocated-size" /* uint64 */
  184. /**
  185. * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
  186. *
  187. * A key in the "standard" namespace for getting the symlink target, if the file
  188. * is a symlink. Corresponding #GFileAttributeType is
  189. * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
  190. **/
  191. #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
  192. /**
  193. * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
  194. *
  195. * A key in the "standard" namespace for getting the target URI for the file, in
  196. * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
  197. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  198. **/
  199. #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
  200. /**
  201. * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
  202. *
  203. * A key in the "standard" namespace for setting the sort order of a file.
  204. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
  205. * An example use would be in file managers, which would use this key
  206. * to set the order files are displayed. Files with smaller sort order
  207. * should be sorted first, and files without sort order as if sort order
  208. * was zero.
  209. **/
  210. #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
  211. /* Entity tags, used to avoid missing updates on save */
  212. /**
  213. * G_FILE_ATTRIBUTE_ETAG_VALUE:
  214. *
  215. * A key in the "etag" namespace for getting the value of the file's
  216. * entity tag. Corresponding #GFileAttributeType is
  217. * %G_FILE_ATTRIBUTE_TYPE_STRING.
  218. **/
  219. #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
  220. /* File identifier, for e.g. avoiding loops when doing recursive
  221. * directory scanning
  222. */
  223. /**
  224. * G_FILE_ATTRIBUTE_ID_FILE:
  225. *
  226. * A key in the "id" namespace for getting a file identifier.
  227. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  228. * An example use would be during listing files, to avoid recursive
  229. * directory scanning.
  230. **/
  231. #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
  232. /**
  233. * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
  234. *
  235. * A key in the "id" namespace for getting the file system identifier.
  236. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  237. * An example use would be during drag and drop to see if the source
  238. * and target are on the same filesystem (default to move) or not (default
  239. * to copy).
  240. **/
  241. #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
  242. /* Calculated Access Rights for current user */
  243. /**
  244. * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
  245. *
  246. * A key in the "access" namespace for getting read privileges.
  247. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  248. * This attribute will be %TRUE if the user is able to read the file.
  249. **/
  250. #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
  251. /**
  252. * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
  253. *
  254. * A key in the "access" namespace for getting write privileges.
  255. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  256. * This attribute will be %TRUE if the user is able to write to the file.
  257. **/
  258. #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
  259. /**
  260. * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
  261. *
  262. * A key in the "access" namespace for getting execution privileges.
  263. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  264. * This attribute will be %TRUE if the user is able to execute the file.
  265. **/
  266. #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
  267. /**
  268. * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
  269. *
  270. * A key in the "access" namespace for checking deletion privileges.
  271. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  272. * This attribute will be %TRUE if the user is able to delete the file.
  273. **/
  274. #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
  275. /**
  276. * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
  277. *
  278. * A key in the "access" namespace for checking trashing privileges.
  279. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  280. * This attribute will be %TRUE if the user is able to move the file to
  281. * the trash.
  282. **/
  283. #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
  284. /**
  285. * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
  286. *
  287. * A key in the "access" namespace for checking renaming privileges.
  288. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  289. * This attribute will be %TRUE if the user is able to rename the file.
  290. **/
  291. #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
  292. /* TODO: Should we have special version for directories? can_enumerate, etc */
  293. /* Mountable attributes */
  294. /**
  295. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
  296. *
  297. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
  298. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  299. **/
  300. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
  301. /**
  302. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
  303. *
  304. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
  305. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  306. **/
  307. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
  308. /**
  309. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
  310. *
  311. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
  312. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  313. **/
  314. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
  315. /**
  316. * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
  317. *
  318. * A key in the "mountable" namespace for getting the unix device.
  319. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  320. **/
  321. #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
  322. /**
  323. * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE:
  324. *
  325. * A key in the "mountable" namespace for getting the unix device file.
  326. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  327. *
  328. * Since: 2.22
  329. **/
  330. #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE "mountable::unix-device-file" /* string */
  331. /**
  332. * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
  333. *
  334. * A key in the "mountable" namespace for getting the HAL UDI for the mountable
  335. * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  336. **/
  337. #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
  338. /**
  339. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START:
  340. *
  341. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
  342. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  343. *
  344. * Since: 2.22
  345. */
  346. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START "mountable::can-start" /* boolean */
  347. /**
  348. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
  349. *
  350. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started
  351. * degraded.
  352. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  353. *
  354. * Since: 2.22
  355. */
  356. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED "mountable::can-start-degraded" /* boolean */
  357. /**
  358. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP:
  359. *
  360. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
  361. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  362. *
  363. * Since: 2.22
  364. */
  365. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP "mountable::can-stop" /* boolean */
  366. /**
  367. * G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE:
  368. *
  369. * A key in the "mountable" namespace for getting the #GDriveStartStopType.
  370. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  371. *
  372. * Since: 2.22
  373. */
  374. #define G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE "mountable::start-stop-type" /* uint32 (GDriveStartStopType) */
  375. /**
  376. * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
  377. *
  378. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
  379. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  380. *
  381. * Since: 2.22
  382. */
  383. #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL "mountable::can-poll" /* boolean */
  384. /**
  385. * G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC:
  386. *
  387. * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)
  388. * is automatically polled for media.
  389. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  390. *
  391. * Since: 2.22
  392. */
  393. #define G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC "mountable::is-media-check-automatic" /* boolean */
  394. /* Time attributes */
  395. /**
  396. * G_FILE_ATTRIBUTE_TIME_MODIFIED:
  397. *
  398. * A key in the "time" namespace for getting the time the file was last
  399. * modified. Corresponding #GFileAttributeType is
  400. * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
  401. * file was modified.
  402. **/
  403. #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
  404. /**
  405. * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
  406. *
  407. * A key in the "time" namespace for getting the miliseconds of the time
  408. * the file was last modified. This should be used in conjunction with
  409. * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
  410. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  411. **/
  412. #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
  413. /**
  414. * G_FILE_ATTRIBUTE_TIME_ACCESS:
  415. *
  416. * A key in the "time" namespace for getting the time the file was last
  417. * accessed. Corresponding #GFileAttributeType is
  418. * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
  419. * file was last accessed.
  420. **/
  421. #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
  422. /**
  423. * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
  424. *
  425. * A key in the "time" namespace for getting the microseconds of the time
  426. * the file was last accessed. This should be used in conjunction with
  427. * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
  428. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  429. **/
  430. #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
  431. /**
  432. * G_FILE_ATTRIBUTE_TIME_CHANGED:
  433. *
  434. * A key in the "time" namespace for getting the time the file was last
  435. * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
  436. * and contains the UNIX time since the file was last changed.
  437. *
  438. * This corresponds to the traditional UNIX ctime.
  439. **/
  440. #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
  441. /**
  442. * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
  443. *
  444. * A key in the "time" namespace for getting the microseconds of the time
  445. * the file was last changed. This should be used in conjunction with
  446. * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
  447. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  448. **/
  449. #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
  450. /**
  451. * G_FILE_ATTRIBUTE_TIME_CREATED:
  452. *
  453. * A key in the "time" namespace for getting the time the file was created.
  454. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
  455. * and contains the UNIX time since the file was created.
  456. *
  457. * This corresponds to the NTFS ctime.
  458. **/
  459. #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
  460. /**
  461. * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
  462. *
  463. * A key in the "time" namespace for getting the microseconds of the time
  464. * the file was created. This should be used in conjunction with
  465. * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
  466. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  467. **/
  468. #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
  469. /* Unix specific attributes */
  470. /**
  471. * G_FILE_ATTRIBUTE_UNIX_DEVICE:
  472. *
  473. * A key in the "unix" namespace for getting the device id of the device the
  474. * file is located on (see stat() documentation). This attribute is only
  475. * available for UNIX file systems. Corresponding #GFileAttributeType is
  476. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  477. **/
  478. #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
  479. /**
  480. * G_FILE_ATTRIBUTE_UNIX_INODE:
  481. *
  482. * A key in the "unix" namespace for getting the inode of the file.
  483. * This attribute is only available for UNIX file systems. Corresponding
  484. * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
  485. **/
  486. #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
  487. /**
  488. * G_FILE_ATTRIBUTE_UNIX_MODE:
  489. *
  490. * A key in the "unix" namespace for getting the mode of the file
  491. * (e.g. whether the file is a regular file, symlink, etc). See lstat()
  492. * documentation. This attribute is only available for UNIX file systems.
  493. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  494. **/
  495. #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
  496. /**
  497. * G_FILE_ATTRIBUTE_UNIX_NLINK:
  498. *
  499. * A key in the "unix" namespace for getting the number of hard links
  500. * for a file. See lstat() documentation. This attribute is only available
  501. * for UNIX file systems. Corresponding #GFileAttributeType is
  502. * %G_FILE_ATTRIBUTE_TYPE_UINT32.
  503. **/
  504. #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
  505. /**
  506. * G_FILE_ATTRIBUTE_UNIX_UID:
  507. *
  508. * A key in the "unix" namespace for getting the user ID for the file.
  509. * This attribute is only available for UNIX file systems.
  510. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  511. **/
  512. #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
  513. /**
  514. * G_FILE_ATTRIBUTE_UNIX_GID:
  515. *
  516. * A key in the "unix" namespace for getting the group ID for the file.
  517. * This attribute is only available for UNIX file systems.
  518. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  519. **/
  520. #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
  521. /**
  522. * G_FILE_ATTRIBUTE_UNIX_RDEV:
  523. *
  524. * A key in the "unix" namespace for getting the device ID for the file
  525. * (if it is a special file). See lstat() documentation. This attribute
  526. * is only available for UNIX file systems. Corresponding #GFileAttributeType
  527. * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  528. **/
  529. #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
  530. /**
  531. * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
  532. *
  533. * A key in the "unix" namespace for getting the block size for the file
  534. * system. This attribute is only available for UNIX file systems.
  535. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  536. **/
  537. #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
  538. /**
  539. * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
  540. *
  541. * A key in the "unix" namespace for getting the number of blocks allocated
  542. * for the file. This attribute is only available for UNIX file systems.
  543. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
  544. **/
  545. #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
  546. /**
  547. * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
  548. *
  549. * A key in the "unix" namespace for checking if the file represents a
  550. * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
  551. * point. This attribute is only available for UNIX file systems.
  552. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  553. **/
  554. #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
  555. /* DOS specific attributes */
  556. /**
  557. * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
  558. *
  559. * A key in the "dos" namespace for checking if the file's archive flag
  560. * is set. This attribute is %TRUE if the archive flag is set. This attribute
  561. * is only available for DOS file systems. Corresponding #GFileAttributeType
  562. * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  563. **/
  564. #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
  565. /**
  566. * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
  567. *
  568. * A key in the "dos" namespace for checking if the file's backup flag
  569. * is set. This attribute is %TRUE if the backup flag is set. This attribute
  570. * is only available for DOS file systems. Corresponding #GFileAttributeType
  571. * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  572. **/
  573. #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
  574. /* Owner attributes */
  575. /**
  576. * G_FILE_ATTRIBUTE_OWNER_USER:
  577. *
  578. * A key in the "owner" namespace for getting the user name of the
  579. * file's owner. Corresponding #GFileAttributeType is
  580. * %G_FILE_ATTRIBUTE_TYPE_STRING.
  581. **/
  582. #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
  583. /**
  584. * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
  585. *
  586. * A key in the "owner" namespace for getting the real name of the
  587. * user that owns the file. Corresponding #GFileAttributeType is
  588. * %G_FILE_ATTRIBUTE_TYPE_STRING.
  589. **/
  590. #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
  591. /**
  592. * G_FILE_ATTRIBUTE_OWNER_GROUP:
  593. *
  594. * A key in the "owner" namespace for getting the file owner's group.
  595. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  596. **/
  597. #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
  598. /* Thumbnails */
  599. /**
  600. * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
  601. *
  602. * A key in the "thumbnail" namespace for getting the path to the thumbnail
  603. * image. Corresponding #GFileAttributeType is
  604. * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
  605. **/
  606. #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
  607. /**
  608. * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
  609. *
  610. * A key in the "thumbnail" namespace for checking if thumbnailing failed.
  611. * This attribute is %TRUE if thumbnailing failed. Corresponding
  612. * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  613. **/
  614. #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
  615. /* Preview */
  616. /**
  617. * G_FILE_ATTRIBUTE_PREVIEW_ICON:
  618. *
  619. * A key in the "preview" namespace for getting a #GIcon that can be
  620. * used to get preview of the file. For example, it may be a low
  621. * resolution thumbnail without metadata. Corresponding
  622. * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value
  623. * for this key should contain a #GIcon.
  624. *
  625. * Since: 2.20
  626. **/
  627. #define G_FILE_ATTRIBUTE_PREVIEW_ICON "preview::icon" /* object (GIcon) */
  628. /* File system info (for g_file_get_filesystem_info) */
  629. /**
  630. * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
  631. *
  632. * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
  633. * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
  634. * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
  635. **/
  636. #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
  637. /**
  638. * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
  639. *
  640. * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
  641. * file system. Corresponding #GFileAttributeType is
  642. * %G_FILE_ATTRIBUTE_TYPE_UINT64.
  643. **/
  644. #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
  645. /**
  646. * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
  647. *
  648. * A key in the "filesystem" namespace for getting the file system's type.
  649. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  650. **/
  651. #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
  652. /**
  653. * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
  654. *
  655. * A key in the "filesystem" namespace for checking if the file system
  656. * is read only. Is set to %TRUE if the file system is read only.
  657. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
  658. **/
  659. #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
  660. /**
  661. * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
  662. *
  663. * A key in the "filesystem" namespace for hinting a file manager
  664. * application whether it should preview (e.g. thumbnail) files on the
  665. * file system. The value for this key contain a
  666. * #GFilesystemPreviewType.
  667. **/
  668. #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
  669. /**
  670. * G_FILE_ATTRIBUTE_GVFS_BACKEND:
  671. *
  672. * A key in the "gvfs" namespace that gets the name of the current
  673. * GVFS backend in use. Corresponding #GFileAttributeType is
  674. * %G_FILE_ATTRIBUTE_TYPE_STRING.
  675. **/
  676. #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
  677. /**
  678. * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
  679. *
  680. * A key in the "selinux" namespace for getting the file's SELinux
  681. * context. Corresponding #GFileAttributeType is
  682. * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
  683. * available if GLib has been built with SELinux support.
  684. **/
  685. #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
  686. /**
  687. * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
  688. *
  689. * A key in the "trash" namespace. When requested against
  690. * "trash:///" returns the number of (toplevel) items in the trash folder.
  691. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
  692. **/
  693. #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
  694. /**
  695. * G_FILE_ATTRIBUTE_TRASH_ORIG_PATH:
  696. *
  697. * A key in the "trash" namespace. When requested against
  698. * items in "trash:///", will return the original path to the file before it
  699. * was trashed. Corresponding #GFileAttributeType is
  700. * %G_FILE_ATTRIBUTE_TYPE_STRING.
  701. *
  702. * Since: 2.24.
  703. **/
  704. #define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH "trash::orig-path" /* string */
  705. /**
  706. * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE:
  707. *
  708. * A key in the "trash" namespace. When requested against
  709. * items in "trash:///", will return the date and time when the file
  710. * was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss.
  711. * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
  712. *
  713. * Since: 2.24.
  714. **/
  715. #define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE "trash::deletion-date" /* string */
  716. GType g_file_info_get_type (void) G_GNUC_CONST;
  717. GFileInfo * g_file_info_new (void);
  718. GFileInfo * g_file_info_dup (GFileInfo *other);
  719. void g_file_info_copy_into (GFileInfo *src_info,
  720. GFileInfo *dest_info);
  721. gboolean g_file_info_has_attribute (GFileInfo *info,
  722. const char *attribute);
  723. gboolean g_file_info_has_namespace (GFileInfo *info,
  724. const char *name_space);
  725. char ** g_file_info_list_attributes (GFileInfo *info,
  726. const char *name_space);
  727. gboolean g_file_info_get_attribute_data (GFileInfo *info,
  728. const char *attribute,
  729. GFileAttributeType *type,
  730. gpointer *value_pp,
  731. GFileAttributeStatus *status);
  732. GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
  733. const char *attribute);
  734. void g_file_info_remove_attribute (GFileInfo *info,
  735. const char *attribute);
  736. GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
  737. const char *attribute);
  738. gboolean g_file_info_set_attribute_status (GFileInfo *info,
  739. const char *attribute,
  740. GFileAttributeStatus status);
  741. char * g_file_info_get_attribute_as_string (GFileInfo *info,
  742. const char *attribute);
  743. const char * g_file_info_get_attribute_string (GFileInfo *info,
  744. const char *attribute);
  745. const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
  746. const char *attribute);
  747. gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
  748. const char *attribute);
  749. guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
  750. const char *attribute);
  751. gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
  752. const char *attribute);
  753. guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
  754. const char *attribute);
  755. gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
  756. const char *attribute);
  757. GObject * g_file_info_get_attribute_object (GFileInfo *info,
  758. const char *attribute);
  759. char ** g_file_info_get_attribute_stringv (GFileInfo *info,
  760. const char *attribute);
  761. void g_file_info_set_attribute (GFileInfo *info,
  762. const char *attribute,
  763. GFileAttributeType type,
  764. gpointer value_p);
  765. void g_file_info_set_attribute_string (GFileInfo *info,
  766. const char *attribute,
  767. const char *attr_value);
  768. void g_file_info_set_attribute_byte_string (GFileInfo *info,
  769. const char *attribute,
  770. const char *attr_value);
  771. void g_file_info_set_attribute_boolean (GFileInfo *info,
  772. const char *attribute,
  773. gboolean attr_value);
  774. void g_file_info_set_attribute_uint32 (GFileInfo *info,
  775. const char *attribute,
  776. guint32 attr_value);
  777. void g_file_info_set_attribute_int32 (GFileInfo *info,
  778. const char *attribute,
  779. gint32 attr_value);
  780. void g_file_info_set_attribute_uint64 (GFileInfo *info,
  781. const char *attribute,
  782. guint64 attr_value);
  783. void g_file_info_set_attribute_int64 (GFileInfo *info,
  784. const char *attribute,
  785. gint64 attr_value);
  786. void g_file_info_set_attribute_object (GFileInfo *info,
  787. const char *attribute,
  788. GObject *attr_value);
  789. void g_file_info_set_attribute_stringv (GFileInfo *info,
  790. const char *attribute,
  791. char **attr_value);
  792. void g_file_info_clear_status (GFileInfo *info);
  793. /* Helper getters: */
  794. GFileType g_file_info_get_file_type (GFileInfo *info);
  795. gboolean g_file_info_get_is_hidden (GFileInfo *info);
  796. gboolean g_file_info_get_is_backup (GFileInfo *info);
  797. gboolean g_file_info_get_is_symlink (GFileInfo *info);
  798. const char * g_file_info_get_name (GFileInfo *info);
  799. const char * g_file_info_get_display_name (GFileInfo *info);
  800. const char * g_file_info_get_edit_name (GFileInfo *info);
  801. GIcon * g_file_info_get_icon (GFileInfo *info);
  802. const char * g_file_info_get_content_type (GFileInfo *info);
  803. goffset g_file_info_get_size (GFileInfo *info);
  804. void g_file_info_get_modification_time (GFileInfo *info,
  805. GTimeVal *result);
  806. const char * g_file_info_get_symlink_target (GFileInfo *info);
  807. const char * g_file_info_get_etag (GFileInfo *info);
  808. gint32 g_file_info_get_sort_order (GFileInfo *info);
  809. void g_file_info_set_attribute_mask (GFileInfo *info,
  810. GFileAttributeMatcher *mask);
  811. void g_file_info_unset_attribute_mask (GFileInfo *info);
  812. /* Helper setters: */
  813. void g_file_info_set_file_type (GFileInfo *info,
  814. GFileType type);
  815. void g_file_info_set_is_hidden (GFileInfo *info,
  816. gboolean is_hidden);
  817. void g_file_info_set_is_symlink (GFileInfo *info,
  818. gboolean is_symlink);
  819. void g_file_info_set_name (GFileInfo *info,
  820. const char *name);
  821. void g_file_info_set_display_name (GFileInfo *info,
  822. const char *display_name);
  823. void g_file_info_set_edit_name (GFileInfo *info,
  824. const char *edit_name);
  825. void g_file_info_set_icon (GFileInfo *info,
  826. GIcon *icon);
  827. void g_file_info_set_content_type (GFileInfo *info,
  828. const char *content_type);
  829. void g_file_info_set_size (GFileInfo *info,
  830. goffset size);
  831. void g_file_info_set_modification_time (GFileInfo *info,
  832. GTimeVal *mtime);
  833. void g_file_info_set_symlink_target (GFileInfo *info,
  834. const char *symlink_target);
  835. void g_file_info_set_sort_order (GFileInfo *info,
  836. gint32 sort_order);
  837. GType g_file_attribute_matcher_get_type (void) G_GNUC_CONST;
  838. GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
  839. GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
  840. void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
  841. gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
  842. const char *attribute);
  843. gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
  844. const char *attribute);
  845. gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
  846. const char *ns);
  847. const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
  848. G_END_DECLS
  849. #endif /* __G_FILE_INFO_H__ */