"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.74.0/untracked/gio/giomm/appinfo.h" (19 Sep 2022, 31534 Bytes) of package /linux/misc/glibmm-2.74.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "appinfo.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes reports: 2.73.2_vs_2.74.0 or 2.72.1_vs_2.74.0.

    1 // Generated by gmmproc 2.74.0 -- DO NOT MODIFY!
    2 #ifndef _GIOMM_APPINFO_H
    3 #define _GIOMM_APPINFO_H
    4 
    5 #include <giommconfig.h>
    6 
    7 
    8 #include <glibmm/ustring.h>
    9 #include <sigc++/sigc++.h>
   10 
   11 /* Copyright (C) 2007 The gtkmm Development Team
   12  *
   13  * This library is free software; you can redistribute it and/or
   14  * modify it under the terms of the GNU Lesser General Public
   15  * License as published by the Free Software Foundation; either
   16  * version 2.1 of the License, or (at your option) any later version.
   17  *
   18  * This library is distributed in the hope that it will be useful,
   19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   21  * Lesser General Public License for more details.
   22  *
   23  * You should have received a copy of the GNU Lesser General Public
   24  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
   25  */
   26 
   27 
   28 #include <giomm/applaunchcontext.h>
   29 #include <giomm/asyncresult.h>
   30 #include <giomm/cancellable.h>
   31 
   32 #include <exception>
   33 
   34 #include <string>
   35 
   36 #include <glibmm/interface.h>
   37 #include <glibmm/object.h>
   38 //#include <giomm/file.h>
   39 #include <giomm/icon.h>
   40 
   41 
   42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   43 typedef struct _GAppInfoIface GAppInfoIface;
   44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
   45 
   46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   47 using GAppInfo = struct _GAppInfo;
   48 using GAppInfoClass = struct _GAppInfoClass;
   49 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
   50 
   51 
   52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   53 namespace Gio
   54 { class GIOMM_API AppInfo_Class; } // namespace Gio
   55 #endif // DOXYGEN_SHOULD_SKIP_THIS
   56 
   57 namespace Gio
   58 {
   59 
   60 
   61 class GIOMM_API File;
   62 
   63 /** Application information, to describe applications installed on the system,
   64  * and launch them.
   65  * See also AppLaunchContext.
   66  *
   67  * @newin{2,16}
   68  */
   69 
   70 class GIOMM_API AppInfo : public Glib::Interface
   71 {
   72   
   73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   74 
   75 public:
   76   using CppObjectType = AppInfo;
   77   using CppClassType = AppInfo_Class;
   78   using BaseObjectType = GAppInfo;
   79   using BaseClassType = GAppInfoIface;
   80 
   81   // noncopyable
   82   AppInfo(const AppInfo&) = delete;
   83   AppInfo& operator=(const AppInfo&) = delete;
   84 
   85 private:
   86   friend class AppInfo_Class;
   87   static CppClassType appinfo_class_;
   88 
   89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
   90 protected:
   91   /**
   92    * You should derive from this class to use it.
   93    */
   94   AppInfo();
   95 
   96 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   97   /** Called by constructors of derived classes. Provide the result of
   98    * the Class init() function to ensure that it is properly
   99    * initialized.
  100    *
  101    * @param interface_class The Class object for the derived type.
  102    */
  103   explicit AppInfo(const Glib::Interface_Class& interface_class);
  104 
  105 public:
  106   // This is public so that C++ wrapper instances can be
  107   // created for C instances of unwrapped types.
  108   // For instance, if an unexpected C type implements the C interface.
  109   explicit AppInfo(GAppInfo* castitem);
  110 
  111 protected:
  112 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  113 
  114 public:
  115 
  116   AppInfo(AppInfo&& src) noexcept;
  117   AppInfo& operator=(AppInfo&& src) noexcept;
  118 
  119   ~AppInfo() noexcept override;
  120 
  121   static void add_interface(GType gtype_implementer);
  122 
  123   /** Get the GType for this class, for use with the underlying GObject type system.
  124    */
  125   static GType get_type()      G_GNUC_CONST;
  126 
  127 #ifndef DOXYGEN_SHOULD_SKIP_THIS
  128   static GType get_base_type() G_GNUC_CONST;
  129 #endif
  130 
  131   ///Provides access to the underlying C GObject.
  132   GAppInfo*       gobj()       { return reinterpret_cast<GAppInfo*>(gobject_); }
  133 
  134   ///Provides access to the underlying C GObject.
  135   const GAppInfo* gobj() const { return reinterpret_cast<GAppInfo*>(gobject_); }
  136 
  137 private:
  138 
  139 
  140 public:
  141   /** @addtogroup giommEnums giomm Enums and Flags */
  142 
  143   /** 
  144    *  @var CreateFlags NONE
  145    * No flags.
  146    * 
  147    *  @var CreateFlags NEEDS_TERMINAL
  148    * Application opens in a terminal window.
  149    * 
  150    *  @var CreateFlags SUPPORTS_URIS
  151    * Application supports URI arguments.
  152    * 
  153    *  @var CreateFlags SUPPORTS_STARTUP_NOTIFICATION
  154    * Application supports startup notification. @newin{2,26}
  155    * 
  156    *  @enum CreateFlags
  157    * 
  158    * Flags used when creating a AppInfo.
  159    *
  160    * @ingroup giommEnums
  161    * @par Bitwise operators:
  162    * <tt>AppInfo::CreateFlags operator|(AppInfo::CreateFlags, AppInfo::CreateFlags)</tt><br>
  163    * <tt>AppInfo::CreateFlags operator&(AppInfo::CreateFlags, AppInfo::CreateFlags)</tt><br>
  164    * <tt>AppInfo::CreateFlags operator^(AppInfo::CreateFlags, AppInfo::CreateFlags)</tt><br>
  165    * <tt>AppInfo::CreateFlags operator~(AppInfo::CreateFlags)</tt><br>
  166    * <tt>AppInfo::CreateFlags& operator|=(AppInfo::CreateFlags&, AppInfo::CreateFlags)</tt><br>
  167    * <tt>AppInfo::CreateFlags& operator&=(AppInfo::CreateFlags&, AppInfo::CreateFlags)</tt><br>
  168    * <tt>AppInfo::CreateFlags& operator^=(AppInfo::CreateFlags&, AppInfo::CreateFlags)</tt><br>
  169    */
  170   enum class CreateFlags
  171   {
  172     NONE = 0x0,
  173     NEEDS_TERMINAL = (1 << 0),
  174     SUPPORTS_URIS = (1 << 1),
  175     SUPPORTS_STARTUP_NOTIFICATION = (1 << 2)
  176   };
  177 
  178 
  179   static Glib::RefPtr<AppInfo> create_from_commandline(const std::string& commandline,
  180                                                        const std::string& application_name,
  181                                                        CreateFlags flags);
  182 
  183   /**  Creates a duplicate of this AppInfo.
  184    * @return A duplicate of this AppInfo.
  185    * @newin{2,36}
  186    */
  187   Glib::RefPtr<AppInfo> create_duplicate() const;
  188   
  189 
  190   // Note that the implementation of equal() is virtual via equal_vfunc().
  191   
  192   /** Checks if two AppInfo<!-- -->s are equal.
  193    * @param other The other AppInfo.
  194    * @return <tt>true</tt> if @a *this is equal to @a other, <tt>false</tt> otherwise.
  195    */
  196   bool equal(const Glib::RefPtr<AppInfo>& other) const;
  197 
  198   
  199   /** Gets the ID of an application. An id is a string that
  200    * identifies the application. The exact format of the id is
  201    * platform dependent. For instance, on Unix this is the
  202    * desktop file id from the xdg menu specification.
  203    * 
  204    * Note that the returned ID may be <tt>nullptr</tt>, depending on how
  205    * the @a appinfo has been constructed.
  206    * 
  207    * @return A string containing the application's ID.
  208    */
  209   std::string get_id() const;
  210   
  211   /** Gets the installed name of the application.
  212    * 
  213    * @return The name of the application for @a appinfo.
  214    */
  215   std::string get_name() const;
  216   
  217   /** Gets the display name of the application. The display name is often more
  218    * descriptive to the user than the name itself.
  219    * 
  220    * @newin{2,24}
  221    * 
  222    * @return The display name of the application for @a appinfo, or the name if
  223    * no display name is available.
  224    */
  225   std::string get_display_name() const;
  226   
  227   /** Gets a human-readable description of an installed application.
  228    * 
  229    * @return A string containing a description of the 
  230    * application @a appinfo, or <tt>nullptr</tt> if none.
  231    */
  232   std::string get_description() const;
  233   
  234   /** Gets the executable's name for the installed application.
  235    * 
  236    * @return A string containing the @a appinfo's application
  237    * binaries name.
  238    */
  239   std::string get_executable() const;
  240   
  241   /** Gets the commandline with which the application will be
  242    * started.  
  243    * 
  244    * @newin{2,20}
  245    * 
  246    * @return A string containing the @a appinfo's commandline,
  247    * or <tt>nullptr</tt> if this information is not available.
  248    */
  249   std::string get_commandline() const;
  250 
  251   
  252   /** Gets the icon for the application.
  253    * 
  254    * @return The default Icon for @a appinfo or <tt>nullptr</tt>
  255    * if there is no default icon.
  256    */
  257   Glib::RefPtr<Icon> get_icon();
  258   
  259   /** Gets the icon for the application.
  260    * 
  261    * @return The default Icon for @a appinfo or <tt>nullptr</tt>
  262    * if there is no default icon.
  263    */
  264   const Glib::RefPtr<const Icon> get_icon() const;
  265 
  266  
  267   /** Launches the application. This passes the @a file to the launched application
  268    * as an argument, using the optional @a context to get information
  269    * about the details of the launcher (like what screen it is on).
  270    * On error, an exception will be thrown accordingly.
  271    *
  272    * Note that even if the launch is successful the application launched
  273    * can fail to start if it runs into problems during startup. There is
  274    * no way to detect this.
  275    *
  276    * Some URIs can be changed when passed through a GFile (for instance
  277    * unsupported uris with strange formats like mailto:), so if you have
  278    * a textual uri you want to pass in as argument, consider using
  279    * launch_uris() instead.
  280    *
  281    * On UNIX, this function sets the @c GIO_LAUNCHED_DESKTOP_FILE
  282    * environment variable with the path of the launched desktop file and
  283    * @c GIO_LAUNCHED_DESKTOP_FILE_PID to the process
  284    * id of the launched process. This can be used to ignore
  285    * @c GIO_LAUNCHED_DESKTOP_FILE, should it be inherited
  286    * by further processes. The @c DISPLAY and
  287    * @c DESKTOP_STARTUP_ID environment variables are also
  288    * set, based on information provided in @a context.
  289    * @param file A File object.
  290    * @param context An AppLaunchContext.
  291    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  292    *
  293    * @newin{2,30}
  294    */
  295   bool launch(const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& context);
  296 
  297   /** Launches the application. This passes the @a file to the launched application
  298    * as an argument.
  299    * On error, an exception will be thrown accordingly.
  300    *
  301    * Note that even if the launch is successful the application launched
  302    * can fail to start if it runs into problems during startup. There is
  303    * no way to detect this.
  304    *
  305    * Some URIs can be changed when passed through a GFile (for instance
  306    * unsupported uris with strange formats like mailto:), so if you have
  307    * a textual uri you want to pass in as argument, consider using
  308    * launch_uris() instead.
  309    *
  310    * On UNIX, this function sets the @c GIO_LAUNCHED_DESKTOP_FILE
  311    * environment variable with the path of the launched desktop file and
  312    * @c GIO_LAUNCHED_DESKTOP_FILE_PID to the process
  313    * id of the launched process. This can be used to ignore
  314    * @c GIO_LAUNCHED_DESKTOP_FILE, should it be inherited
  315    * by further processes. The @c DISPLAY and
  316    * @c DESKTOP_STARTUP_ID environment variables are also
  317    * set, based on information provided in @a context.
  318    * @param file A File object.
  319    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  320    *
  321    * @newin{2,30}
  322    */
  323   bool launch(const Glib::RefPtr<Gio::File>& file);
  324 
  325   
  326   /** Launches the application. Passes @a files to the launched application
  327    * as arguments, using the optional @a context to get information
  328    * about the details of the launcher (like what screen it is on).
  329    * On error, @a error will be set accordingly.
  330    * 
  331    * To launch the application without arguments pass a <tt>nullptr</tt> @a files list.
  332    * 
  333    * Note that even if the launch is successful the application launched
  334    * can fail to start if it runs into problems during startup. There is
  335    * no way to detect this.
  336    * 
  337    * Some URIs can be changed when passed through a GFile (for instance
  338    * unsupported URIs with strange formats like mailto:), so if you have
  339    * a textual URI you want to pass in as argument, consider using
  340    * g_app_info_launch_uris() instead.
  341    * 
  342    * The launched application inherits the environment of the launching
  343    * process, but it can be modified with g_app_launch_context_setenv()
  344    * and g_app_launch_context_unsetenv().
  345    * 
  346    * On UNIX, this function sets the `GIO_LAUNCHED_DESKTOP_FILE`
  347    * environment variable with the path of the launched desktop file and
  348    * `GIO_LAUNCHED_DESKTOP_FILE_PID` to the process id of the launched
  349    * process. This can be used to ignore `GIO_LAUNCHED_DESKTOP_FILE`,
  350    * should it be inherited by further processes. The `DISPLAY` and
  351    * `DESKTOP_STARTUP_ID` environment variables are also set, based
  352    * on information provided in @a context.
  353    * 
  354    * @param files A List of File objects.
  355    * @param context A AppLaunchContext or <tt>nullptr</tt>.
  356    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  357    * 
  358    * @throws Glib::Error
  359    */
  360   bool launch(const std::vector< Glib::RefPtr<Gio::File> >& files, const Glib::RefPtr<AppLaunchContext>& context);
  361 
  362   /// A launch() convenience overload.
  363   bool launch(const std::vector< Glib::RefPtr<Gio::File> >& files);
  364 
  365   
  366   /** Checks if the application supports reading files and directories from URIs.
  367    * 
  368    * @return <tt>true</tt> if the @a appinfo supports URIs.
  369    */
  370   bool supports_uris() const;
  371   
  372   /** Checks if the application accepts files as arguments.
  373    * 
  374    * @return <tt>true</tt> if the @a appinfo supports files.
  375    */
  376   bool supports_files() const;
  377 
  378     
  379   //TODO: I think we use Glib::ustring elsewhere for URIs:
  380   // 2019-03-14 kjellahl: Glibmm is inconsistent; Glib::ustring in convert.hg,
  381   // std::string in uriutils.hg.
  382   // The reporter of libxml++ bug https://bugzilla.gnome.org/show_bug.cgi?id=790034
  383   // proposes std::string.
  384   
  385   /** Launches the application. This passes the @a uris to the launched application
  386    * as arguments, using the optional @a context to get information
  387    * about the details of the launcher (like what screen it is on).
  388    * On error, @a error will be set accordingly. If the application only supports
  389    * one URI per invocation as part of their command-line, multiple instances
  390    * of the application will be spawned.
  391    * 
  392    * To launch the application without arguments pass a <tt>nullptr</tt> @a uris list.
  393    * 
  394    * Note that even if the launch is successful the application launched
  395    * can fail to start if it runs into problems during startup. There is
  396    * no way to detect this.
  397    * 
  398    * @param uris A List containing URIs to launch.
  399    * @param context A AppLaunchContext or <tt>nullptr</tt>.
  400    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  401    * 
  402    * @throws Glib::Error
  403    */
  404   bool launch_uris(const std::vector<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context);
  405 
  406   /// A launch_uris() convenience overload.
  407   bool launch_uris(const std::vector<std::string>& uris);
  408 
  409   /** Launches the application. This passes the @a uri to the launched application
  410    * as an arguments, using the optional @a context to get information
  411    * about the details of the launcher (like what screen it is on).
  412    * On error, an exception will be thrown accordingly.
  413    *
  414    * Note that even if the launch is successful the application launched
  415    * can fail to start if it runs into problems during startup. There is
  416    * no way to detect this.
  417    * @param uri A URI to launch.
  418    * @param context An AppLaunchContext.
  419    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  420    *
  421    * @newin{2,30}
  422    */
  423   bool launch_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context);
  424 
  425   /** A launch_uri() convenience overload.
  426    *
  427    * @newin{2,30}
  428    */
  429   bool launch_uri(const std::string& uris);
  430 
  431   
  432   /** Async version of g_app_info_launch_uris().
  433    * 
  434    * The @a slot is invoked immediately after the application launch, but it
  435    * waits for activation in case of D-Bus–activated applications and also provides
  436    * extended error information for sandboxed applications, see notes for
  437    * g_app_info_launch_default_for_uri_async().
  438    * 
  439    * @newin{2,60}
  440    * 
  441    * @param uris A List containing URIs to launch.
  442    * @param context A AppLaunchContext or <tt>nullptr</tt>.
  443    * @param cancellable A Cancellable.
  444    * @param slot A SlotAsyncReady to call when the request is done.
  445    */
  446   void launch_uris_async(const std::vector<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable =  {});
  447 
  448   /// A launch_uris_async() convenience overload.
  449   void launch_uris_async(const std::vector<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, const Glib::RefPtr<Cancellable>& cancellable =  {});
  450   
  451   /** Finishes a g_app_info_launch_uris_async() operation.
  452    * 
  453    * @newin{2,60}
  454    * 
  455    * @param result A AsyncResult.
  456    * @return <tt>true</tt> on successful launch, <tt>false</tt> otherwise.
  457    * 
  458    * @throws Glib::Error
  459    */
  460   bool launch_uris_finish(const Glib::RefPtr<AsyncResult>& result);
  461 
  462   
  463   /** Checks if the application info should be shown in menus that 
  464    * list available applications.
  465    * 
  466    * @return <tt>true</tt> if the @a appinfo should be shown, <tt>false</tt> otherwise.
  467    */
  468   bool should_show() const;
  469   // FIXME: use better terminology than delete/do_delete
  470   
  471   /** Obtains the information whether the AppInfo can be deleted.
  472    * See g_app_info_delete().
  473    * 
  474    * @newin{2,20}
  475    * 
  476    * @return <tt>true</tt> if @a appinfo can be deleted.
  477    */
  478   bool can_delete() const;
  479   
  480   /** Tries to delete a AppInfo.
  481    * 
  482    * On some platforms, there may be a difference between user-defined
  483    * AppInfos which can be deleted, and system-wide ones which cannot.
  484    * See g_app_info_can_delete().
  485    * 
  486    * Virtual: do_delete
  487    * @newin{2,20}
  488    * 
  489    * @return <tt>true</tt> if @a appinfo has been deleted.
  490    */
  491   bool do_delete();
  492 
  493   
  494   /** Sets the application as the default handler for a given type.
  495    * 
  496    * @param content_type The content type.
  497    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  498    * 
  499    * @throws Glib::Error
  500    */
  501   bool set_as_default_for_type(const std::string& content_type);
  502   
  503   /** Sets the application as the default handler for the given file extension.
  504    * 
  505    * @param extension A string containing the file extension
  506    * (without the dot).
  507    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  508    * 
  509    * @throws Glib::Error
  510    */
  511   bool set_as_default_for_extension(const std::string& extension);
  512   
  513   /** Adds a content type to the application information to indicate the 
  514    * application is capable of opening files with the given content type.
  515    * 
  516    * @param content_type A string.
  517    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  518    * 
  519    * @throws Glib::Error
  520    */
  521   bool add_supports_type(const std::string& content_type);
  522   
  523   /** Checks if a supported content type can be removed from an application.
  524    * 
  525    * @return <tt>true</tt> if it is possible to remove supported 
  526    * content types from a given @a appinfo, <tt>false</tt> if not.
  527    */
  528   bool can_remove_supports_type() const;
  529   
  530   /** Removes a supported type from an application, if possible.
  531    * 
  532    * @param content_type A string.
  533    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  534    * 
  535    * @throws Glib::Error
  536    */
  537   bool remove_supports_type(const std::string& content_type);
  538 
  539  
  540   /** Retrieves the list of content types that @a app_info claims to support.
  541    * If this information is not provided by the environment, this function
  542    * will return <tt>nullptr</tt>.
  543    * This function does not take in consideration associations added with
  544    * g_app_info_add_supports_type(), but only those exported directly by
  545    * the application.
  546    * 
  547    * @newin{2,34}
  548    * 
  549    * @return A list of content types.
  550    */
  551   std::vector<Glib::ustring> get_supported_types() const;
  552 
  553   
  554   /** Sets the application as the last used application for a given type.
  555    * This will make the application appear as first in the list returned
  556    * by g_app_info_get_recommended_for_type(), regardless of the default
  557    * application for that content type.
  558    * 
  559    * @param content_type The content type.
  560    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  561    * 
  562    * @throws Glib::Error
  563    */
  564   bool set_as_last_used_for_type(const std::string& content_type);
  565 
  566  
  567   /** Gets a list of all of the applications currently registered
  568    * on this system.
  569    * 
  570    * For desktop files, this includes applications that have
  571    * `NoDisplay=true` set or are excluded from display by means
  572    * of `OnlyShowIn` or `NotShowIn`. See g_app_info_should_show().
  573    * The returned list does not include applications which have
  574    * the `Hidden` key set.
  575    * 
  576    * @return A newly allocated List of references to AppInfos.
  577    */
  578   static std::vector<Glib::RefPtr<AppInfo>> get_all();
  579 
  580   
  581   /** Gets a list of all AppInfos for a given content type,
  582    * including the recommended and fallback AppInfos. See
  583    * g_app_info_get_recommended_for_type() and
  584    * g_app_info_get_fallback_for_type().
  585    * 
  586    * @param content_type The content type to find a AppInfo for.
  587    * @return List of AppInfos
  588    * for given @a content_type or <tt>nullptr</tt> on error.
  589    */
  590   static std::vector<Glib::RefPtr<AppInfo>> get_all_for_type(const std::string& content_type);
  591   
  592   /** Gets the default AppInfo for a given content type.
  593    * 
  594    * @param content_type The content type to find a AppInfo for.
  595    * @param must_support_uris If <tt>true</tt>, the AppInfo is expected to
  596    * support URIs.
  597    * @return AppInfo for given @a content_type or
  598    * <tt>nullptr</tt> on error.
  599    */
  600   static Glib::RefPtr<AppInfo> get_default_for_type(const std::string& content_type, bool must_support_uris =  true);
  601   
  602   /** Asynchronously gets the default AppInfo for a given content type.
  603    * 
  604    * @newin{2,74}
  605    * 
  606    * @param content_type The content type to find a AppInfo for.
  607    * @param must_support_uris If <tt>true</tt>, the AppInfo is expected to
  608    * support URIs.
  609    * @param cancellable Optional Cancellable object, <tt>nullptr</tt> to ignore.
  610    * @param slot A SlotAsyncReady to call when the request is done.
  611    */
  612   static void get_default_for_type_async(const std::string& content_type, bool must_support_uris, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable =  {});
  613 
  614   /// A get_default_for_type_async() convenience overload.
  615   static void get_default_for_type_async(const std::string& content_type, bool must_support_uris, const Glib::RefPtr<Cancellable>& cancellable =  {});
  616   
  617   /** Finishes a default AppInfo lookup started by
  618    * g_app_info_get_default_for_type_async().
  619    * 
  620    * If no AppInfo is found, then @a error will be set to Gio::Error::NOT_FOUND.
  621    * 
  622    * @newin{2,74}
  623    * 
  624    * @param result A AsyncResult.
  625    * @return AppInfo for given @a content_type or
  626    * <tt>nullptr</tt> on error.
  627    * 
  628    * @throws Glib::Error
  629    */
  630   static Glib::RefPtr<AppInfo> get_default_for_type_finish(const Glib::RefPtr<AsyncResult>& result);
  631 
  632   
  633   /** Gets the default application for handling URIs with
  634    * the given URI scheme. A URI scheme is the initial part
  635    * of the URI, up to but not including the ':', e.g. "http",
  636    * "ftp" or "sip".
  637    * 
  638    * @param uri_scheme A string containing a URI scheme.
  639    * @return AppInfo for given @a uri_scheme or
  640    * <tt>nullptr</tt> on error.
  641    */
  642   static Glib::RefPtr<AppInfo> get_default_for_uri_scheme(const std::string& uri_scheme);
  643   
  644   /** Asynchronously gets the default application for handling URIs with
  645    * the given URI scheme. A URI scheme is the initial part
  646    * of the URI, up to but not including the ':', e.g. "http",
  647    * "ftp" or "sip".
  648    * 
  649    * @newin{2,74}
  650    * 
  651    * @param content_type A string containing a URI scheme.
  652    * @param cancellable Optional Cancellable object, <tt>nullptr</tt> to ignore.
  653    * @param slot A SlotAsyncReady to call when the request is done.
  654    */
  655   static void get_default_for_uri_scheme_async(const std::string& content_type, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable =  {});
  656 
  657   /// A get_default_for_uri_scheme_async() convenience overload.
  658   static void get_default_for_uri_scheme_async(const std::string& content_type, const Glib::RefPtr<Cancellable>& cancellable =  {});
  659   
  660   /** Finishes a default AppInfo lookup started by
  661    * g_app_info_get_default_for_uri_scheme_async().
  662    * 
  663    * If no AppInfo is found, then @a error will be set to Gio::Error::NOT_FOUND.
  664    * 
  665    * @newin{2,74}
  666    * 
  667    * @param result A AsyncResult.
  668    * @return AppInfo for given @a uri_scheme or
  669    * <tt>nullptr</tt> on error.
  670    * 
  671    * @throws Glib::Error
  672    */
  673   static Glib::RefPtr<AppInfo> get_default_for_uri_scheme_finish(const Glib::RefPtr<AsyncResult>& result);
  674 
  675   
  676   /** Removes all changes to the type associations done by
  677    * g_app_info_set_as_default_for_type(),
  678    * g_app_info_set_as_default_for_extension(),
  679    * g_app_info_add_supports_type() or
  680    * g_app_info_remove_supports_type().
  681    * 
  682    * @newin{2,20}
  683    * 
  684    * @param content_type A content type.
  685    */
  686   static void reset_type_associations(const std::string& content_type);
  687   
  688   /** Utility function that launches the default application
  689    * registered to handle the specified uri. Synchronous I/O
  690    * is done on the uri to detect the type of the file if
  691    * required.
  692    * 
  693    * The D-Bus–activated applications don't have to be started if your application
  694    * terminates too soon after this function. To prevent this, use
  695    * g_app_info_launch_default_for_uri_async() instead.
  696    * 
  697    * @param uri The uri to show.
  698    * @param context An optional AppLaunchContext.
  699    * @return <tt>true</tt> on success, <tt>false</tt> on error.
  700    * 
  701    * @throws Glib::Error
  702    */
  703   static bool launch_default_for_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context);
  704 
  705   /// A launch_default_for_uri() convenience overload.
  706   static bool launch_default_for_uri(const std::string& uri);
  707 
  708   
  709   /** Async version of g_app_info_launch_default_for_uri().
  710    * 
  711    * This version is useful if you are interested in receiving
  712    * error information in the case where the application is
  713    * sandboxed and the portal may present an application chooser
  714    * dialog to the user.
  715    * 
  716    * This is also useful if you want to be sure that the D-Bus–activated
  717    * applications are really started before termination and if you are interested
  718    * in receiving error information from their activation.
  719    * 
  720    * @newin{2,50}
  721    * 
  722    * @param uri The uri to show.
  723    * @param context An optional AppLaunchContext.
  724    * @param cancellable A Cancellable.
  725    * @param slot A SlotAsyncReady to call when the request is done.
  726    */
  727   static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
  728 
  729   /// A launch_default_for_uri_async() convenience overload.
  730   static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const SlotAsyncReady& slot);
  731 
  732   /// A launch_default_for_uri_async() convenience overload.
  733   static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context, const Glib::RefPtr<Cancellable>& cancellable);
  734 
  735   /// A launch_default_for_uri_async() convenience overload.
  736   static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context);
  737 
  738   /// A launch_default_for_uri_async() convenience overload.
  739   static void launch_default_for_uri_async(const std::string& uri, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
  740 
  741   /// A launch_default_for_uri_async() convenience overload.
  742   static void launch_default_for_uri_async(const std::string& uri, const SlotAsyncReady& slot);
  743 
  744   /// A launch_default_for_uri_async() convenience overload.
  745   static void launch_default_for_uri_async(const std::string& uri, const Glib::RefPtr<Cancellable>& cancellable);
  746 
  747   /// A launch_default_for_uri_async() convenience overload.
  748   static void launch_default_for_uri_async(const std::string& uri);
  749   
  750   /** Finishes an asynchronous launch-default-for-uri operation.
  751    * 
  752    * @newin{2,50}
  753    * 
  754    * @param result A AsyncResult.
  755    * @return <tt>true</tt> if the launch was successful, <tt>false</tt> if @a error is set.
  756    * 
  757    * @throws Glib::Error
  758    */
  759   static bool launch_default_for_uri_finish(const Glib::RefPtr<AsyncResult>& result);
  760 
  761 protected:
  762   //_WRAP_VFUNC(Glib::RefPtr<AppInfo> dup(), "dup")
  763   //_WRAP_VFUNC(bool equal(const Glib::RefPtr<AppInfo>& appinfo2), "equal")
  764   //_WRAP_VFUNC(std::string get_id() const, "get_id")
  765   //_WRAP_VFUNC(std::string get_name() const, "get_name")
  766   //_WRAP_VFUNC(std::string get_description() const, "get_description")
  767   //_WRAP_VFUNC(std::string get_executable() const, "get_executable")
  768   //_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, "get_icon")
  769   //_WRAP_VFUNC(bool launch(const std::vector<Gio::File>& filenames, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch")
  770   //_WRAP_VFUNC(bool supports_uris() const, "supports_uris")
  771   //_WRAP_VFUNC(bool supports_files() const, "supports_files")
  772   //_WRAP_VFUNC(bool launch_uris(const std::vector<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch_uris")
  773   //_WRAP_VFUNC(bool should_show() const, "should_show")
  774   //_WRAP_VFUNC(bool set_as_default_for_type(const std::string& content_type, GError** error), "set_as_default_for_type")
  775   //_WRAP_VFUNC(bool set_as_default_for_extension(const std::string& extension, GError** error), "set_as_default_for_extension")
  776   //_WRAP_VFUNC(bool add_supports_type(const std::string& content_type, GError** error), "add_supports_type")
  777   //_WRAP_VFUNC(bool can_remove_supports_type() const, "can_remove_supports_type")
  778   //_WRAP_VFUNC(bool remove_supports_type(const std::string& content_type, GError** error), "remove_supports_type")
  779 
  780 
  781 public:
  782 
  783 public:
  784   //C++ methods used to invoke GTK+ virtual functions:
  785 
  786 protected:
  787   //GTK+ Virtual Functions (override these to change behaviour):
  788 
  789   //Default Signal Handlers::
  790 
  791 
  792 };
  793 
  794 } // namespace Gio
  795 
  796 namespace Gio
  797 {
  798 
  799 /** @ingroup giommEnums */
  800 inline AppInfo::CreateFlags operator|(AppInfo::CreateFlags lhs, AppInfo::CreateFlags rhs)
  801   { return static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
  802 
  803 /** @ingroup giommEnums */
  804 inline AppInfo::CreateFlags operator&(AppInfo::CreateFlags lhs, AppInfo::CreateFlags rhs)
  805   { return static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
  806 
  807 /** @ingroup giommEnums */
  808 inline AppInfo::CreateFlags operator^(AppInfo::CreateFlags lhs, AppInfo::CreateFlags rhs)
  809   { return static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
  810 
  811 /** @ingroup giommEnums */
  812 inline AppInfo::CreateFlags operator~(AppInfo::CreateFlags flags)
  813   { return static_cast<AppInfo::CreateFlags>(~static_cast<unsigned>(flags)); }
  814 
  815 /** @ingroup giommEnums */
  816 inline AppInfo::CreateFlags& operator|=(AppInfo::CreateFlags& lhs, AppInfo::CreateFlags rhs)
  817   { return (lhs = static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
  818 
  819 /** @ingroup giommEnums */
  820 inline AppInfo::CreateFlags& operator&=(AppInfo::CreateFlags& lhs, AppInfo::CreateFlags rhs)
  821   { return (lhs = static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
  822 
  823 /** @ingroup giommEnums */
  824 inline AppInfo::CreateFlags& operator^=(AppInfo::CreateFlags& lhs, AppInfo::CreateFlags rhs)
  825   { return (lhs = static_cast<AppInfo::CreateFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
  826 } // namespace Gio
  827 
  828 namespace Glib
  829 {
  830   /** A Glib::wrap() method for this object.
  831    *
  832    * @param object The C instance.
  833    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  834    * @result A C++ instance that wraps this C instance.
  835    *
  836    * @relates Gio::AppInfo
  837    */
  838   GIOMM_API
  839   Glib::RefPtr<Gio::AppInfo> wrap(GAppInfo* object, bool take_copy = false);
  840 
  841 } // namespace Glib
  842 
  843 
  844 #endif /* _GIOMM_APPINFO_H */
  845