/usr/include/giomm-2.4/giomm/drive.h is in libglibmm-2.4-dev 2.50.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | // Generated by gmmproc 2.50.0 -- DO NOT MODIFY!
#ifndef _GIOMM_DRIVE_H
#define _GIOMM_DRIVE_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/listhandle.h>
#include <giomm/mount.h>
#include <giomm/icon.h>
//#include <giomm/volume.h>
//#include <giomm/mountoperation.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GDriveIface GDriveIface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
using GDrive = struct _GDrive;
using GDriveClass = struct _GDriveClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{ class Drive_Class; } // namespace Gio
#endif // DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{
/** @addtogroup giommEnums giomm Enums and Flags */
/**
* @var DriveStartFlags DRIVE_START_NONE
* No flags set.
*
* @enum DriveStartFlags
*
* Flags used when starting a drive.
*
* @newin{2,22}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%DriveStartFlags operator|(DriveStartFlags, DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags operator&(DriveStartFlags, DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags operator^(DriveStartFlags, DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags operator~(DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags& operator|=(DriveStartFlags&, DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags& operator&=(DriveStartFlags&, DriveStartFlags)</tt><br>
* <tt>%DriveStartFlags& operator^=(DriveStartFlags&, DriveStartFlags)</tt><br>
*/
enum DriveStartFlags
{
DRIVE_START_NONE = 0x0
};
/** @ingroup giommEnums */
inline DriveStartFlags operator|(DriveStartFlags lhs, DriveStartFlags rhs)
{ return static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline DriveStartFlags operator&(DriveStartFlags lhs, DriveStartFlags rhs)
{ return static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline DriveStartFlags operator^(DriveStartFlags lhs, DriveStartFlags rhs)
{ return static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline DriveStartFlags operator~(DriveStartFlags flags)
{ return static_cast<DriveStartFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline DriveStartFlags& operator|=(DriveStartFlags& lhs, DriveStartFlags rhs)
{ return (lhs = static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline DriveStartFlags& operator&=(DriveStartFlags& lhs, DriveStartFlags rhs)
{ return (lhs = static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline DriveStartFlags& operator^=(DriveStartFlags& lhs, DriveStartFlags rhs)
{ return (lhs = static_cast<DriveStartFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
} // namespace Gio
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gio::DriveStartFlags> : public Glib::Value_Flags<Gio::DriveStartFlags>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
{
/**
* @var DriveStartStopType DRIVE_START_STOP_TYPE_UNKNOWN
* Unknown or drive doesn't support
* start/stop.
*
* @var DriveStartStopType DRIVE_START_STOP_TYPE_SHUTDOWN
* The stop method will physically
* shut down the drive and e.g. power down the port the drive is
* attached to.
*
* @var DriveStartStopType DRIVE_START_STOP_TYPE_NETWORK
* The start/stop methods are used
* for connecting/disconnect to the drive over the network.
*
* @var DriveStartStopType DRIVE_START_STOP_TYPE_MULTIDISK
* The start/stop methods will
* assemble/disassemble a virtual drive from several physical
* drives.
*
* @var DriveStartStopType DRIVE_START_STOP_TYPE_PASSWORD
* The start/stop methods will
* unlock/lock the disk (for example using the ATA <quote>SECURITY
* UNLOCK DEVICE</quote> command).
*
* @enum DriveStartStopType
*
* Enumeration describing how a drive can be started/stopped.
*
* @newin{2,22}
*
* @ingroup giommEnums
*/
enum DriveStartStopType
{
DRIVE_START_STOP_TYPE_UNKNOWN,
DRIVE_START_STOP_TYPE_SHUTDOWN,
DRIVE_START_STOP_TYPE_NETWORK,
DRIVE_START_STOP_TYPE_MULTIDISK,
DRIVE_START_STOP_TYPE_PASSWORD
};
} // namespace Gio
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gio::DriveStartStopType> : public Glib::Value_Enum<Gio::DriveStartStopType>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
{
/** Virtual File System drive management.
*
* This represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media.
* Gio::Drive is a container class for Gio::Volume objects that stem from the same piece of media. As such, Gio::Drive abstracts a drive with
* (or without) removable media and provides operations for querying whether media is available, determing whether media change is automatically
* detected and ejecting the media.
*
* If the Gio::Drive reports that media isn't automatically detected, one can poll for media; typically one should not do this periodically as a
* poll for media operation is potententially expensive and may spin up the drive, creating noise.
*
* @newin{2,16}
*/
class Drive : public Glib::Interface
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
using CppObjectType = Drive;
using CppClassType = Drive_Class;
using BaseObjectType = GDrive;
using BaseClassType = GDriveIface;
// noncopyable
Drive(const Drive&) = delete;
Drive& operator=(const Drive&) = delete;
private:
friend class Drive_Class;
static CppClassType drive_class_;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
protected:
/**
* You should derive from this class to use it.
*/
Drive();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** Called by constructors of derived classes. Provide the result of
* the Class init() function to ensure that it is properly
* initialized.
*
* @param interface_class The Class object for the derived type.
*/
explicit Drive(const Glib::Interface_Class& interface_class);
public:
// This is public so that C++ wrapper instances can be
// created for C instances of unwrapped types.
// For instance, if an unexpected C type implements the C interface.
explicit Drive(GDrive* castitem);
protected:
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
Drive(Drive&& src) noexcept;
Drive& operator=(Drive&& src) noexcept;
~Drive() noexcept override;
static void add_interface(GType gtype_implementer);
/** Get the GType for this class, for use with the underlying GObject type system.
*/
static GType get_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GObject.
GDrive* gobj() { return reinterpret_cast<GDrive*>(gobject_); }
///Provides access to the underlying C GObject.
const GDrive* gobj() const { return reinterpret_cast<GDrive*>(gobject_); }
private:
public:
/** Gets the name of @a drive.
*
* @return A string containing @a drive's name. The returned
* string should be freed when no longer needed.
*/
Glib::ustring get_name() const;
/** Gets the icon for @a drive.
*
* @return Icon for the @a drive.
* Free the returned object with Glib::object_unref().
*/
Glib::RefPtr<Icon> get_icon();
/** Gets the icon for @a drive.
*
* @return Icon for the @a drive.
* Free the returned object with Glib::object_unref().
*/
Glib::RefPtr<const Icon> get_icon() const;
/** Gets the icon for @a drive.
*
* @newin{2,34}
*
* @return Symbolic Icon for the @a drive.
* Free the returned object with Glib::object_unref().
*/
Glib::RefPtr<Icon> get_symbolic_icon();
/** Gets the icon for @a drive.
*
* @newin{2,34}
*
* @return Symbolic Icon for the @a drive.
* Free the returned object with Glib::object_unref().
*/
Glib::RefPtr<const Icon> get_symbolic_icon() const;
/** Check if @a drive has any mountable volumes.
*
* @return <tt>true</tt> if the @a drive contains volumes, <tt>false</tt> otherwise.
*/
bool has_volumes() const;
/** Get a list of mountable volumes for @a drive.
*
* @return List containing any Volume objects on the given @a drive.
*/
Glib::ListHandle< Glib::RefPtr<Volume> > get_volumes();
/** Checks if the @a drive supports removable media.
*
* @return <tt>true</tt> if @a drive supports removable media, <tt>false</tt> otherwise.
*/
bool is_media_removable() const;
/** Checks if the Drive and/or its media is considered removable by the user.
* See g_drive_is_media_removable().
*
* @newin{2,50}
*
* @return <tt>true</tt> if @a drive and/or its media is considered removable, <tt>false</tt> otherwise.
*/
bool is_removable() const;
/** Checks if the @a drive has media. Note that the OS may not be polling
* the drive for media changes; see g_drive_is_media_check_automatic()
* for more details.
*
* @return <tt>true</tt> if @a drive has media, <tt>false</tt> otherwise.
*/
bool has_media() const;
/** Checks if @a drive is capabable of automatically detecting media changes.
*
* @return <tt>true</tt> if the @a drive is capabable of automatically detecting
* media changes, <tt>false</tt> otherwise.
*/
bool is_media_check_automatic() const;
/** Checks if a drive can be polled for media changes.
*
* @return <tt>true</tt> if the @a drive can be polled for media changes,
* <tt>false</tt> otherwise.
*/
bool can_poll_for_media() const;
/** Checks if a drive can be ejected.
*
* @return <tt>true</tt> if the @a drive can be ejected, <tt>false</tt> otherwise.
*/
bool can_eject() const;
/** Ejects the drive.
* @param slot A callback which will be called when the eject is completed or canceled.
* @param flags Flags affecting the unmount if required for eject.
* @param cancellable A cancellable object which can be used to cancel the eject.
*/
void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
/** Ejects the drive.
* @param slot A callback which will be called when the eject is completed.
* @param flags Flags affecting the unmount if required for eject.
*/
void eject(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
/** Ejects the drive.
* @param flags Flags affecting the unmount if required for eject.
*/
void eject(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
void eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
// eject_finish() is deprecated in favor of eject_with_operation_finish(), and
// since all of our eject() overloads are implemented by
// eject_with_operation(), we implement the _finish() with
// eject_with_operation_finish and ignore the deprecated one
/** Finishes ejecting a drive. If any errors occurred during the operation,
* @a error will be set to contain the errors and <tt>false</tt> will be returned.
*
* @newin{2,22}
*
* @param result A AsyncResult.
* @return <tt>true</tt> if the drive was successfully ejected. <tt>false</tt> otherwise.
*/
bool eject_finish(const Glib::RefPtr<AsyncResult>& result);
/** Polls drive to see if media has been inserted or removed.
* @param slot A callback which will be called when the poll is completed.
* @param cancellable A cancellable object which can be used to cancel the operation.
*/
void poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/** Polls drive to see if media has been inserted or removed.
* @param slot A callback which will be called when the poll is completed.
*/
void poll_for_media(const SlotAsyncReady& slot);
/** Polls drive to see if media has been inserted or removed.
*/
void poll_for_media();
/** Finishes an operation started with g_drive_poll_for_media() on a drive.
*
* @param result A AsyncResult.
* @return <tt>true</tt> if the drive has been poll_for_mediaed successfully,
* <tt>false</tt> otherwise.
*/
bool poll_for_media_finish(const Glib::RefPtr<AsyncResult>& result);
/** Gets the identifier of the given kind for @a drive.
*
* @param kind The kind of identifier to return.
* @return A newly allocated string containing the
* requested identfier, or <tt>nullptr</tt> if the Drive
* doesn't have this kind of identifier.
*/
std::string get_identifier(const std::string& kind) const;
/** Gets the kinds of identifiers that @a drive has.
* Use g_drive_get_identifier() to obtain the identifiers
* themselves.
*
* @return A <tt>nullptr</tt>-terminated
* array of strings containing kinds of identifiers.
*/
Glib::StringArrayHandle enumerate_identifiers() const;
/** @newin{2,22} */
void start(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, DriveStartFlags flags = DRIVE_START_NONE);
/** @newin{2,22} */
void start(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, DriveStartFlags flags = DRIVE_START_NONE);
/** Finishes starting a drive.
*
* @newin{2,22}
*
* @param result A AsyncResult.
* @return <tt>true</tt> if the drive has been started successfully,
* <tt>false</tt> otherwise.
*/
bool start_finish(const Glib::RefPtr<AsyncResult>& result);
/** @newin{2,22}
*/
bool can_start() const;
/** @newin{2,22}
*/
bool can_start_degraded() const;
/** @newin{2,22} */
void stop(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
/** @newin{2,22} */
void stop(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
/** Finishes stopping a drive.
*
* @newin{2,22}
*
* @param result A AsyncResult.
* @return <tt>true</tt> if the drive has been stopped successfully,
* <tt>false</tt> otherwise.
*/
bool stop_finish(const Glib::RefPtr<AsyncResult>& result);
/** @newin{2,22}
*/
bool can_stop() const;
/** Gets a hint about how a drive can be started/stopped.
*
* @newin{2,22}
*
* @return A value from the DriveStartStopType enumeration.
*/
DriveStartStopType get_start_stop_type() const;
/** Gets the sort key for @a drive, if any.
*
* @newin{2,32}
*
* @return Sorting key for @a drive or <tt>nullptr</tt> if no such key is available.
*/
Glib::ustring get_sort_key() const;
/** @newin{2,20}
*
* @par Slot Prototype:
* <tt>void on_my_%changed()</tt>
*
* Emitted when the drive's state has changed.
*/
Glib::SignalProxy< void > signal_changed();
/** @newin{2,20}
*
* @par Slot Prototype:
* <tt>void on_my_%disconnected()</tt>
*
* This signal is emitted when the Drive have been
* disconnected. If the recipient is holding references to the
* object they should release them so the object can be
* finalized.
*/
Glib::SignalProxy< void > signal_disconnected();
/** @newin{2,20}
*
* @par Slot Prototype:
* <tt>void on_my_%eject_button()</tt>
*
* Emitted when the physical eject button (if any) of a drive has
* been pressed.
*/
Glib::SignalProxy< void > signal_eject_button();
/**
* @par Slot Prototype:
* <tt>void on_my_%stop_button()</tt>
*
* Emitted when the physical stop button (if any) of a drive has
* been pressed.
*
* @newin{2,22}
*/
Glib::SignalProxy< void > signal_stop_button();
//_WRAP_VFUNC(Glib::ustring get_name() const, get_name)
//Careful of ref-counting: //_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, get_icon)
//_WRAP_VFUNC(bool has_volumes() const, has_volumes)
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
};
} // namespace Gio
namespace Glib
{
//Pre-declare this so we can use it in TypeTrait:
Glib::RefPtr<Gio::Drive> wrap(GDrive* object, bool take_copy);
namespace Container_Helpers
{
/** This specialization of TypeTraits exists
* because the default use of Glib::wrap(GObject*),
* instead of a specific Glib::wrap(GSomeInterface*),
* would not return a wrapper for an interface.
*/
template <>
struct TypeTraits< Glib::RefPtr<Gio::Drive> >
{
using CppType = Glib::RefPtr<Gio::Drive>;
using CType = GDrive*;
using CTypeNonConst = GDrive*;
static CType to_c_type (const CppType& item)
{ return Glib::unwrap (item); }
static CppType to_cpp_type (const CType& item)
{
//Use a specific Glib::wrap() function,
//because CType has the specific type (not just GObject):
return Glib::wrap(item, true /* take_copy */);
}
static void release_c_type (CType item)
{
GLIBMM_DEBUG_UNREFERENCE(nullptr, item);
g_object_unref(item);
}
};
} // Container_Helpers
} // Glib
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gio::Drive
*/
Glib::RefPtr<Gio::Drive> wrap(GDrive* object, bool take_copy = false);
} // namespace Glib
#endif /* _GIOMM_DRIVE_H */
|