/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: sbaexpl1.hxx,v $
 *
 *  $Revision: 1.3 $
 *
 *  last change: $Author: rt $ $Date: 2005/09/07 16:29:48 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/
#ifndef _OFA_SBAEXPL1_HXX
#define _OFA_SBAEXPL1_HXX

#ifndef _OFA_SBAEXPL_HXX
#include "sbaexpl.hxx"
#endif

#ifndef _IMAGE_HXX //autogen
#include <vcl/image.hxx>
#endif

#ifndef _EXPCONT_HXX //autogen
#include <bf_sfx2/expcont.hxx>
#endif

#ifndef _EXPLMENU_HXX //autogen
#include <bf_sfx2/explmenu.hxx>
#endif

#ifndef _ICON_HXX //autogen
#include <vcl/icon.hxx>
#endif

#ifndef _STRING_HXX //autogen
#include <tools/string.hxx>
#endif
namespace binfilter {


class SbaObject;
class SbaDatabase;

//-------------------------------------------------------------------------
// Container von Tabellen(Explorer)

class SbaTableContainer: public SbaDBFolder
{
	friend class SbaTableContent;
	friend class SbaDatabaseContainer;

public:
	TYPEINFO();
	SbaTableContainer();

	virtual Image GetImage( SfxExplorerContentImage eImage );

protected:
	virtual void PrepareContextMenu( SfxExplorerContextMenu& rMenu );
	virtual void Load(BOOL);
	virtual Icon GetIcon();
	virtual String ToURL() const;
	virtual String GetUniqueName();
	virtual void CallWizardImpl();

private:
	DECL_LINK(OnCompress, void* );
	DECL_LINK( OnRelations, void* );
};

//-------------------------------------------------------------------------
// eine Tabelle

class SbaTableContent: public SbaDBContent
{
	Link aRenameLink;
protected:
	SbaTableContent():SbaDBContent(dbTable, CONTENT_INPLACECONSTRUCTION |
								   CONTENT_URLTOOPEN |
								   CONTENT_BROWSERVIEWAVAILABLE, TRUE){}

public:
	TYPEINFO();
	SbaTableContent(const String& rTitle, SbaDatabase* pDatabase);
	SbaTableContent(SbaDBDef& rObj);

protected:
	virtual Image GetImage( SfxExplorerContentImage eImage );
	virtual BOOL Initialize(const String&);
	virtual BOOL Initialize(SfxExplorerContent* pParent);
	virtual void Open(const String& rTargetFrame);
	virtual void PrepareContextMenu( SfxExplorerContextMenu& rMenu );
	virtual BOOL TitleEdited(SfxExplorerContentView*, const String& rNewTitel);
	virtual BOOL QueryFeature(SfxExplorerFeature eFeature);
	virtual BOOL Save();
	virtual void Destroy();

private:
	DECL_LINK(OnAddressbook, String* );
	DECL_LINK(OnRename, SfxContextMenuData*);
	DECL_LINK(OnDesignView, void* );
};


//-------------------------------------------------------------------------
// eine Datenbankview, wird nur zum erzeugen benoetigt
class SbaViewContent: public SbaTableContent
{
	Link aRenameLink;
	SbaViewContent(){}

public:
	TYPEINFO();

protected:
	virtual BOOL Initialize(SfxExplorerContent* pParent);
};


} //namespace binfilter
#endif


