FX::FXFileDict Class Reference

#include <FXFileDict.h>

Inheritance diagram for FX::FXFileDict:

FX::FXDict FX::FXObject List of all members.

Detailed Description

The File Association dictionary associates a file extension with a File Association record which contains command name, mime type, icons, and other information about the file type. The icons referenced by the file association are managed by the Icon Dictionary; this guarantees that each icon is loaded only once into memory. The associations are determined by the information by the FOX Registry settings; each entry under the FILETYPES registry section comprises the command line, extension name, large icon, small icon, and mime type:

command ';' extension ';' bigicon [ ':' bigiconopen ] ';' icon [ ':' iconopen ] ';' mime [ ';' flags ]

For example, the binding for "jpg" could be:

xv s &;JPEG Image;bigimage.xpm;miniimage.xpm;image/jpeg;term

The association for a file name is determined by first looking at the entire file name, then at the whole extension, and then at sub-extensions. For example, "name.tar.gz", "tar.gz", and "gz" can each be given a different file association. Directory names may also be given associations; there is no command-line association for a directory, however. The association for a directory is found by first checking the whole pathname, then checking the pathname less the first component, and so on. So, "/usr/local/include", "/local/include", and "/include" can each be given their own file associations. If the above lookup procedure has not found a file association, the system uses a fallback associations: for files, the fallback association is determined by the binding "defaultfilebinding". For directories, the "defaultdirbinding" is used, and for executables the "defaultexecbinding" is used. The flags field is used for a number of bit-flags; two flags are currently defined: 'cd' and 'term'. The first one is intended to cause a launcher to execute the application in the shown directory; the second one is meant to indicate that the application is to be ran inside a new terminal.

Definition at line 85 of file FXFileDict.h.

Public Member Functions

 FXFileDict (FXApp *app)
 FXFileDict (FXApp *app, FXSettings *db)
void setSettings (FXSettings *s)
FXSettingsgetSettings () const
void setIconDict (FXIconDict *icns)
FXIconDictgetIconDict () const
void setIconPath (const FXString &path)
const FXStringgetIconPath () const
FXFileAssocreplace (const FXchar *ext, const FXchar *str)
FXFileAssocremove (const FXchar *ext)
FXFileAssocfind (const FXchar *ext)
virtual FXFileAssocfindFileBinding (const FXchar *pathname)
virtual FXFileAssocfindDirBinding (const FXchar *pathname)
virtual FXFileAssocfindExecBinding (const FXchar *pathname)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXFileDict ()
void size (FXint m)
FXint size () const
FXint no () const
void * insert (const FXchar *ky, const void *ptr, bool mrk=false)
void * replace (const FXchar *ky, const void *ptr, bool mrk=false)
void * find (const FXchar *ky) const
bool empty (FXint pos) const
const FXcharkey (FXuint pos) const
void * data (FXuint pos) const
bool mark (FXuint pos) const
FXint first () const
FXint last () const
FXint next (FXint pos) const
FXint prev (FXint pos) const
void clear ()
virtual long onDefault (FXObject *, FXSelector, void *)
const FXchargetClassName () const
bool isMemberOf (const FXMetaClass *metaclass) const
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
QTransString tr (const char *text, const char *hint=0)
virtual void * getPythonObject () const
virtual void decouplePythonObject () const

Static Public Attributes

static const FXchardefaultExecBinding
static const FXchardefaultDirBinding
static const FXchardefaultFileBinding

Protected Member Functions

 FXFileDict ()
virtual void * createData (const void *)
virtual void deleteData (void *)

Static Protected Member Functions

static FXint hash (const FXchar *str)

Protected Attributes

FXDictEntry * dict
FXint total
FXint number


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:33:42 2009 for TnFOX by doxygen v1.4.7