/*
 *  Copyright (C)  2000-2001 Marc Wandschneider <mw@kiltdown.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation.
 *
 *  For more information look at the file COPYRIGHT in this package
 *
 */
#ifndef _ISUBSYSTEM_H_
#define _ISUBSYSTEM_H_


class IAccount;

/**
 * Simple siting interface ...
 */
class ISubsystemHost {

  public:
    /**
     * This is how a subsystem adds an account to the host.
     */
    virtual ERRCODE addAccount(IAccount *) = 0;
    
    /**
     * this is how subsystems tell the host an account is going away.
     */
    virtual void removeAccount(IAccount *) = 0;
};


/**
 * This interface defines a subsystem that we will interface with.
 */
class ISubsystem {

  public:
    /**
     * Creates a new account in this subsystem.  Brings up all the dialogs
     * et al required to actually create it.
     */
    virtual ERRCODE createNewAccount() = 0;

    /**
     * Returns the account at the given index.
     */
    virtual ERRCODE getAccount(int, IAccount **) = 0;

    /**
     * returns the number of accounts that this subsystem is managing right 
     * now.
     */
    virtual ERRCODE getAccountCount(int *) = 0;

    /**
     * Returns the display name for this subsystem.  This is used in menus
     * and other places in the UI.
     */
    virtual ERRCODE getDisplayName(const char **) = 0;

    /**
     * Initializes the subsystem and gives it a site pointer.
     */
    virtual ERRCODE initialize(ISubsystemHost *) = 0;

    /**
     * Tells the subsystem to remove the given account, optionally destroying
     * all associated files.
     */
    virtual void removeAccount(IAccount *, bool) = 0;

    /**
     * Destroys the given subsystem.
     */
    virtual void terminate() = 0;

};
 


#endif // _ISUBSYSTEM_H_





syntax highlighted by Code2HTML, v. 0.9.1