/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                Copyright (c) 2002-2008 Zanoza Software.                 *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:  Declaration of the class ILibraryHolder
 *   Interface that holds information about the library.
 *   Information it holds is enough to load this library.
 *--------------------------------------------------------------------------
 * @created: Thursday, January 02, 2003 17:02:39
 */

#if !defined(ILibraryHolder_h_included)
#define ILibraryHolder_h_included
//forward declaration of this class might require
namespace core
{ namespace libs
  { class ILibraryHolder; class CLibraryHolderCol; }; };
#include <zmodeler.h>
#include <core/libs/libtypes.h>
#include <core/libs/ILibrary.h>


namespace core
{
  namespace libs
  {
    
    class ILibraryHolder : public ZUnknown
    {
    public:
      virtual ZRESULT getLibrary(core::libs::ILibrary** ppLib)=0;
      virtual ZRESULT setLibrary(core::libs::ILibrary* pLib)=0;
      /* returns ZRESULT_OK if this holder has initiated LoadLibrary, so Repository can
       * associate a loaded lib with this holder. */
      virtual ZRESULT isLoading(void)=0;
      /* returns ZRESULT_OK if library is loaded. ZRESULT_FALSE otherwise */
      virtual ZRESULT isLoaded(void)=0;
      /* Provides library requirements bits. (It takes these bits from library once it loaded first time) */
      virtual ZRESULT getLibRequirements(DWORD& dwReq)=0;
      virtual ZRESULT getModuleName(ZString& strName)=0;
      virtual ZRESULT getModulePath(ZString& strPath)=0;
      virtual ZRESULT setModuleName(ZString strName)=0;
      virtual ZRESULT setModulePath(ZString strPath)=0;
    
    };//class ILibraryHolder
    
    //
    // collection template
    //
    class CLibraryHolderCol : public ZUnknown,
        public ZIntrCollection<ILibraryHolder>
    {
    public:
      INTERFACE_FUNCTIONS_DEFAULT(CLibraryHolderCol)
    };//class CLibraryHolderCol
  };//libs
};//core

#endif
