## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --              GtkAda - Ada95 binding for Gtk+/Gnome                --

3.     --                                                                   --

4.     --                Copyright (C) 2006-2011, AdaCore                   --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  A Gtk_File_Filter can be used to restrict the files being shown in a

31.     --  Gtk_File_Chooser. Files can be filtered based on their name (with

32.     --  Add_Pattern), on their mime type (with Add_Mime_Type), or by a custom

33.     --  filter function (with Add_Custom).

34.     --

35.     --  Filtering by mime types handles aliasing and subclassing of mime types;

36.     --  e.g. a filter for text/plain also matches a file with mime type

37.     --  application/rtf, since application/rtf is a subclass of text/plain. Note

38.     --  that Gtk_File_Filter allows wildcards for the subtype of a mime type, so

39.     --  you can e.g. filter for image/*.

40.     --

41.     --  Normally, filters are used by adding them to a Gtk_File_Chooser, see

42.     --  Add_Filter, but it is also possible to manually use a filter on a file with

43.     --  Filter.

44.     --  </description>

45.     --  <c_version>2.8.17</c_version>

46.     --  <group>Selectors</group>

48.     with GlibTo API docTo specTo body;

49.     with Glib.ObjectTo API docTo specTo body;

50.     with System;

52.     package Gtk.File_FilterTo API docTo specTo body is

54.        type Gtk_File_Filter_RecordTo API docTo body is

55.          new Glib.Object.GObject_RecordTo API docTo specTo body with private;

56.        type Gtk_File_Filter is access all Gtk_File_Filter_RecordTo API docTo specTo body'Class;

58.        type File_Filter_Info is new Glib.C_ProxyTo API docTo spec;

59.        --  An opaque structure that contains information about a file

61.        function Get_FilenameTo API docTo body     (Info : File_Filter_InfoTo API docTo spec) return String;

62.        function Get_UriTo API docTo body          (Info : File_Filter_InfoTo API docTo spec) return String;

63.        function Get_Display_NameTo API docTo body (Info : File_Filter_InfoTo API docTo spec) return String;

64.        function Get_Mime_TypeTo API docTo body    (Info : File_Filter_InfoTo API docTo spec) return String;

65.        --  Return the various information known about the file. The empty string is

66.        --  returned when the associated information is unknown. Display_Name is the

67.        --  string used to display the file in a file_chooser.

69.        type File_Filter_Flags is mod 2 ** 8;

70.        Filter_Filename     : constant File_Filter_FlagsTo API docTo spec := 2 ** 0;

71.        Filter_Uri          : constant File_Filter_FlagsTo API docTo spec := 2 ** 1;

72.        Filter_Display_Name : constant File_Filter_FlagsTo API docTo spec := 2 ** 2;

73.        Filter_Mime_Type    : constant File_Filter_FlagsTo API docTo spec := 2 ** 3;

74.        --  These flags indicate what parts of a Gtk_File_Filter_Info struct are

75.        --  filled or need to be filled.

77.        type File_Filter_Func is access function

78.          (Info : File_Filter_InfoTo API docTo spec) return GbooleanTo API docTo spec;

79.        pragma Convention (C, File_Filter_FuncTo API docTo spec);

80.        --  Function used by custom filters

82.        function Get_TypeTo API docTo body return GTypeTo API docTo spec;

83.        --  Return the internal value associated with a Gtk_File_Filter

85.        procedure Gtk_NewTo API docTo body    (Filter : out Gtk_File_FilterTo API docTo spec);

86.        procedure InitializeTo API docTo body (Filter : access Gtk_File_Filter_RecordTo API docTo specTo body'Class);

87.        --  Creates a new Gtk_File_Filter with no rules added to it. Such a filter

88.        --  doesn't accept any files, so is not particularly useful until you add

89.        --  rules with Add_Mime_Type, Add_Pattern, or Add_Custom. To create a filter

90.        --  that accepts any file, use:

91.        --      Gtk_New (Filter);

92.        --      Add_Pattern (Filter, "*");

94.        procedure Set_NameTo API docTo body

95.          (Filter : access Gtk_File_Filter_RecordTo API docTo specTo body; Name : String);

96.        function Get_NameTo API docTo body (Filter : access Gtk_File_Filter_RecordTo API docTo specTo body) return String;

97.        --  Sets the human-readable name of the filter; this is the string

98.        --  that will be displayed in the file selector user interface if

99.        --  there is a selectable list of filters.

101.        procedure Add_Mime_TypeTo API docTo body

102.          (Filter    : access Gtk_File_Filter_RecordTo API docTo specTo body;

103.           Mime_Type : String);

104.        --  Adds a rule allowing a given mime type to Filter.

105.        --  In particular, if you want to show directories only and not files, you

106.        --  could use "x-directory/normal" as the Mime type

108.        procedure Add_PatternTo API docTo body

109.          (Filter  : access Gtk_File_Filter_RecordTo API docTo specTo body;

110.           Pattern : String);

111.        --  Adds a rule allowing a shell style glob to a filter.

113.        procedure Add_Pixbuf_FormatsTo API docTo body

114.          (Filter : access Gtk_File_Filter_RecordTo API docTo specTo body);

115.        --  Adds a rule allowing image files in the formats supported

116.        --  by Gdk_Pixbuf.

118.        procedure Add_CustomTo API docTo body

119.          (Filter : access Gtk_File_Filter_RecordTo API docTo specTo body;

120.           Needed : File_Filter_FlagsTo API docTo spec;

121.           Func   : File_Filter_FuncTo API docTo spec;

122.           Data   : System.Address := System.Null_Address;

123.           Notify : G_Destroy_Notify_AddressTo API docTo spec := null);

124.        --  Adds rule to a filter that allows files based on a custom callback

125.        --  function. The bitfield Needed which is passed in provides information

126.        --  about what sorts of information that the filter function needs;

127.        --  this allows GTK+ to avoid retrieving expensive information when

128.        --  it isn't needed by the filter.

129.        --  Notify is called when Data is no longer needed and should be freed.

131.     private

132.        type Gtk_File_Filter_RecordTo API docTo spec is

133.          new Glib.Object.GObject_RecordTo API docTo specTo body with null record;

135.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_file_filter_get_type");

136.     end Gtk.File_FilterTo API docTo specTo body;

138.     --  No binding: gtk_file_filter_filter

139.     --  No binding: gtk_file_filter_get_needed