1 /* 2 * This file is part of libsecret-d. 3 * 4 * This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/ 7 */ 8 9 // generated automatically - do not change 10 // find conversion definition on APILookup.txt 11 12 13 module libsecret.SchemaAttribute; 14 15 private import glib.Str; 16 private import glib.c.functions; 17 private import libsecret.c.functions; 18 public import libsecret.c.types; 19 20 21 /** 22 * An attribute in a #SecretSchema. 23 */ 24 public final class SchemaAttribute 25 { 26 /** the main Gtk struct */ 27 protected SecretSchemaAttribute* secretSchemaAttribute; 28 protected bool ownedRef; 29 30 /** Get the main Gtk struct */ 31 public SecretSchemaAttribute* getSchemaAttributeStruct(bool transferOwnership = false) 32 { 33 if (transferOwnership) 34 ownedRef = false; 35 return secretSchemaAttribute; 36 } 37 38 /** the main Gtk struct as a void* */ 39 protected void* getStruct() 40 { 41 return cast(void*)secretSchemaAttribute; 42 } 43 44 /** 45 * Sets our main struct and passes it to the parent class. 46 */ 47 public this (SecretSchemaAttribute* secretSchemaAttribute, bool ownedRef = false) 48 { 49 this.secretSchemaAttribute = secretSchemaAttribute; 50 this.ownedRef = ownedRef; 51 } 52 53 ~this () 54 { 55 if ( ownedRef ) 56 g_free(secretSchemaAttribute); 57 } 58 59 60 /** 61 * name of the attribute 62 */ 63 public @property string name() 64 { 65 return Str.toString(secretSchemaAttribute.name); 66 } 67 68 /** Ditto */ 69 public @property void name(string value) 70 { 71 secretSchemaAttribute.name = Str.toStringz(value); 72 } 73 74 /** 75 * the type of the attribute 76 */ 77 public @property SecretSchemaAttributeType type() 78 { 79 return secretSchemaAttribute.type; 80 } 81 82 /** Ditto */ 83 public @property void type(SecretSchemaAttributeType value) 84 { 85 secretSchemaAttribute.type = value; 86 } 87 88 /** */ 89 public static GType getType() 90 { 91 return secret_schema_attribute_get_type(); 92 } 93 }