//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "RVEdit.hpp"
#include "RichView.hpp"
#include "RVScroll.hpp"
#include "RVStyle.hpp"
#include "CRVFData.hpp"
#include "RVTable.hpp"
#include <Dialogs.hpp>
#include <Graphics.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TRichViewEdit *RichViewEdit1;
	TButton *Button1;
	TButton *Button2;
	TButton *Button3;
	TRVStyle *RVStyle1;
	TOpenDialog *OpenDialog1;
	TOpenDialog *OpenDialog2;
	TSaveDialog *SaveDialog1;
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall RichViewEdit1RVFPictureNeeded(TCustomRichView *Sender,
	UnicodeString Name, int Tag, TGraphic *&gr);
	void __fastcall RichViewEdit1Copy(TObject *Sender);
	
	void __fastcall Button3Click(TObject *Sender);
	void __fastcall Button2Click(TObject *Sender);
	void __fastcall Button1Click(TObject *Sender);
        void __fastcall RichViewEdit1ImportPicture(TCustomRichView *Sender,
          const UnicodeString Location, int Width, int Height,
          TGraphic *&Graphic);
        void __fastcall RichViewEdit1SaveItemToFile(
          TCustomRichView *Sender, const UnicodeString Path,
          TCustomRVData *RVData, int ItemNo, TRVSaveFormat SaveFormat,
          bool Unicode, TRVRawByteString &OutStr, bool &DoDefault);
private:	// User declarations
    UnicodeString BasePath;
    UnicodeString CopyImageToTheImagesDir(UnicodeString ImageFileName, TGraphic* gr);
    void SaveAllUnknownImages(TCustomRVData* RVData);
    void ConvertAllPathsToRelativePaths(TCustomRVData* RVData);
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
 