Source: doctype.h


Annotated List
Files
Globals
Hierarchy
Index
// -*- c++ -*-

#ifndef DOCTYPE_H
#define DOCTYPE_H

#include 

#include "doctypeinfo.h"

class QStyleSheet;
class KConfig;
class DocTypeViewManager;

namespace KJSEmbed {
    class JSHookLoader;
};

/**
 * An abstract base class for DocTypes.
 *
 * @author Richard Moore, rich@kde.org
 * @version $Id: doctype_h.html,v 1.1.1.1 2001/11/29 18:18:33 rich Exp $
 */
class DocType : public KXMLGUIClient
{
public:
    /** Creates a DocType with the specified meta-info. */
    DocType( const DocTypeInfo &info );
    virtual ~DocType();

    //
    // Information
    //

    /** Returns the DocTypeInfo describing this DocType. */
    const DocTypeInfo &info() { return typeInfo; }

    /** Returns the data directory for this doctype. */
    QString dataDir() const;

    //
    // Factory methods
    //

    /** Get the config object for this DocType. */
    KConfig *config() const;

    /** 
     * A factory method for creating a DocTypeViewManager for this DocType.
     * This method should never return 0.
     */
    virtual DocTypeViewManager *createViewManager()=0;

    /**
     * A factory method for creating a QStyleSheet for this DocType. This
     * method returns 0 if no stylesheet exists.
     */
    virtual QStyleSheet *styleSheet() { return 0; }

    //
    // JS Hooks
    //
    KJSEmbed::JSHookLoader *jsHooks() const;
    void runJSHook( const QString &name );

    //
    // Event Handlers
    //
    virtual void onLoad();
    virtual void onUnload();

private:
    DocTypeInfo typeInfo;
    mutable KConfig *conf;
    mutable KJSEmbed::JSHookLoader *hooks;
};

#endif // DOCTYPE_H

// Local Variables:
// c-basic-offset: 4
// End:


Generated by: rich on pegasus on Fri Nov 9 01:30:42 2001, using kdoc 2.0a53.