/usr/include/gtkmm-3.0/gtkmm/recentinfo.h is in libgtkmm-3.0-dev 3.22.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 | // Generated by gmmproc 2.50.0 -- DO NOT MODIFY!
#ifndef _GTKMM_RECENTINFO_H
#define _GTKMM_RECENTINFO_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vector>
#include <gdkmm/pixbuf.h>
#include <giomm/icon.h>
#include <giomm/appinfo.h>
#include <ctime>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
typedef struct _GtkRecentInfo GtkRecentInfo;
void gtk_recent_info_unref(GtkRecentInfo* info);
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
namespace Gtk
{
/** Contains information found when looking up an entry of the
* recently used files list.
*
* @newin{2,10}
*
* @ingroup RecentFiles
*/
class RecentInfo final
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
using CppObjectType = RecentInfo;
using BaseObjectType = GtkRecentInfo;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
/** Increment the reference count for this object.
* You should never need to do this manually - use the object via a RefPtr instead.
*/
void reference() const;
/** Decrement the reference count for this object.
* You should never need to do this manually - use the object via a RefPtr instead.
*/
void unreference() const;
///Provides access to the underlying C instance.
GtkRecentInfo* gobj();
///Provides access to the underlying C instance.
const GtkRecentInfo* gobj() const;
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
GtkRecentInfo* gobj_copy() const;
RecentInfo() = delete;
// noncopyable
RecentInfo(const RecentInfo&) = delete;
RecentInfo& operator=(const RecentInfo&) = delete;
protected:
// Do not derive this. Gtk::RecentInfo can neither be constructed nor deleted.
void operator delete(void*, std::size_t);
private:
public:
/** Gets the URI of the resource.
*
* @newin{2,10}
*
* @return The URI of the resource. The returned string is
* owned by the recent manager, and should not be freed.
*/
Glib::ustring get_uri() const;
/** Gets the name of the resource. If none has been defined, the basename
* of the resource is obtained.
*
* @newin{2,10}
*
* @return The display name of the resource. The returned string
* is owned by the recent manager, and should not be freed.
*/
Glib::ustring get_display_name() const;
/** Gets the (short) description of the resource.
*
* @newin{2,10}
*
* @return The description of the resource. The returned string
* is owned by the recent manager, and should not be freed.
*/
Glib::ustring get_description() const;
/** Gets the MIME type of the resource.
*
* @newin{2,10}
*
* @return The MIME type of the resource. The returned string
* is owned by the recent manager, and should not be freed.
*/
Glib::ustring get_mime_type() const;
/** Gets the timestamp (seconds from system’s Epoch) when the resource
* was added to the recently used resources list.
*
* @newin{2,10}
*
* @return The number of seconds elapsed from system’s Epoch when
* the resource was added to the list, or -1 on failure.
*/
std::time_t get_added() const;
/** Gets the timestamp (seconds from system’s Epoch) when the meta-data
* for the resource was last modified.
*
* @newin{2,10}
*
* @return The number of seconds elapsed from system’s Epoch when
* the resource was last modified, or -1 on failure.
*/
std::time_t get_modified() const;
/** Gets the timestamp (seconds from system’s Epoch) when the meta-data
* for the resource was last visited.
*
* @newin{2,10}
*
* @return The number of seconds elapsed from system’s Epoch when
* the resource was last visited, or -1 on failure.
*/
std::time_t get_visited() const;
/** Gets the value of the “private” flag. Resources in the recently used
* list that have this flag set to <tt>true</tt> should only be displayed by the
* applications that have registered them.
*
* @newin{2,10}
*
* @return <tt>true</tt> if the private flag was found, <tt>false</tt> otherwise.
*/
bool get_private_hint() const;
/** Creates a AppInfo for the specified Gtk::RecentInfo
*
* @param app_name The name of the application that should
* be mapped to a AppInfo; if <tt>nullptr</tt> is used then the default
* application for the MIME type is used.
* @return The newly created AppInfo, or <tt>nullptr</tt>.
* In case of error, @a error will be set either with a
* Gtk::RECENT_MANAGER_ERROR or a IO_ERROR.
*/
Glib::RefPtr<Gio::AppInfo> create_app_info(const Glib::ustring& app_name);
/** Gets the data regarding the application that has registered the resource
* pointed by @a info.
*
* If the command line contains any escape characters defined inside the
* storage specification, they will be expanded.
*
* @newin{2,10}
*
* @param app_name The name of the application that has registered this item.
* @param app_exec Return location for the string containing
* the command line.
* @param count Return location for the number of times this item was registered.
* @param time Return location for the timestamp this item was last registered
* for this application.
* @return <tt>true</tt> if an application with @a app_name has registered this
* resource inside the recently used list, or <tt>false</tt> otherwise. The
* @a app_exec string is owned by the Gtk::RecentInfo and should not be
* modified or freed.
*/
bool get_application_info(const Glib::ustring& app_name, std::string& app_exec,
guint& count, std::time_t& time) const;
/** Retrieves the list of applications that have registered this resource.
*
* @newin{2,10}
*
* @param length Return location for the length of the returned list.
* @return A newly allocated <tt>nullptr</tt>-terminated array of strings.
*/
std::vector<Glib::ustring> get_applications() const;
/** Gets the name of the last application that have registered the
* recently used resource represented by @a info.
*
* @newin{2,10}
*
* @return An application name.
*/
Glib::ustring last_application() const;
/** Checks whether an application registered this resource using @a app_name.
*
* @newin{2,10}
*
* @param app_name A string containing an application name.
* @return <tt>true</tt> if an application with name @a app_name was found,
* <tt>false</tt> otherwise.
*/
bool has_application(const Glib::ustring& app_name) const;
/** Returns all groups registered for the recently used item @a info.
* The array of returned group names will be <tt>nullptr</tt> terminated, so
* length might optionally be <tt>nullptr</tt>.
*
* @newin{2,10}
*
* @param length Return location for the number of groups returned.
* @return A newly allocated <tt>nullptr</tt> terminated array of strings.
*/
std::vector<Glib::ustring> get_groups() const;
/** Checks whether @a group_name appears inside the groups
* registered for the recently used item @a info.
*
* @newin{2,10}
*
* @param group_name Name of a group.
* @return <tt>true</tt> if the group was found.
*/
bool has_group(const Glib::ustring& group_name) const;
/** Retrieves the icon of size @a size associated to the resource MIME type.
*
* @newin{2,10}
*
* @param size The size of the icon in pixels.
* @return A Gdk::Pixbuf containing the icon,
* or <tt>nullptr</tt>. Use Glib::object_unref() when finished using the icon.
*/
Glib::RefPtr<Gdk::Pixbuf> get_icon(int size);
/** Retrieves the icon of size @a size associated to the resource MIME type.
*
* @newin{2,10}
*
* @param size The size of the icon in pixels.
* @return A Gdk::Pixbuf containing the icon,
* or <tt>nullptr</tt>. Use Glib::object_unref() when finished using the icon.
*/
Glib::RefPtr<const Gdk::Pixbuf> get_icon(int size) const;
/** Retrieves the icon associated to the resource MIME type.
*
* @newin{2,22}
*
* @return A Icon containing the icon, or <tt>nullptr</tt>.
* Use Glib::object_unref() when finished using the icon.
*/
Glib::RefPtr<Gio::Icon> get_gicon();
/** Retrieves the icon associated to the resource MIME type.
*
* @newin{2,22}
*
* @return A Icon containing the icon, or <tt>nullptr</tt>.
* Use Glib::object_unref() when finished using the icon.
*/
Glib::RefPtr<const Gio::Icon> get_gicon() const;
/** Computes a valid UTF-8 string that can be used as the
* name of the item in a menu or list. For example, calling
* this function on an item that refers to
* “file:///foo/bar.txt” will yield “bar.txt”.
*
* @newin{2,10}
*
* @return A newly-allocated string in UTF-8 encoding
* free it with Glib::free().
*/
Glib::ustring get_short_name() const;
/** Gets a displayable version of the resource’s URI. If the resource
* is local, it returns a local path; if the resource is not local,
* it returns the UTF-8 encoded content of get_uri().
*
* @newin{2,10}
*
* @return A newly allocated UTF-8 string containing the
* resource’s URI or <tt>nullptr</tt>.
*/
Glib::ustring get_uri_display() const;
/** Gets the number of days elapsed since the last update
* of the resource pointed by @a info.
*
* @newin{2,10}
*
* @return A positive integer containing the number of days
* elapsed since the time this resource was last modified.
*/
int get_age() const;
/** Checks whether the resource is local or not by looking at the
* scheme of its URI.
*
* @newin{2,10}
*
* @return <tt>true</tt> if the resource is local.
*/
bool is_local() const;
/** Checks whether the resource pointed by @a info still exists.
* At the moment this check is done only on resources pointing
* to local files.
*
* @newin{2,10}
*
* @return <tt>true</tt> if the resource exists.
*/
bool exists() const;
/** Checks whether two Gtk::RecentInfo-struct point to the same
* resource.
*
* @newin{2,10}
*
* @param info_b A Gtk::RecentInfo.
* @return <tt>true</tt> if both Gtk::RecentInfo-struct point to the same
* resource, <tt>false</tt> otherwise.
*/
bool equal(const RecentInfo& info_b) const;
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
struct RecentInfoTraits
{
typedef Glib::RefPtr<RecentInfo> CppType;
typedef const GtkRecentInfo* CType;
typedef GtkRecentInfo* CTypeNonConst;
static inline CType to_c_type(const CppType& obj) { return Glib::unwrap(obj); }
static inline CType to_c_type(const CType& obj) { return obj; }
static CppType to_cpp_type(const CType& obj);
static inline void release_c_type(const CType& obj)
{ gtk_recent_info_unref(const_cast<CTypeNonConst>(obj)); }
};
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
// TODO: These are almost impossible to use without RefPtr<>::operator*()
/** @relates Gtk::RecentInfo */
inline bool operator==(const RecentInfo& lhs, const RecentInfo& rhs)
{ return lhs.equal(rhs); }
/** @relates Gtk::RecentInfo */
inline bool operator!=(const RecentInfo& lhs, const RecentInfo& rhs)
{ return !lhs.equal(rhs); }
} // namespace Gtk
namespace Glib
{
// This is needed so Glib::RefPtr<Gtk::RecentInfo> can be used with
// Glib::Value and Gtk::TreeModelColumn:
template <>
class Value< Glib::RefPtr<Gtk::RecentInfo> > : public ValueBase_Boxed
{
public:
typedef Glib::RefPtr<Gtk::RecentInfo> CppType;
typedef GtkRecentInfo* CType;
static GType value_type();
void set(const CppType& data);
CppType get() const;
};
} // namespace 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 Gtk::RecentInfo
*/
Glib::RefPtr<Gtk::RecentInfo> wrap(GtkRecentInfo* object, bool take_copy = false);
} // namespace Glib
#endif /* _GTKMM_RECENTINFO_H */
|