1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-02-10 17:53:36 +00:00
|
|
|
* Copyright 1997-2000 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_URL_H
|
|
|
|
#define INSET_URL_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
|
|
|
#include "buffer.h"
|
1999-10-25 14:50:26 +00:00
|
|
|
#include "form_url.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
struct LaTeXFeatures;
|
|
|
|
|
|
|
|
/** The url inset
|
|
|
|
*/
|
1999-11-24 22:14:46 +00:00
|
|
|
class InsetUrl : public InsetCommand {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
enum Url_Flags {
|
|
|
|
///
|
|
|
|
URL,
|
|
|
|
///
|
|
|
|
HTML_URL
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
InsetUrl() : InsetCommand("url"), fd_form_url(0) {
|
1999-11-04 01:40:20 +00:00
|
|
|
flag = InsetUrl::URL;
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetUrl(string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetUrl(InsetCommand const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetUrl(string const &, string const &, string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
~InsetUrl();
|
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
Inset * Clone() const { return new InsetUrl(getCommand()); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const { return Inset::URL_CODE; }
|
|
|
|
///
|
|
|
|
void Validate(LaTeXFeatures &) const;
|
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
void Edit(BufferView *, int, int, unsigned int);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-08 13:52:57 +00:00
|
|
|
EDITABLE Editable() const {
|
|
|
|
return IS_EDITABLE;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
const char * EditMessage() const {return _("Opened Url");}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
bool display() const { return false; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string getScreenLabel() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetUrl::Url_Flags getFlag() const { return flag; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void setFlag(InsetUrl::Url_Flags f) { flag = f; }
|
|
|
|
///
|
|
|
|
void gotoLabel();
|
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Latex(ostream &, signed char fragile) const;
|
2000-03-02 02:19:43 +00:00
|
|
|
#ifndef USE_OSTREAM_ONLY
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Latex(string & file, signed char fragile) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Linuxdoc(string & file) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int DocBook(string & file) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
#else
|
|
|
|
///
|
|
|
|
int Linuxdoc(ostream &) const;
|
|
|
|
///
|
|
|
|
int DocBook(ostream &) const;
|
|
|
|
#endif
|
1999-10-19 15:06:30 +00:00
|
|
|
///
|
|
|
|
static void CloseUrlCB(FL_OBJECT *, long data);
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
2000-02-22 00:36:17 +00:00
|
|
|
///
|
|
|
|
struct Holder {
|
|
|
|
InsetUrl * inset;
|
|
|
|
BufferView * view;
|
|
|
|
};
|
|
|
|
///
|
|
|
|
Holder holder;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Url_Flags flag;
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
FD_form_url * fd_form_url;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|