/usr/include/giomm-2.4/giomm/appinfo.h is in libglibmm-2.4-dev 2.56.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 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | // Generated by gmmproc 2.54.1 -- DO NOT MODIFY!
#ifndef _GIOMM_APPINFO_H
#define _GIOMM_APPINFO_H
#include <giommconfig.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, see <http://www.gnu.org/licenses/>.
*/
#include <giomm/applaunchcontext.h>
#include <giomm/asyncresult.h>
#include <giomm/cancellable.h>
#include <exception>
#include <string>
#include <glibmm/interface.h>
#include <glibmm/listhandle.h>
#include <glibmm/arrayhandle.h>
#include <glibmm/object.h>
//#include <giomm/file.h>
#include <giomm/icon.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GAppInfoIface GAppInfoIface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
using GAppInfo = struct _GAppInfo;
using GAppInfoClass = struct _GAppInfoClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{ class AppInfo_Class; } // namespace Gio
#endif // DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{
/** @addtogroup giommEnums giomm Enums and Flags */
/**
* @var AppInfoCreateFlags APP_INFO_CREATE_NONE
* No flags.
*
* @var AppInfoCreateFlags APP_INFO_CREATE_NEEDS_TERMINAL
* Application opens in a terminal window.
*
* @var AppInfoCreateFlags APP_INFO_CREATE_SUPPORTS_URIS
* Application supports URI arguments.
*
* @var AppInfoCreateFlags APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION
* Application supports startup notification. @newin{2,26}
*
* @enum AppInfoCreateFlags
*
* Flags used when creating a AppInfo.
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%AppInfoCreateFlags operator|(AppInfoCreateFlags, AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags operator&(AppInfoCreateFlags, AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags operator^(AppInfoCreateFlags, AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags operator~(AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags& operator|=(AppInfoCreateFlags&, AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags& operator&=(AppInfoCreateFlags&, AppInfoCreateFlags)</tt><br>
* <tt>%AppInfoCreateFlags& operator^=(AppInfoCreateFlags&, AppInfoCreateFlags)</tt><br>
*/
enum AppInfoCreateFlags
{
APP_INFO_CREATE_NONE = 0x0,
APP_INFO_CREATE_NEEDS_TERMINAL = (1 << 0),
APP_INFO_CREATE_SUPPORTS_URIS = (1 << 1),
APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION = (1 << 2)
};
/** @ingroup giommEnums */
inline AppInfoCreateFlags operator|(AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
{ return static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags operator&(AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
{ return static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags operator^(AppInfoCreateFlags lhs, AppInfoCreateFlags rhs)
{ return static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags operator~(AppInfoCreateFlags flags)
{ return static_cast<AppInfoCreateFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags& operator|=(AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
{ return (lhs = static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags& operator&=(AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
{ return (lhs = static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline AppInfoCreateFlags& operator^=(AppInfoCreateFlags& lhs, AppInfoCreateFlags rhs)
{ return (lhs = static_cast<AppInfoCreateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
class File;
/** Application information, to describe applications installed on the system,
* and launch them.
* See also AppLaunchContext.
*
* @newin{2,16}
*/
class AppInfo : public Glib::Interface
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
using CppObjectType = AppInfo;
using CppClassType = AppInfo_Class;
using BaseObjectType = GAppInfo;
using BaseClassType = GAppInfoIface;
// noncopyable
AppInfo(const AppInfo&) = delete;
AppInfo& operator=(const AppInfo&) = delete;
private:
friend class AppInfo_Class;
static CppClassType appinfo_class_;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
protected:
/**
* You should derive from this class to use it.
*/
AppInfo();
#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 AppInfo(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 AppInfo(GAppInfo* castitem);
protected:
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
AppInfo(AppInfo&& src) noexcept;
AppInfo& operator=(AppInfo&& src) noexcept;
~AppInfo() 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.
GAppInfo* gobj() { return reinterpret_cast<GAppInfo*>(gobject_); }
///Provides access to the underlying C GObject.
const GAppInfo* gobj() const { return reinterpret_cast<GAppInfo*>(gobject_); }
private:
public:
static Glib::RefPtr<AppInfo> create_from_commandline(const std::string& commandline,
const std::string& application_name,
AppInfoCreateFlags flags);
/** Creates a duplicate of this AppInfo.
* @return A duplicate of this AppInfo.
* @newin{2,36}
*/
Glib::RefPtr<AppInfo> create_duplicate() const;
// Note that the implementation of equal() is virtual via equal_vfunc().
/** Checks if two AppInfo<!-- -->s are equal.
* @param other The other AppInfo.
* @return <tt>true</tt> if @a *this is equal to @a other, <tt>false</tt> otherwise.
*/
bool equal(const Glib::RefPtr<AppInfo>& other) const;
/** Gets the ID of an application. An id is a string that
* identifies the application. The exact format of the id is
* platform dependent. For instance, on Unix this is the
* desktop file id from the xdg menu specification.
*
* Note that the returned ID may be <tt>nullptr</tt>, depending on how
* the @a appinfo has been constructed.
*
* @return A string containing the application's ID.
*/
std::string get_id() const;
/** Gets the installed name of the application.
*
* @return The name of the application for @a appinfo.
*/
std::string get_name() const;
/** Gets the display name of the application. The display name is often more
* descriptive to the user than the name itself.
*
* @newin{2,24}
*
* @return The display name of the application for @a appinfo, or the name if
* no display name is available.
*/
std::string get_display_name() const;
/** Gets a human-readable description of an installed application.
*
* @return A string containing a description of the
* application @a appinfo, or <tt>nullptr</tt> if none.
*/
std::string get_description() const;
/** Gets the executable's name for the installed application.
*
* @return A string containing the @a appinfo's application
* binaries name.
*/
std::string get_executable() const;
/** Gets the commandline with which the application will be
* started.
*
* @newin{2,20}
*
* @return A string containing the @a appinfo's commandline,
* or <tt>nullptr</tt> if this information is not available.
*/
std::string get_commandline() const;
/** Gets the icon for the application.
*
* @return The default Icon for @a appinfo or <tt>nullptr</tt>
* if there is no default icon.
*/
Glib::RefPtr<Icon> get_icon();
/** Gets the icon for the application.
*
* @return The default Icon for @a appinfo or <tt>nullptr</tt>
* if there is no default icon.
*/
const Glib::RefPtr<const Icon> get_icon() const;
/** Launches the application. This passes the @a file to the launched application
* as an argument, using the optional @a context to get information
* about the details of the launcher (like what screen it is on).
* On error, an exception will be thrown accordingly.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
*
* Some URIs can be changed when passed through a GFile (for instance
* unsupported uris with strange formats like mailto:), so if you have
* a textual uri you want to pass in as argument, consider using
* launch_uris() instead.
*
* On UNIX, this function sets the @c GIO_LAUNCHED_DESKTOP_FILE
* environment variable with the path of the launched desktop file and
* @c GIO_LAUNCHED_DESKTOP_FILE_PID to the process
* id of the launched process. This can be used to ignore
* @c GIO_LAUNCHED_DESKTOP_FILE, should it be inherited
* by further processes. The @c DISPLAY and
* @c DESKTOP_STARTUP_ID environment variables are also
* set, based on information provided in @a context.
* @param file A File object.
* @param context An AppLaunchContext.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @newin{2,30}
*/
bool launch(const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& context);
/** Launches the application. This passes the @a file to the launched application
* as an argument.
* On error, an exception will be thrown accordingly.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
*
* Some URIs can be changed when passed through a GFile (for instance
* unsupported uris with strange formats like mailto:), so if you have
* a textual uri you want to pass in as argument, consider using
* launch_uris() instead.
*
* On UNIX, this function sets the @c GIO_LAUNCHED_DESKTOP_FILE
* environment variable with the path of the launched desktop file and
* @c GIO_LAUNCHED_DESKTOP_FILE_PID to the process
* id of the launched process. This can be used to ignore
* @c GIO_LAUNCHED_DESKTOP_FILE, should it be inherited
* by further processes. The @c DISPLAY and
* @c DESKTOP_STARTUP_ID environment variables are also
* set, based on information provided in @a context.
* @param file A File object.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @newin{2,30}
*/
bool launch(const Glib::RefPtr<Gio::File>& file);
/** Launches the application. Passes @a files to the launched application
* as arguments, using the optional @a context to get information
* about the details of the launcher (like what screen it is on).
* On error, @a error will be set accordingly.
*
* To launch the application without arguments pass a <tt>nullptr</tt> @a files list.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
*
* Some URIs can be changed when passed through a GFile (for instance
* unsupported URIs with strange formats like mailto:), so if you have
* a textual URI you want to pass in as argument, consider using
* g_app_info_launch_uris() instead.
*
* The launched application inherits the environment of the launching
* process, but it can be modified with g_app_launch_context_setenv()
* and g_app_launch_context_unsetenv().
*
* On UNIX, this function sets the `GIO_LAUNCHED_DESKTOP_FILE`
* environment variable with the path of the launched desktop file and
* `GIO_LAUNCHED_DESKTOP_FILE_PID` to the process id of the launched
* process. This can be used to ignore `GIO_LAUNCHED_DESKTOP_FILE`,
* should it be inherited by further processes. The `DISPLAY` and
* `DESKTOP_STARTUP_ID` environment variables are also set, based
* on information provided in @a context.
*
* @param files A List of File objects.
* @param context A AppLaunchContext or <tt>nullptr</tt>.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @throws Glib::Error
*/
bool launch(const std::vector< Glib::RefPtr<Gio::File> >& files, const Glib::RefPtr<AppLaunchContext>& context);
/// A launch() convenience overload.
bool launch(const std::vector< Glib::RefPtr<Gio::File> >& files);
/** Checks if the application supports reading files and directories from URIs.
*
* @return <tt>true</tt> if the @a appinfo supports URIs.
*/
bool supports_uris() const;
/** Checks if the application accepts files as arguments.
*
* @return <tt>true</tt> if the @a appinfo supports files.
*/
bool supports_files() const;
#ifndef GIOMM_DISABLE_DEPRECATED
/** Launches the application. This passes the @a uris to the launched application
* as arguments, using the optional @a context to get information
* about the details of the launcher (like what screen it is on).
* On error, @a error will be set accordingly.
*
* To launch the application without arguments pass a <tt>nullptr</tt> @a uris list.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
*
* @deprecated Use the method that takes an AppLaunchContext
*
* @param uris A List containing URIs to launch.
* @param context A AppLaunchContext or <tt>nullptr</tt>.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @throws Glib::Error
*/
bool launch_uris(const Glib::ListHandle<std::string>& uris, GAppLaunchContext* context);
#endif // GIOMM_DISABLE_DEPRECATED
//TODO: I think we use Glib::ustring elsewhere for URIs:
/** Launches the application. This passes the @a uris to the launched application
* as arguments, using the optional @a context to get information
* about the details of the launcher (like what screen it is on).
* On error, @a error will be set accordingly.
*
* To launch the application without arguments pass a <tt>nullptr</tt> @a uris list.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
*
* @param uris A List containing URIs to launch.
* @param context A AppLaunchContext or <tt>nullptr</tt>.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @throws Glib::Error
*/
bool launch_uris(const Glib::ListHandle<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context);
/// A launch_uris() convenience overload.
bool launch_uris(const Glib::ListHandle<std::string>& uris);
/** Launches the application. This passes the @a uri to the launched application
* as an arguments, using the optional @a context to get information
* about the details of the launcher (like what screen it is on).
* On error, an exception will be thrown accordingly.
*
* Note that even if the launch is successful the application launched
* can fail to start if it runs into problems during startup. There is
* no way to detect this.
* @param uris A URIs to launch.
* @param context An AppLaunchContext.
* @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
*
* @newin{2,30}
*/
bool launch_uri(const std::string& uris, const Glib::RefPtr<AppLaunchContext>& context);
/** A launch_uri() convenience overload.
*
* @newin{2,30}
*/
bool launch_uri(const std::string& uris);
/** Checks if the application info should be shown in menus that
* list available applications.
*
* @return <tt>true</tt> if the @a appinfo should be shown, <tt>false</tt> otherwise.
*/
bool should_show() const;
// FIXME: use better terminology than delete/do_delete
/** Obtains the information whether the AppInfo can be deleted.
* See g_app_info_delete().
*
* @newin{2,20}
*
* @return <tt>true</tt> if @a appinfo can be deleted.
*/
bool can_delete() const;
/** Tries to delete a AppInfo.
*
* On some platforms, there may be a difference between user-defined
* AppInfos which can be deleted, and system-wide ones which cannot.
* See g_app_info_can_delete().
*
* Virtual: do_delete
* @newin{2,20}
*
* @return <tt>true</tt> if @a appinfo has been deleted.
*/
bool do_delete();
/** Sets the application as the default handler for a given type.
*
* @param content_type The content type.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
bool set_as_default_for_type(const std::string& content_type);
/** Sets the application as the default handler for the given file extension.
*
* @param extension A string containing the file extension
* (without the dot).
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
bool set_as_default_for_extension(const std::string& extension);
/** Adds a content type to the application information to indicate the
* application is capable of opening files with the given content type.
*
* @param content_type A string.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
bool add_supports_type(const std::string& content_type);
/** Checks if a supported content type can be removed from an application.
*
* @return <tt>true</tt> if it is possible to remove supported
* content types from a given @a appinfo, <tt>false</tt> if not.
*/
bool can_remove_supports_type() const;
/** Removes a supported type from an application, if possible.
*
* @param content_type A string.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
bool remove_supports_type(const std::string& content_type);
/** Retrieves the list of content types that @a app_info claims to support.
* If this information is not provided by the environment, this function
* will return <tt>nullptr</tt>.
* This function does not take in consideration associations added with
* g_app_info_add_supports_type(), but only those exported directly by
* the application.
*
* @newin{2,34}
*
* @return A list of content types.
*/
Glib::StringArrayHandle get_supported_types() const;
/** Sets the application as the last used application for a given type.
* This will make the application appear as first in the list returned
* by g_app_info_get_recommended_for_type(), regardless of the default
* application for that content type.
*
* @param content_type The content type.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
bool set_as_last_used_for_type(const std::string& content_type);
/** Gets a list of all of the applications currently registered
* on this system.
*
* For desktop files, this includes applications that have
* `NoDisplay=true` set or are excluded from display by means
* of `OnlyShowIn` or `NotShowIn`. See g_app_info_should_show().
* The returned list does not include applications which have
* the `Hidden` key set.
*
* @return A newly allocated List of references to AppInfos.
*/
static Glib::ListHandle<Glib::RefPtr<AppInfo> > get_all();
/** Gets a list of all AppInfos for a given content type,
* including the recommended and fallback AppInfos. See
* g_app_info_get_recommended_for_type() and
* g_app_info_get_fallback_for_type().
*
* @param content_type The content type to find a AppInfo for.
* @return List of AppInfos
* for given @a content_type or <tt>nullptr</tt> on error.
*/
static Glib::ListHandle<Glib::RefPtr<AppInfo> > get_all_for_type(const std::string& content_type);
/** Gets the default AppInfo for a given content type.
*
* @param content_type The content type to find a AppInfo for.
* @param must_support_uris If <tt>true</tt>, the AppInfo is expected to
* support URIs.
* @return AppInfo for given @a content_type or
* <tt>nullptr</tt> on error.
*/
static Glib::RefPtr<AppInfo> get_default_for_type(const std::string& content_type, bool must_support_uris = true);
/** Gets the default application for handling URIs with
* the given URI scheme. A URI scheme is the initial part
* of the URI, up to but not including the ':', e.g. "http",
* "ftp" or "sip".
*
* @param uri_scheme A string containing a URI scheme.
* @return AppInfo for given @a uri_scheme or <tt>nullptr</tt> on error.
*/
static Glib::RefPtr<AppInfo> get_default_for_uri_scheme(const std::string& uri_scheme);
/** Removes all changes to the type associations done by
* g_app_info_set_as_default_for_type(),
* g_app_info_set_as_default_for_extension(),
* g_app_info_add_supports_type() or
* g_app_info_remove_supports_type().
*
* @newin{2,20}
*
* @param content_type A content type.
*/
static void reset_type_associations(const std::string& content_type);
/** Utility function that launches the default application
* registered to handle the specified uri. Synchronous I/O
* is done on the uri to detect the type of the file if
* required.
*
* @param uri The uri to show.
* @param context An optional AppLaunchContext.
* @return <tt>true</tt> on success, <tt>false</tt> on error.
*
* @throws Glib::Error
*/
static bool launch_default_for_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context);
/// A launch_default_for_uri() convenience overload.
static bool launch_default_for_uri(const std::string& uri);
/** Async version of g_app_info_launch_default_for_uri().
*
* This version is useful if you are interested in receiving
* error information in the case where the application is
* sandboxed and the portal may present an application chooser
* dialog to the user.
*
* @newin{2,50}
*
* @param uri The uri to show.
* @param context An optional AppLaunchContext.
* @param cancellable A Cancellable.
* @param slot A SlotASyncReady to call when the request is done.
*/
static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const SlotAsyncReady& slot);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const Glib::RefPtr<Cancellable>& cancellable);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const SlotAsyncReady& slot);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<Cancellable>& cancellable);
/// A launch_default_for_uri_async() convenience overload.
static void launch_default_for_uri_async(const std::string& uri);
/** Finishes an asynchronous launch-default-for-uri operation.
*
* @newin{2,50}
*
* @param result A AsyncResult.
* @return <tt>true</tt> if the launch was successful, <tt>false</tt> if @a error is set.
*
* @throws Glib::Error
*/
static bool launch_default_for_uri_finish(const Glib::RefPtr<AsyncResult>& result);
protected:
//_WRAP_VFUNC(Glib::RefPtr<AppInfo> dup(), "dup")
//_WRAP_VFUNC(bool equal(const Glib::RefPtr<AppInfo>& appinfo2), "equal")
//_WRAP_VFUNC(std::string get_id() const, "get_id")
//_WRAP_VFUNC(std::string get_name() const, "get_name")
//_WRAP_VFUNC(std::string get_description() const, "get_description")
//_WRAP_VFUNC(std::string get_executable() const, "get_executable")
//_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, "get_icon")
//#m4 __CONVERSION(`const Glib::ListHandle<std::string>&',`GList*',`$3.data()')
//#m4 __CONVERSION(`GList*',`const Glib::ListHandle<std::string>&',`Glib::ListHandle<std::string>($3, Glib::OWNERSHIP_NONE)')
//_WRAP_VFUNC(bool launch(const std::vector<Gio::File>& filenames, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch")
//_WRAP_VFUNC(bool supports_uris() const, "supports_uris")
//_WRAP_VFUNC(bool supports_files() const, "supports_files")
//_WRAP_VFUNC(bool launch_uris(const Glib::ListHandle<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch_uris")
//_WRAP_VFUNC(bool should_show() const, "should_show")
//_WRAP_VFUNC(bool set_as_default_for_type(const std::string& content_type, GError** error), "set_as_default_for_type")
//_WRAP_VFUNC(bool set_as_default_for_extension(const std::string& extension, GError** error), "set_as_default_for_extension")
//_WRAP_VFUNC(bool add_supports_type(const std::string& content_type, GError** error), "add_supports_type")
//_WRAP_VFUNC(bool can_remove_supports_type() const, "can_remove_supports_type")
//_WRAP_VFUNC(bool remove_supports_type(const std::string& content_type, GError** error), "remove_supports_type")
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
{
/** 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::AppInfo
*/
Glib::RefPtr<Gio::AppInfo> wrap(GAppInfo* object, bool take_copy = false);
} // namespace Glib
#endif /* _GIOMM_APPINFO_H */
|