module Fox
  #
  # File selection widget
  #
  # === File selection modes
  #
  # +SELECTFILE_ANY+::		A single file, existing or not (to save to)
  # +SELECTFILE_EXISTING+::	An existing file (to load)
  # +SELECTFILE_MULTIPLE+::	Multiple existing files
  # +SELECTFILE_MULTIPLE_ALL+::	Multiple existing files or directories
  # +SELECTFILE_DIRECTORY+::	Existing directory
  #
  # === Message identifiers
  #
  # +ID_FILEFILTER+::		x
  # +ID_ACCEPT+::		x
  # +ID_FILELIST+::		x
  # +ID_DIRECTORY_UP+::		x
  # +ID_DIRTREE+::		x
  # +ID_HOME+::			x
  # +ID_WORK+::			x
  # +ID_BOOKMARK+::		x
  # +ID_VISIT+::		x
  # +ID_NEW+::			x
  # +ID_DELETE+::		x
  # +ID_MOVE+::			x
  # +ID_COPY+::			x
  # +ID_LINK+::			x
  #
  class FXFileSelector < FXPacker
  
    # The "Accept" button [FXButton]
    attr_reader :acceptButton
    
    # The "Cancel" button [FXButton]
    attr_reader :cancelButton

    # File name [String]
    attr_accessor :filename
    
    # File pattern [String]
    attr_accessor :pattern
    
    # Directory [String]
    attr_accessor :directory
    
    # Current pattern number [Integer]
    attr_accessor :currentPattern

    # Inter-item spacing (in pixels) [Integer]
    attr_accessor :itemSpace
  
    # Change file list style [Integer]
    attr_accessor :fileBoxStyle
  
    # Change file selection mode [Integer]
    attr_accessor :selectMode
  
    #
    # Return an initialized FXFileSelector instance.
    #
    def initialize(p, tgt=nil, sel=0, opts=0, x=0, y=0, w=0, h=0) # :yields: theFileSelector
    end
  
    #
    # Returns an array of the selected file names.
    #
    def filenames; end
  
    #
    # Change the list of file patterns shown in the file dialog.
    # Each pattern comprises an optional name, followed by a pattern in
    # parentheses.  The patterns are separated by newlines.
    # For example,
    #
    #  "*\n*.cpp,*.cc\n*.hpp,*.hh,*.h"
    #
    # and
    #
    #  "All Files (*)\nC++ Sources (*.cpp,*.cc)\nC++ Headers (*.hpp,*.hh,*.h)"
    #
    # will set the same three patterns, but the former shows no pattern names.
    #
    def patternList=(patterns); end
  
    # Returns the list of patterns (an Array of Strings)
    def patternList(); end

    # Get pattern text for given pattern number
    def getPatternText(patno); end
  
    # Change pattern text for pattern number
    def setPatternText(patno, text); end
  
    # Show read-only button.
    def readOnlyShown=(shown); end
    
    # Return +true+ if the read-only button is shown.
    def readOnlyShown?; end
    
    # Set state of read-only button.
    def readOnly=(state); end
  
    # Return +true+ if in read-only mode.
    def readOnly?; end
  end
end

