// CodeGear C++Builder
// Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Anyolectnrs.pas' rev: 21.00

#ifndef AnyolectnrsHPP
#define AnyolectnrsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Commctrl.hpp>	// Pascal unit
#include <Activex.hpp>	// Pascal unit
#include <Oledlg.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Menus.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Comobj.hpp>	// Pascal unit
#include <Anyconsts.hpp>	// Pascal unit
#include <Types.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------
#include <DocObj.h>

namespace Anyolectnrs
{
//-- type declarations -------------------------------------------------------
__interface INewVCLFrameForm;
typedef System::DelphiInterface<INewVCLFrameForm> _di_INewVCLFrameForm;
class DELPHICLASS TCustomOleContainer;
__interface  INTERFACE_UUID("{B03E9253-13B2-4C96-A506-A1A7C147F102}") INewVCLFrameForm  : public IOleInPlaceFrame 
{
	
public:
	virtual void __fastcall AddContainer(TCustomOleContainer* Instance) = 0 ;
	virtual void __fastcall RemoveContainer(TCustomOleContainer* Instance) = 0 ;
	virtual void __fastcall ClearBorderSpace(void) = 0 ;
	virtual Forms::TCustomForm* __fastcall Form(void) = 0 ;
};

#pragma option push -b-
enum TAutoActivate { aaManual, aaGetFocus, aaDoubleClick };
#pragma option pop

#pragma option push -b-
enum TSizeMode { smClip, smCenter, smScale, smStretch, smAutoSize };
#pragma option pop

#pragma option push -b-
enum TObjectState { osEmpty, osLoaded, osRunning, osOpen, osInPlaceActive, osUIActive };
#pragma option pop

#pragma option push -b-
enum TCreateType { ctNewObject, ctFromFile, ctLinkToFile, ctFromData, ctLinkFromData };
#pragma option pop

struct TCreateInfo
{
	
public:
	TCreateType CreateType;
	bool ShowAsIcon;
	unsigned IconMetaPict;
	#pragma pack(push,1)
	GUID ClassID;
	#pragma pack(pop)
	System::WideString FileName;
	_di_IDataObject DataObject;
};


#pragma pack(push,1)
struct TVerbInfo
{
	
public:
	short Verb;
	System::Word Flags;
};
#pragma pack(pop)


typedef void __fastcall (__closure *TObjectMoveEvent)(TCustomOleContainer* OleContainer, const Types::TRect &Bounds);

class PASCALIMPLEMENTATION TCustomOleContainer : public Controls::TCustomControl
{
	typedef Controls::TCustomControl inherited;
	
private:
	int FRefCount;
	_di_ILockBytes FLockBytes;
	_di_IStorage FStorage;
	_di_IOleObject FOleObject;
	int FDrawAspect;
	Types::TPoint FViewSize;
	Classes::TStringList* FObjectVerbs;
	int FDataConnection;
	_di_INewVCLFrameForm FDocForm;
	_di_INewVCLFrameForm FFrameForm;
	_di_IOleInPlaceObject FOleInPlaceObject;
	_di_IOleInPlaceActiveObject FOleInPlaceActiveObject;
	HACCEL FAccelTable;
	int FAccelCount;
	Menus::TPopupMenu* FPopupVerbMenu;
	bool FAllowInPlace;
	bool FAllowActiveDoc;
	TAutoActivate FAutoActivate;
	bool FAutoVerbMenu;
	Forms::TFormBorderStyle FBorderStyle;
	bool FCopyOnSave;
	bool FOldStreamFormat;
	TSizeMode FSizeMode;
	bool FObjectOpen;
	bool FUIActive;
	bool FModified;
	bool FModSinceSave;
	bool FFocused;
	bool FNewInserted;
	Classes::TNotifyEvent FOnActivate;
	Classes::TNotifyEvent FOnDeactivate;
	TObjectMoveEvent FOnObjectMove;
	Classes::TNotifyEvent FOnResize;
	_di_IOleDocumentView FDocView;
	bool FDocObj;
	Forms::_di_IOleForm FOleForm;
	HRESULT __stdcall SaveObject(void);
	HRESULT __stdcall GetMoniker(int dwAssign, int dwWhichMoniker, /* out */ _di_IMoniker &mk);
	HRESULT __stdcall GetContainer(/* out */ _di_IOleContainer &container);
	HRESULT __stdcall ShowObject(void);
	HRESULT __stdcall OnShowWindow(BOOL fShow);
	HRESULT __stdcall RequestNewObjectLayout(void);
	HRESULT __stdcall ContextSensitiveHelp(BOOL fEnterMode);
	HRESULT __stdcall GetWindow(/* out */ HWND &wnd);
	HRESULT __stdcall CanInPlaceActivate(void);
	HRESULT __stdcall OnInPlaceActivate(void);
	HRESULT __stdcall OnUIActivate(void);
	HRESULT __stdcall GetWindowContext(/* out */ _di_IOleInPlaceFrame &frame, /* out */ _di_IOleInPlaceUIWindow &doc, /* out */ Types::TRect &rcPosRect, /* out */ Types::TRect &rcClipRect, /* out */ tagOIFI &frameInfo);
	HRESULT __stdcall Scroll(const Types::TPoint scrollExtent);
	HRESULT __stdcall OnUIDeactivate(BOOL fUndoable);
	HRESULT __stdcall OnInPlaceDeactivate(void);
	HRESULT __stdcall DiscardUndoState(void);
	HRESULT __stdcall DeactivateAndUndo(void);
	HRESULT __stdcall OnPosRectChange(const Types::TRect &rcPosRect);
	void __stdcall OnDataChange(const tagFORMATETC &formatetc, const tagSTGMEDIUM &stgmed);
	void __stdcall OnViewChange(int dwAspect, int lindex);
	void __stdcall OnRename(const _di_IMoniker mk);
	void __stdcall OnSave(void);
	void __stdcall OnClose(void);
	HRESULT __stdcall ActivateMe(_di_IOleDocumentView View);
	HRESULT __stdcall GetObjectInfo(int dwObject, int &dwObjSize, System::WideChar * &lpszLabel, System::WideChar * &lpszType, System::WideChar * &lpszShortType, System::WideChar * &lpszLocation);
	HRESULT __stdcall GetConvertInfo(int dwObject, GUID &ClassID, System::Word &wFormat, GUID &ConvertDefaultClassID, System::PGUID &lpClsidExclude, int &cClsidExclude);
	HRESULT __stdcall ConvertObject(int dwObject, const GUID &clsidNew);
	HRESULT __stdcall GetViewInfo(int dwObject, unsigned &hMetaPict, int &dvAspect, int &nCurrentScale);
	HRESULT __stdcall SetViewInfo(int dwObject, unsigned hMetaPict, int dvAspect, int nCurrentScale, BOOL bRelativeToOrig);
	void __fastcall AdjustBounds(void);
	void __fastcall CheckObject(void);
	void __fastcall CreateAccelTable(void);
	void __fastcall CreateStorage(void);
	void __fastcall DesignModified(void);
	void __fastcall DestroyAccelTable(void);
	void __fastcall DestroyVerbs(void);
	int __fastcall GetBorderWidth(void);
	bool __fastcall GetCanPaste(void);
	bool __fastcall GetIconic(void);
	bool __fastcall GetLinked(void);
	int __fastcall GetObjectDataSize(void);
	Classes::TStrings* __fastcall GetObjectVerbs(void);
	System::UnicodeString __fastcall GetOleClassName(void);
	System::Variant __fastcall GetOleObject(void);
	int __fastcall GetPrimaryVerb(void);
	System::UnicodeString __fastcall GetSourceDoc(void);
	TObjectState __fastcall GetState(void);
	void __fastcall InitObject(void);
	void __fastcall ObjectMoved(const Types::TRect &ObjectRect);
	void __fastcall PopupVerbMenuClick(System::TObject* Sender);
	void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
	void __fastcall SetDrawAspect(bool Iconic, unsigned IconMetaPict);
	void __fastcall SetFocused(bool Value);
	void __fastcall SetIconic(bool Value);
	void __fastcall SetSizeMode(TSizeMode Value);
	void __fastcall SetUIActive(bool Active);
	void __fastcall SetViewAdviseSink(bool Enable);
	void __fastcall UpdateObjectRect(void);
	void __fastcall UpdateView(void);
	HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
	MESSAGE void __fastcall CMDocWindowActivate(Messages::TMessage &Message);
	MESSAGE void __fastcall CMUIDeactivate(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMSetFocus &Message);
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	HIDESBASE MESSAGE void __fastcall WMWindowPosChanged(Messages::TWMWindowPosMsg &Message);
	
protected:
	virtual HRESULT __stdcall QueryInterface(const GUID &IID, /* out */ void *Obj);
	HIDESBASE int __stdcall _AddRef(void);
	HIDESBASE int __stdcall _Release(void);
	HIDESBASEDYNAMIC void __fastcall Changed(void);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	DYNAMIC void __fastcall DblClick(void);
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	DYNAMIC void __fastcall DoEnter(void);
	DYNAMIC Menus::TPopupMenu* __fastcall GetPopupMenu(void);
	DYNAMIC void __fastcall KeyDown(System::Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall Paint(void);
	
public:
	__fastcall virtual TCustomOleContainer(Classes::TComponent* AOwner);
	__fastcall virtual ~TCustomOleContainer(void);
	bool __fastcall ChangeIconDialog(void);
	void __fastcall Close(void);
	void __fastcall Copy(void);
	void __fastcall CreateLinkToFile(const System::WideString FileName, bool Iconic);
	void __fastcall CreateObject(const System::UnicodeString OleClassName, bool Iconic);
	void __fastcall CreateObjectFromFile(const System::WideString FileName, bool Iconic);
	void __fastcall CreateObjectFromInfo(const TCreateInfo &CreateInfo);
	void __fastcall DestroyObject(void);
	void __fastcall DoVerb(int Verb);
	unsigned __fastcall GetIconMetaPict(void);
	bool __fastcall InsertObjectDialog(void);
	void __fastcall LoadFromFile(const System::WideString FileName);
	void __fastcall LoadFromStream(Classes::TStream* Stream);
	bool __fastcall ObjectPropertiesDialog(void);
	void __fastcall Paste(void);
	bool __fastcall PasteSpecialDialog(void);
	void __fastcall Run(void);
	void __fastcall SaveAsDocument(const System::WideString FileName);
	void __fastcall SaveToFile(const System::WideString FileName);
	void __fastcall SaveToStream(Classes::TStream* Stream);
	void __fastcall UpdateObject(void);
	void __fastcall UpdateVerbs(void);
	__property bool CanPaste = {read=GetCanPaste, nodefault};
	__property bool Linked = {read=GetLinked, nodefault};
	__property bool Modified = {read=FModified, write=FModified, nodefault};
	__property bool NewInserted = {read=FNewInserted, nodefault};
	__property Classes::TStrings* ObjectVerbs = {read=GetObjectVerbs};
	__property System::UnicodeString OleClassName = {read=GetOleClassName};
	__property System::Variant OleObject = {read=GetOleObject};
	__property _di_IOleObject OleObjectInterface = {read=FOleObject};
	__property int PrimaryVerb = {read=GetPrimaryVerb, nodefault};
	__property System::UnicodeString SourceDoc = {read=GetSourceDoc};
	__property TObjectState State = {read=GetState, nodefault};
	__property _di_IStorage StorageInterface = {read=FStorage};
	__property Forms::_di_IOleForm OleFormObject = {read=FOleForm, write=FOleForm};
	
__published:
	__property bool AllowInPlace = {read=FAllowInPlace, write=FAllowInPlace, default=1};
	__property bool AllowActiveDoc = {read=FAllowActiveDoc, write=FAllowActiveDoc, default=1};
	__property TAutoActivate AutoActivate = {read=FAutoActivate, write=FAutoActivate, default=2};
	__property bool AutoVerbMenu = {read=FAutoVerbMenu, write=FAutoVerbMenu, default=1};
	__property Align = {default=0};
	__property Anchors = {default=3};
	__property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
	__property Caption;
	__property Color = {default=-16777211};
	__property Constraints;
	__property bool CopyOnSave = {read=FCopyOnSave, write=FCopyOnSave, default=1};
	__property Ctl3D;
	__property DragCursor = {default=-12};
	__property DragMode = {default=0};
	__property Enabled = {default=1};
	__property bool Iconic = {read=GetIconic, write=SetIconic, stored=false, nodefault};
	__property bool OldStreamFormat = {read=FOldStreamFormat, write=FOldStreamFormat, default=0};
	__property ParentColor = {default=0};
	__property ParentCtl3D = {default=1};
	__property ParentShowHint = {default=1};
	__property PopupMenu;
	__property ShowHint;
	__property TSizeMode SizeMode = {read=FSizeMode, write=SetSizeMode, default=0};
	__property TabOrder = {default=-1};
	__property TabStop = {default=1};
	__property Visible = {default=1};
	__property Classes::TNotifyEvent OnActivate = {read=FOnActivate, write=FOnActivate};
	__property Classes::TNotifyEvent OnDeactivate = {read=FOnDeactivate, write=FOnDeactivate};
	__property OnDragDrop;
	__property OnDragOver;
	__property OnEndDrag;
	__property OnEnter;
	__property OnExit;
	__property OnMouseDown;
	__property OnMouseMove;
	__property OnMouseUp;
	__property OnKeyDown;
	__property OnKeyPress;
	__property OnKeyUp;
	__property TObjectMoveEvent OnObjectMove = {read=FOnObjectMove, write=FOnObjectMove};
	__property Classes::TNotifyEvent OnResize = {read=FOnResize, write=FOnResize};
	__property OnStartDrag;
public:
	/* TWinControl.CreateParented */ inline __fastcall TCustomOleContainer(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
	
private:
	void *__IOleUIObjInfo;	/* IOleUIObjInfo */
	void *__IOleDocumentSite;	/* IOleDocumentSite */
	void *__IAdviseSink;	/* IAdviseSink */
	void *__IOleInPlaceSite;	/* IOleInPlaceSite */
	void *__IOleClientSite;	/* IOleClientSite */
	
public:
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleUIObjInfo()
	{
		_di_IOleUIObjInfo intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleUIObjInfo*(void) { return (IOleUIObjInfo*)&__IOleUIObjInfo; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleDocumentSite()
	{
		_di_IOleDocumentSite intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleDocumentSite*(void) { return (IOleDocumentSite*)&__IOleDocumentSite; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IAdviseSink()
	{
		_di_IAdviseSink intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IAdviseSink*(void) { return (IAdviseSink*)&__IAdviseSink; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleInPlaceSite()
	{
		_di_IOleInPlaceSite intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleInPlaceSite*(void) { return (IOleInPlaceSite*)&__IOleInPlaceSite; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleClientSite()
	{
		_di_IOleClientSite intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleClientSite*(void) { return (IOleClientSite*)&__IOleClientSite; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator System::_di_IInterface()
	{
		System::_di_IInterface intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IInterface*(void) { return (IInterface*)&__IOleUIObjInfo; }
	#endif
	
};


class DELPHICLASS TNewOleForm;
class PASCALIMPLEMENTATION TNewOleForm : public System::TInterfacedObject
{
	typedef System::TInterfacedObject inherited;
	
private:
	TCustomOleContainer* FForm;
	Classes::TList* FContainers;
	_di_IOleInPlaceActiveObject FActiveObject;
	int FSaveWidth;
	int FSaveHeight;
	Classes::TList* FHiddenControls;
	StaticArray<Controls::TControl*, 4> FSpacers;
	void __fastcall OnDestroy(void);
	void __fastcall OnResize(void);
	HRESULT __stdcall GetWindow(/* out */ HWND &wnd);
	HRESULT __stdcall ContextSensitiveHelp(BOOL fEnterMode);
	HRESULT __stdcall GetBorder(/* out */ Types::TRect &BorderRect);
	HRESULT __stdcall RequestBorderSpace(const Types::TRect &borderwidths);
	HRESULT __stdcall SetBorderSpace(Types::PRect pborderwidths);
	HRESULT __stdcall SetActiveObject(const _di_IOleInPlaceActiveObject ActiveObject, System::WideChar * pszObjName);
	HRESULT __stdcall InsertMenus(HMENU hmenuShared, tagOleMenuGroupWidths &menuWidths);
	HRESULT __stdcall SetMenu(HMENU hmenuShared, HMENU holemenu, HWND hwndActiveObject);
	HRESULT __stdcall RemoveMenus(HMENU hmenuShared);
	HRESULT __stdcall SetStatusText(System::WideChar * pszStatusText);
	HRESULT __stdcall EnableModeless(BOOL fEnable);
	HRESULT __stdcall TranslateAccelerator(tagMSG &msg, System::Word wID);
	void __fastcall AddContainer(TCustomOleContainer* Instance);
	void __fastcall RemoveContainer(TCustomOleContainer* Instance);
	Forms::TCustomForm* __fastcall Form(void);
	void __fastcall ClearBorderSpace(void);
	bool __fastcall IsSpacer(Controls::TControl* Control);
	bool __fastcall IsToolControl(Controls::TControl* Control);
	
public:
	__fastcall TNewOleForm(TCustomOleContainer* Form);
	__fastcall virtual ~TNewOleForm(void);
private:
	void *__INewVCLFrameForm;	/* INewVCLFrameForm */
	void *__IOleForm;	/* Forms::IOleForm */
	
public:
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_INewVCLFrameForm()
	{
		_di_INewVCLFrameForm intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator INewVCLFrameForm*(void) { return (INewVCLFrameForm*)&__INewVCLFrameForm; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleInPlaceFrame()
	{
		_di_IOleInPlaceFrame intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleInPlaceFrame*(void) { return (IOleInPlaceFrame*)&__INewVCLFrameForm; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleInPlaceUIWindow()
	{
		_di_IOleInPlaceUIWindow intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleInPlaceUIWindow*(void) { return (IOleInPlaceUIWindow*)&__INewVCLFrameForm; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator _di_IOleWindow()
	{
		_di_IOleWindow intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleWindow*(void) { return (IOleWindow*)&__INewVCLFrameForm; }
	#endif
	#if defined(MANAGED_INTERFACE_OPERATORS)
	operator Forms::_di_IOleForm()
	{
		Forms::_di_IOleForm intf;
		GetInterface(intf);
		return intf;
	}
	#else
	operator IOleForm*(void) { return (IOleForm*)&__IOleForm; }
	#endif
	
};


//-- var, const, procedure ---------------------------------------------------
static const ShortInt ovShow = -1;
static const ShortInt ovOpen = -2;
static const ShortInt ovHide = -3;
static const ShortInt ovUIActivate = -4;
static const ShortInt ovInPlaceActivate = -5;
static const ShortInt ovDiscardUndoState = -6;
static const int ovPrimary = -65536;
extern PACKAGE void __fastcall DestroyMetaPict(unsigned MetaPict);

}	/* namespace Anyolectnrs */
using namespace Anyolectnrs;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AnyolectnrsHPP
