GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

type.hh

Go to the documentation of this file.
00001 /* GFC-Core: GTK+ Foundation Classes (Core Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00021 00022 #ifndef GFC_G_TYPE_HH 00023 #define GFC_G_TYPE_HH 00024 00025 #ifndef GFC_TRACKABLE_HH 00026 #include <gfc/trackable.hh> 00027 #endif 00028 00029 #ifndef GFC_G_SIGNALS_HH 00030 #include <gfc/glib/signals.hh> 00031 #endif 00032 00033 #ifndef GFC_UTF_STRING_HH 00034 #include <gfc/utfstring.hh> 00035 #endif 00036 00037 namespace GFC { 00038 00039 namespace G { 00040 00050 00051 class TypeInstance : public virtual Trackable 00052 { 00053 TypeInstance(const TypeInstance&); 00054 TypeInstance& operator=(const TypeInstance&); 00055 00056 protected: 00057 GTypeInstance *instance_; 00059 00060 TypeInstance(); 00062 00063 virtual ~TypeInstance() = 0; 00065 00066 public: 00069 00070 GTypeInstance* g_type_instance() const; 00072 00073 bool is_a(GType is_a_type) const; 00079 00080 GType type() const; 00082 00083 String type_name() const; 00085 00086 GType parent_type() const; 00087 // Get the GType of the immediate parent for the instance, or 0 if it has no parent. 00088 00092 00093 void add_interface(GType interface_type); 00096 00098 00099 static void add_interface(GType instance_type, GType interface_type); 00103 00104 static GType register_type(GType parent_type); 00108 }; 00109 00112 00113 class TypeInterface : public virtual TypeInstance 00114 { 00115 protected: 00118 00119 TypeInterface(); 00121 00122 virtual ~TypeInterface() = 0; 00124 00126 00127 public: 00128 static bool is_interface(GType type); 00136 00139 00140 GTypeInterface* g_type_interface(GType type) const; 00144 00146 }; 00147 00148 } // namespace G 00149 00150 } // namespace GFC 00151 00152 #include <gfc/glib/inline/type.inl> 00153 00154 #endif // GFC_G_TYPE_HH 00155

Generated on Tue Aug 24 00:04:56 2004 for GFC-Core by doxygen 1.3.8