Logo Search packages:      
Sourcecode: inkscape version File versions

dependency.h

/*
 * Authors:
 *   Ted Gould <ted@gould.cx>
 *
 * Copyright (C) 2004 Authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#ifndef INKSCAPE_EXTENSION_DEPENDENCY_H__
#define INKSCAPE_EXTENSION_DEPENDENCY_H__

#include <glibmm/ustring.h>
#include "xml/repr.h"

namespace Inkscape {
namespace Extension {

/** \brief  A class to represent a dependency for an extension.  There
            are different things that can be done in a dependency, and
            this class takes care of all of them. */
00022 class Dependency {
    /** \brief  The XML representation of the dependency. */
00024     Inkscape::XML::Node * _repr;
    /** \brief  The string that is in the XML tags pulled out. */
00026     const gchar * _string;
    /** \brief  The description of the dependency for the users. */
00028     const gchar * _description;

    /** \brief  All the possible types of dependencies. */
00031     enum type_t {
00032         TYPE_EXECUTABLE, /**< Look for an executable */
00033         TYPE_FILE,       /**< Look to make sure a file exists */
00034         TYPE_EXTENSION,  /**< Make sure a specific extension is loaded and functional */
00035         TYPE_PLUGIN,     /**< Look for a library to be loaded as a plugin */
00036         TYPE_CNT         /**< Number of types */
    };
    /** \brief  Storing the type of this particular dependency. */
00039     type_t _type;

    /** \brief  All of the possible locations to look for the dependency. */
00042     enum location_t {
00043         LOCATION_PATH,       /**< Look in the PATH for this depdendency */
00044         LOCATION_EXTENSIONS, /**< Look in the extensions directory */
00045         LOCATION_ABSOLUTE,   /**< This dependency is already defined in absolute terms */
00046         LOCATION_CNT         /**< Number of locations to look */
    };
    /** \brief  The location to look for this particular dependency. */
00049     location_t _location;

    /** \brief  Strings to reperesent the different enum values in
                \c type_t in the XML */
00053     static gchar const * _type_str[TYPE_CNT]; 
    /** \brief  Strings to reperesent the different enum values in
                \c location_t in the XML */
00056     static gchar const * _location_str[LOCATION_CNT]; 

public:
    Dependency  (Inkscape::XML::Node * in_repr);
    ~Dependency (void);
    bool check  (void) const;
    Glib::ustring &get_help (void) const;
    Glib::ustring &get_link (void) const;

    friend std::ostream & operator<< (std::ostream &out_file, const Dependency & in_dep);
}; /* class Dependency */

std::ostream & operator<< (std::ostream &out_file, const Dependency & in_dep);

} }  /* namespace Extension, Inkscape */

#endif /* INKSCAPE_EXTENSION_DEPENDENCY_H__ */

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :

Generated by  Doxygen 1.6.0   Back to index