"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.74.0/untracked/gio/giomm/appinfomonitor.h" (19 Sep 2022, 5436 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 "appinfomonitor.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_APPINFOMONITOR_H
    3 #define _GIOMM_APPINFOMONITOR_H
    4 
    5 #include <giommconfig.h>
    6 
    7 
    8 #include <glibmm/ustring.h>
    9 #include <sigc++/sigc++.h>
   10 
   11 /* Copyright (C) 2022 The giomm 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 <glibmm/object.h>
   29 
   30 
   31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   32 using GAppInfoMonitor = struct _GAppInfoMonitor;
   33 using GAppInfoMonitorClass = struct _GAppInfoMonitorClass;
   34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
   35 
   36 
   37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   38 namespace Gio
   39 { class GIOMM_API AppInfoMonitor_Class; } // namespace Gio
   40 #endif //DOXYGEN_SHOULD_SKIP_THIS
   41 
   42 namespace Gio
   43 {
   44 
   45 /** Monitor application information for changes.
   46  *
   47  * %Gio::AppInfoMonitor is a very simple object used for monitoring the app
   48  * info database for changes (ie: newly installed or removed
   49  * applications).
   50  *
   51  * Call get() to get a %Gio::AppInfoMonitor and connect to signal_changed().
   52  *
   53  * In the usual case, applications should try to make note of the change
   54  * (doing things like invalidating caches) but not act on it. In
   55  * particular, applications should avoid making calls to Gio::AppInfo APIs
   56  * in response to the change signal, deferring these until the time that
   57  * the data is actually required. The exception to this case is when
   58  * application information is actually being displayed on the screen
   59  * (eg: during a search or when the list of all applications is shown).
   60  * The reason for this is that changes to the list of installed
   61  * applications often come in groups (like during system updates) and
   62  * rescanning the list on every change is pointless and expensive.
   63  *
   64  * @newin{2,72}
   65  */
   66 
   67 class GIOMM_API AppInfoMonitor : public Glib::Object
   68 {
   69   
   70 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   71 
   72 public:
   73   using CppObjectType = AppInfoMonitor;
   74   using CppClassType = AppInfoMonitor_Class;
   75   using BaseObjectType = GAppInfoMonitor;
   76   using BaseClassType = GAppInfoMonitorClass;
   77 
   78   // noncopyable
   79   AppInfoMonitor(const AppInfoMonitor&) = delete;
   80   AppInfoMonitor& operator=(const AppInfoMonitor&) = delete;
   81 
   82 private:  friend class AppInfoMonitor_Class;
   83   static CppClassType appinfomonitor_class_;
   84 
   85 protected:
   86   explicit AppInfoMonitor(const Glib::ConstructParams& construct_params);
   87   explicit AppInfoMonitor(GAppInfoMonitor* castitem);
   88 
   89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
   90 
   91 public:
   92 
   93   AppInfoMonitor(AppInfoMonitor&& src) noexcept;
   94   AppInfoMonitor& operator=(AppInfoMonitor&& src) noexcept;
   95 
   96   ~AppInfoMonitor() noexcept override;
   97 
   98   /** Get the GType for this class, for use with the underlying GObject type system.
   99    */
  100   static GType get_type()      G_GNUC_CONST;
  101 
  102 #ifndef DOXYGEN_SHOULD_SKIP_THIS
  103 
  104 
  105   static GType get_base_type() G_GNUC_CONST;
  106 #endif
  107 
  108   ///Provides access to the underlying C GObject.
  109   GAppInfoMonitor*       gobj()       { return reinterpret_cast<GAppInfoMonitor*>(gobject_); }
  110 
  111   ///Provides access to the underlying C GObject.
  112   const GAppInfoMonitor* gobj() const { return reinterpret_cast<GAppInfoMonitor*>(gobject_); }
  113 
  114   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  115   GAppInfoMonitor* gobj_copy();
  116 
  117 private:
  118 
  119 
  120 public:
  121   
  122   /** Gets the %AppInfoMonitor for the current thread-default main context.
  123    *
  124    * The %AppInfoMonitor will emit a "changed" signal in the
  125    * thread-default main context whenever the list of installed
  126    * applications (as reported by Gio::AppInfo::get_all()) may have changed.
  127    *
  128    * You must only drop the last reference on the return value from under
  129    * the same main context as you created it.
  130    *
  131    * @newin{2,72}
  132    *
  133    * @return A reference to a %Gio::AppInfoMonitor.
  134    */
  135   static Glib::RefPtr<AppInfoMonitor> get();
  136 
  137   // no_default_handler because the wrapped C signal has no default handler.
  138   
  139   /**
  140    * @par Slot Prototype:
  141    * <tt>void on_my_%changed()</tt>
  142    *
  143    * Flags: Run First
  144    *
  145    * Signal emitted when the app info database for changes (ie: newly installed
  146    * or removed applications).
  147    * 
  148    * @newin{2,72}
  149    */
  150 
  151   Glib::SignalProxy<void()> signal_changed();
  152 
  153 
  154 public:
  155 
  156 public:
  157   //C++ methods used to invoke GTK+ virtual functions:
  158 
  159 protected:
  160   //GTK+ Virtual Functions (override these to change behaviour):
  161 
  162   //Default Signal Handlers::
  163 
  164 
  165 };
  166 
  167 } // namespace Gio
  168 
  169 
  170 namespace Glib
  171 {
  172   /** A Glib::wrap() method for this object.
  173    *
  174    * @param object The C instance.
  175    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  176    * @result A C++ instance that wraps this C instance.
  177    *
  178    * @relates Gio::AppInfoMonitor
  179    */
  180   GIOMM_API
  181   Glib::RefPtr<Gio::AppInfoMonitor> wrap(GAppInfoMonitor* object, bool take_copy = false);
  182 }
  183 
  184 
  185 #endif /* _GIOMM_APPINFOMONITOR_H */
  186