// -*- c++ -*-
/*  Generated by gensig from accelgroup.gen_h. DO NOT MODIFY!!! */
#ifndef GTKMM_ACCELGROUP_HEADER
#define GTKMM_ACCELGROUP_HEADER
/* $Id: accelgroup.gen_h,v 1.24.2.2 1999/03/20 17:28:05 glaurent Exp $ */

/* accelgroup.h
 * 
 * Copyright (C) 1998-1999 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtk/gtkaccelgroup.h>
#include <gtk--/object.h>

#line 25 "accelgroup.gen_h"


class Gtk_Object;
class Gtk_Widget;
class Gtk_Menu;
class Gtk_ItemFactoryParent;
class Gtk_Window;

class Gtk_AccelGroup;  

class Gtk_AccelEntry
{
  friend Gtk_AccelGroup;

public:
  Gtk_AccelEntry(GtkAccelEntry *castitem);
  ~Gtk_AccelEntry();

  const Gtk_AccelGroup& get_accel_group() const { return *accel_group_; }
  const Gtk_Object& get_object() const { return *object_; }
  
  const GtkAccelEntry* gtkobj() const { return gtkaccelentry_; }
  GtkAccelEntry* gtkobj() { return gtkaccelentry_; }
  
protected:
  Gtk_AccelGroup *accel_group_;
  Gtk_Object *object_;
  GtkAccelEntry *gtkaccelentry_;
};


class Gtk_AccelGroup
{
public:
  friend class Gtk_Object;
  friend class Gtk_Widget;
  friend class Gtk_Menu;
  friend class Gtk_ItemFactory;
  friend class Gtk_Window;
  Gtk_AccelGroup();
  Gtk_AccelGroup(GtkAccelGroup *castitem);
  virtual ~Gtk_AccelGroup();

  bool activate(guint accel_key, GdkModifierType accel_mod);

  /* how to handle groups_activate? */

  // Disabled since these are internal functions
//   void attach(Gtk_Object &obj);
//   void detach(Gtk_Object &obj);
  void lock  ();
  void unlock();
  
  Gtk_ObjectHandle<Gtk_AccelEntry> get_entry(guint accel_key,
					     GdkModifierType accel_mods) const;

  void lock_entry  (guint accel_key,
		    GdkModifierType accel_mods);
  void unlock_entry(guint accel_key,
		    GdkModifierType accel_mods);

  // enum GtkAccelFlags:
  // <ul>
  // <li>GTK_ACCEL_VISIBLE <br>should the accelerator appear in
  //				  the widget's display?
  // <li>GTK_ACCEL_SIGNAL_VISIBLE <br>should the signal associated
  //				  with this accelerator be also visible?
  // <li>GTK_ACCEL_LOCKED	 <br>may the accelerator be removed again?
  //
  void add(guint accel_key, 
	   GdkModifierType accel_mods,
	   GtkAccelFlags accel_flags,
	   Gtk_Object &obj, 
	   const string &accel_signal); /* fixme signal */

  void remove(guint accel_key,
	      GdkModifierType accel_mods,
	      Gtk_Object &object);

  void handle_add  (Gtk_Object &object,
		    guint accel_signal_id,
		    guint accel_key,
		    GdkModifierType accel_mods,
		    GtkAccelFlags accel_flags);

  void handle_remove(Gtk_Object &object,
		     guint accel_key,
		     GdkModifierType accel_mods);

  /* I'm not sure if create_add/create_remove implementation
     for gtk-- are reasonable :( */
  /*
    guint create_add(GtkType class_type,
                     GtkSignalRunType signal_flags,
		     guint handler_offset);

    guint create_remove(GtkType class_type,
                        GtkSignalRunType signal_flags,
			guint handler_offset);


     marshal_add/remove is not yet implemented -- I'm thinking of how to
     implement the callback stuffs for it.. maybe Signal0* for it --
     Though the GtkArg* thing makes it more difficult - need to think
     it over */

  /* accelgroups_from_object/group_entries_from_object not implemented */
  /* possible implementation?
     static G_List<Gtk_AccelGroup> *groups_from_object(Gtk_Object *object);
     static G_List<Gtk_AccelGroup> *entries_from_object(Gtk_Object *object);
  */

  static bool valid(guint keyval, GdkModifierType modifiers);

  static void parse(const string & accelerator,
		    guint *accelerator_key, // out arg
		    GdkModifierType *accelerator_mods); // out arg

  static string name(guint accelerator_key,
		     GdkModifierType accelerator_mods);

  static void set_default_mod_mask(GdkModifierType default_mod_mask);
  static guint get_default_mod_mask();

  static const Gtk_AccelGroup* get_default();

  static bool groups_activate(const Gtk_Object &object,
			      guint accel_key,
			      GdkModifierType accel_mods);

  const GtkAccelGroup* gtkobj() const { return gtkaccelgroup_; }
  GtkAccelGroup* gtkobj() { return gtkaccelgroup_; }

protected:
  void ref();
  void unref();
	
  GtkAccelGroup *gtkaccelgroup_;
};


#endif
