//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include "RVEdit.hpp"
#include "RichView.hpp"
#include "RVScroll.hpp"
#include "RVStyle.hpp"
#include "CRVFData.hpp"
#include "RVTable.hpp"
#include <vcl\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,
	AnsiString 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 AnsiString Location, int Width, int Height,
          TGraphic *&Graphic);
        void __fastcall RichViewEdit1SaveItemToFile(
          TCustomRichView *Sender, const AnsiString Path,
          TCustomRVData *RVData, int ItemNo, TRVSaveFormat SaveFormat,
          bool Unicode, TRVRawByteString &OutStr, bool &DoDefault);
private:	// User declarations
    AnsiString CopyImageToTheImagesDir(AnsiString ImageFileName, TGraphic* gr);
    void SaveAllUnknownImages(TCustomRVData* RVData);
    void ConvertAllPathsToRelativePaths(TCustomRVData* RVData);    
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
 