Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

sourcelanguage.h

Go to the documentation of this file.
00001 /*  Inti-SourceView: Integrated Foundation Classes
00002  *  Copyright (C) 2003 The Inti 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 
00024 
00025 #ifndef INTI_GTK_SOURCE_LANGUAGE_H
00026 #define INTI_GTK_SOURCE_LANGUAGE_H
00027 
00028 #ifndef INTI_G_OBJECT_H
00029 #include <inti/glib/object.h>
00030 #endif
00031 
00032 #ifndef INTI_GTK_SOURCE_TAG_H
00033 #include <inti/gtk-sourceview/sourcetagstyle.h>
00034 #endif
00035 
00036 #ifndef __GTK_SOURCE_LANGUAGE_H__
00037 #include <gtksourceview/gtksourcelanguage.h>
00038 #endif
00039 
00040 #ifndef __GTK_SOURCE_LANGUAGES_MANAGER_H__
00041 #include <gtksourceview/gtksourcelanguagesmanager.h>
00042 #endif
00043 
00044 #ifndef _CPP_VECTOR
00045 #include <vector>
00046 #endif
00047 
00048 namespace Inti {
00049 
00050 namespace Gtk {
00051 
00052 class SourceLanguageClass;
00053 class SourceLanguagesManagerClass;
00054 class SourceStyleScheme;
00055 class TextTag;
00056 
00061 
00062 class SourceLanguage : public G::Object
00063 {
00064         friend class G::Object;
00065         friend class SourceLanguageClass;
00066 
00067         SourceLanguage(const SourceLanguage&);
00068         SourceLanguage& operator=(const SourceLanguage&);
00069 
00070 protected:
00073 
00074         explicit SourceLanguage(GtkSourceLanguage *language, bool reference = false);
00081 
00085 
00086         virtual void on_tag_style_changed(const String& name);
00089 
00091 //  Signals
00092 
00093         typedef G::Signal1<void, const char*> TagStyleChangedSignalType;
00094         typedef G::SignalProxy<TypeInstance, TagStyleChangedSignalType> TagStyleChangedSignalProxy;
00095         static const TagStyleChangedSignalType tag_style_changed_signal;
00096 
00097 public:
00100 
00101         virtual ~SourceLanguage();
00103 
00107 
00108         GtkSourceLanguage* gtk_source_language() const { return (GtkSourceLanguage*)instance; }
00110 
00111         GtkSourceLanguageClass* gtk_source_language_class() const;
00113 
00114         operator GtkSourceLanguage* () const;
00116 
00117         bool is_gtk_source_language() const;
00119 
00123 
00124         String get_id() const;
00126 
00127         String get_name() const;
00130 
00131         String get_section() const;
00134 
00135         bool get_tags(std::vector<Pointer<TextTag> >& tags) const;
00139 
00140         G::Unichar get_escape_char() const;
00142 
00143         bool get_mime_types(std::vector<String>& mime_types) const;
00147 
00148         SourceStyleScheme* get_style_scheme() const;
00150 
00151         SourceTagStyle* get_tag_style(const String& tag_id) const;
00155 
00156         SourceTagStyle* get_tag_default_style(const String& tag_id) const;
00160 
00164 
00165         void set_mime_types(const std::vector<String>& mime_types);
00168 
00169         void set_style_scheme(SourceStyleScheme& scheme);
00172 
00173         void set_tag_style(const String& tag_id, const SourceTagStyle& style);
00177 
00181 
00182         const TagStyleChangedSignalProxy sig_tag_style_changed()
00183         {
00184                 return TagStyleChangedSignalProxy(this, &tag_style_changed_signal);
00185         }
00187 
00189 };
00190 
00195 
00196 class SourceLanguagesManager : public G::Object
00197 {
00198         friend class G::Object;
00199         friend class SourceLanguagesManagerClass;
00200 
00201         SourceLanguagesManager(const SourceLanguagesManager&);
00202         SourceLanguagesManager& operator=(const SourceLanguagesManager&);
00203 
00204 protected:
00207 
00208         explicit SourceLanguagesManager(GtkSourceLanguagesManager *lm, bool reference = false);
00215 
00217 //  Properties
00218 
00219         typedef G::Property<GSList*> LangSpecsDirsPropertyType;
00220         typedef G::PropertyProxy<G::Object, LangSpecsDirsPropertyType> LangSpecsDirsPropertyProxy;
00221         static const LangSpecsDirsPropertyType lang_specs_dirs_property;
00222 
00223 public:
00226 
00227         SourceLanguagesManager();
00229 
00230         virtual ~SourceLanguagesManager();
00232 
00236 
00237         GtkSourceLanguagesManager* gtk_source_languages_manager() const { return (GtkSourceLanguagesManager*)instance; }
00239 
00240         GtkSourceLanguagesManagerClass* gtk_source_languages_manager_class() const;
00242 
00243         operator GtkSourceLanguagesManager* () const;
00245 
00246         bool is_gtk_source_languages_manager() const;
00248 
00252 
00253         bool get_available_languages(std::vector<SourceLanguage*>& languages) const;
00257 
00258         SourceLanguage* get_language_from_mime_type(const String& mime_type) const;
00262 
00263         Gtk::SourceLanguage* get_language_from_name(const String& language) const;
00270 
00271         bool get_lang_files_dirs(std::vector<String>& dirs) const;
00275 
00279 
00280         const LangSpecsDirsPropertyProxy prop_lang_specs_dirs()
00281         {
00282                 return LangSpecsDirsPropertyProxy(this, &lang_specs_dirs_property);
00283         }
00286 
00288 };
00289 
00290 } // namespace Gtk
00291 
00292 } // namespace Inti
00293 
00294 #endif // INTI_GTK_SOURCE_LANGUAGE_H
00295 
Main Page - Footer


Generated on Wed Aug 27 21:17:27 2003 for Inti-SourceView by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002