/* * Licensed under the GNU Lesser General Public License Version 3 * * 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 3 of the license, or * (at your option) any later version. * * This software 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 . */ // generated automatically - do not change module appstream.Launchable; private import appstream.c.functions; public import appstream.c.types; private import glib.ConstructionException; private import glib.PtrArray; private import glib.Str; private import gobject.ObjectG; /** */ public class Launchable : ObjectG { /** the main Gtk struct */ protected AsLaunchable* asLaunchable; /** Get the main Gtk struct */ public AsLaunchable* getLaunchableStruct(bool transferOwnership = false) { if (transferOwnership) ownedRef = false; return asLaunchable; } /** the main Gtk struct as a void* */ protected override void* getStruct() { return cast(void*)asLaunchable; } protected override void setStruct(GObject* obj) { asLaunchable = cast(AsLaunchable*)obj; super.setStruct(obj); } /** * Sets our main struct and passes it to the parent class. */ public this (AsLaunchable* asLaunchable, bool ownedRef = false) { this.asLaunchable = asLaunchable; super(cast(GObject*)asLaunchable, ownedRef); } /** */ public static GType getType() { return as_launchable_get_type(); } /** * Creates a new #AsLaunchable. * * Returns: a #AsLaunchable * * Since: 0.11.0 * * Throws: ConstructionException GTK+ fails to create the object. */ public this() { auto p = as_launchable_new(); if(p is null) { throw new ConstructionException("null returned by new"); } this(cast(AsLaunchable*) p, true); } /** * Converts the text representation to an enumerated value. * * Params: * kindStr = the string. * * Returns: a #AsLaunchableKind or %AS_LAUNCHABLE_KIND_UNKNOWN for unknown * * Since: 0.11.0 */ public static AsLaunchableKind kindFromString(string kindStr) { return as_launchable_kind_from_string(Str.toStringz(kindStr)); } /** * Converts the enumerated value to a text representation. * * Params: * kind = the #AsLaunchableKind. * * Returns: string version of @kind * * Since: 0.11.0 */ public static string kindToString(AsLaunchableKind kind) { return Str.toString(as_launchable_kind_to_string(kind)); } /** * Add a new launchable entry. * * Since: 0.11.0 */ public void addEntry(string entry) { as_launchable_add_entry(asLaunchable, Str.toStringz(entry)); } /** * Get an array of launchable entries. * * Returns: An string list of launch entries. * * Since: 0.11.0 */ public PtrArray getEntries() { auto p = as_launchable_get_entries(asLaunchable); if(p is null) { return null; } return new PtrArray(cast(GPtrArray*) p); } /** * The launch system for the entries this #AsLaunchable * object stores. * * Returns: an enum of type #AsLaunchableKind * * Since: 0.11.0 */ public AsLaunchableKind getKind() { return as_launchable_get_kind(asLaunchable); } /** * Set the launch system for the entries this #AsLaunchable * object stores. * * Params: * kind = the new #AsLaunchableKind * * Since: 0.11.0 */ public void setKind(AsLaunchableKind kind) { as_launchable_set_kind(asLaunchable, kind); } }