//Auto-generated by kalyptus. DO NOT EDIT. package org.kde.koala; import org.kde.qt.Qt; import org.kde.qt.QtSupport; import java.util.ArrayList; /** This is one of the most central classes in tdelibs as it provides a basic service: It knows where the files reside on the user's hard disk. And it's meant to be the only one that knows -- to make the real location as transparent as possible to both the user and the applications. To this end it insulates the application from all information and applications always refer to a file with a resource type (e.g. icon) and a filename (e.g. khexdit.xpm). In an ideal world the application would make no assumption where this file is and leave it up to KStandardDirs.findResource("apps", "Home.desktop") to apply this knowledge to return /opt/kde/share/applnk/Home.desktop or .locate("data", "kgame/background.jpg") to return /opt/kde/share/apps/kgame/background.jpg The main idea behind KStandardDirs is that there are several toplevel prefixes below which the files lie. One of these prefixes is the one where the user installed tdelibs, one is where the application was installed, and one is $HOME/.kde, but there may be even more. Under these prefixes there are several well defined suffixes where specific resource types are to be found. For example, for the resource type "html" the suffixes could be share/doc/HTML and share/doc/tde/HTML. So the search algorithm basically appends to each prefix each registered suffix and tries to locate the file there. To make the thing even more complex, it's also possible to register absolute paths that KStandardDirs looks up after not finding anything in the former steps. They can be useful if the user wants to provide specific directories that aren't in his $HOME/.kde directory for, for example, icons.
fsstnd
list.
fsstnd
list.
*/
public native void addPrefix(String dir);
/**
Adds another search dir to front of the XDG_CONFIG_XXX list
of prefixes.
This prefix is only used for resources that start with "xdgconf-"
@param dir The directory to append relative paths to.
@short Adds another search dir to front of the XDG_CONFIG_XXX list of prefixes.
*/
public native void addXdgConfigPrefix(String dir);
/**
Adds another search dir to front of the XDG_DATA_XXX list
of prefixes.
This prefix is only used for resources that start with "xdgdata-"
@param dir The directory to append relative paths to.
@short Adds another search dir to front of the XDG_DATA_XXX list of prefixes.
*/
public native void addXdgDataPrefix(String dir);
/**
Adds suffixes for types.
You may add as many as you need, but it is advised that there
is exactly one to make writing definite.
All basic types ( kde_default) are added by addKDEDefaults(),
but for those you can add more relative paths as well.
The later a suffix is added, the higher its priority. Note, that the
suffix should end with / but doesn't have to start with one (as prefixes
should end with one). So adding a suffix for app_pics would look
like KGlobal.dirs().addResourceType("app_pics", "share/app/pics");
@param type Specifies a short descriptive string to access
files of this type.
@param relativename Specifies a directory relative to the root
of the KFSSTND.
@return true if successful, false otherwise.
@short Adds suffixes for types.
*/
public native boolean addResourceType(String type, String relativename);
/**
Adds absolute path at the end of the search path for
particular types (for example in case of icons where
the user specifies extra paths).
You shouldn't need this
function in 99% of all cases besides adding user-given
paths.
@param type Specifies a short descriptive string to access files
of this type.
@param absdir Points to directory where to look for this specific
type. Non-existant directories may be saved but pruned.
@return true if successful, false otherwise.
@short Adds absolute path at the end of the search path for particular types (for example in case of icons where the user specifies extra paths).
*/
public native boolean addResourceDir(String type, String absdir);
/**
Tries to find a resource in the following order:
config.
@short Reads customized entries out of the given config object and add them via addResourceDirs().
*/
public native boolean addCustomized(KConfig config);
/**
This function is used internally by almost all other function as
it serves and fills the directories cache.
@param type The type of resource
@return The list of possible directories for the specified type.
The function updates the cache if possible. If the resource
type specified is unknown, it will return an empty list.
Note, that the directories are assured to exist beside the save
location, which may not exist, but is returned anyway.
@short This function is used internally by almost all other function as it serves and fills the directories cache.
*/
public native ArrayList resourceDirs(String type);
/**
This function will return a list of all the types that KStandardDirs
supports.
@return All types that KDE supports
@short This function will return a list of all the types that KStandardDirs supports.
*/
public native ArrayList allTypes();
/**
Finds a location to save files into for the given type
in the user's home directory.
@param type The type of location to return.
@param suffix A subdirectory name.
Makes it easier for you to create subdirectories.
You can't pass filenames here, you _have_ to pass
directory names only and add possible filename in
that directory yourself. A directory name always has a
trailing slash ('/').
@param create If set, saveLocation() will create the directories
needed (including those given by suffix
).
@return A path where resources of the specified type should be
saved, or null if the resource type is unknown.
@short Finds a location to save files into for the given type in the user's home directory.
*/
public native String saveLocation(String type, String suffix, boolean create);
public native String saveLocation(String type, String suffix);
public native String saveLocation(String type);
/**
Converts an absolute path to a path relative to a certain
resource.
If "abs = .locate(resource, rel)"
then "rel = relativeLocation(resource, abs)" and vice versa.
@param type The type of resource.
@param absPath An absolute path to make relative.
@return A relative path relative to resource type
that
will find absPath.
If no such relative path exists, absPath
will be returned unchanged.
@short Converts an absolute path to a path relative to a certain resource.
*/
public native String relativeLocation(String type, String absPath);
/**
@short
*/
public native String kfsstnd_prefixes();
/**
@short
*/
public native String kfsstnd_xdg_conf_prefixes();
/**
@short
*/
public native String kfsstnd_xdg_data_prefixes();
/**
Returns the toplevel directory in which KStandardDirs
will store things. Most likely $HOME/.kde
Don't use this function if you can use locateLocal
@return the toplevel directory
@short Returns the toplevel directory in which KStandardDirs will store things.
*/
public native String localtdedir();
/**
@return $XDG_DATA_HOME
See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
@short
*/
public native String localxdgdatadir();
/**
@return $XDG_CONFIG_HOME
See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
@short
*/
public native String localxdgconfdir();
/**
Returns an ArrayList list of pathnames in the system path.
@param pstr The path which will be searched. If this is
null (default), the $PATH environment variable will
be searched.
@return an ArrayList list of pathnames in the system path.
@short Returns an ArrayList list of pathnames in the system path.
*/
public static native ArrayList systemPaths(String pstr);
public static native ArrayList systemPaths();
/**
Finds the executable in the system path.
A valid executable must
be a file and have its executable bit set.
@param appname The name of the executable file for which to search.
@param pathstr The path which will be searched. If this is
null (default), the $PATH environment variable will
be searched.
@param ignoreExecBit If true, an existing file will be returned
even if its executable bit is not set.
@return The path of the executable. If it was not found,
it will return null.
@short Finds the executable in the system path.
@see #findAllExe
*/
public static native String findExe(String appname, String pathstr, boolean ignoreExecBit);
public static native String findExe(String appname, String pathstr);
public static native String findExe(String appname);
/**
Finds all occurrences of an executable in the system path.
@param list Will be filled with the pathnames of all the
executables found. Will be empty if the executable
was not found.
@param appname The name of the executable for which to
search.
@param pathstr The path list which will be searched. If this
is 0 (default), the $PATH environment variable will
be searched.
@param ignoreExecBit If true, an existing file will be returned
even if its executable bit is not set.
@return The number of executables found, 0 if none were found.
@short Finds all occurrences of an executable in the system path.
@see #findExe
*/
public static native int findAllExe(String[] list, String appname, String pathstr, boolean ignoreExecBit);
public static native int findAllExe(String[] list, String appname, String pathstr);
public static native int findAllExe(String[] list, String appname);
/**
Recursively creates still-missing directories in the given path.
The resulting permissions will depend on the current umask setting.
permission = mode & ~umask.
@param dir Absolute path of the directory to be made.
@param mode Directory permissions.
@return true if successful, false otherwise
@short Recursively creates still-missing directories in the given path.
*/
public static native boolean makeDir(String dir, int mode);
public static native boolean makeDir(String dir);
/**
This returns a default relative path for the standard KDE
resource types. Below is a list of them so you get an idea
of what this is all about.
dirname
and returns the canonicalized absolute pathname.
The resulting path will have no symbolic link, '/./'
or '/../' components.
@short Expands all symbolic links and resolves references to '/.
*/
public static native String realPath(String dirname);
/**
Expands all symbolic links and resolves references to
'/./', '/../' and extra '/' characters in filename
and returns the canonicalized absolute pathname.
The resulting path will have no symbolic link, '/./'
or '/../' components.
@short Expands all symbolic links and resolves references to '/.
*/
public static native String realFilePath(String filename);
/** Deletes the wrapped C++ instance */
protected native void finalize() throws InternalError;
/** Delete the wrapped C++ instance ahead of finalize() */
public native void dispose();
/** Has the wrapped C++ instance been deleted? */
public native boolean isDisposed();
}