* ======================================================
*
* LyX, The Document Processor
- *
- * Copyright (C) 1997 LyX Team (this file was created this year)
- *
- *======================================================*/
+ *
+ * Copyright 1997-2001 The LyX Team.
+ *
+ * ====================================================== */
-#ifndef _INSET_URL_H
-#define _INSET_URL_H
+#ifndef INSET_URL_H
+#define INSET_URL_H
#ifdef __GNUG__
#pragma interface
#endif
#include "insetcommand.h"
-#include "buffer.h"
struct LaTeXFeatures;
-/** The url inset
+/** The url inset
*/
-class InsetUrl: public InsetCommand {
+class InsetUrl : public InsetCommand {
public:
- ///
- enum Url_Flags {
- ///
- URL,
- ///
- HTML_URL
- };
-
- ///
- InsetUrl(): InsetCommand("url"), form(0) { flag = InsetUrl::URL; }
- ///
- InsetUrl(string const &);
- ///
- InsetUrl(InsetCommand const&);
- ///
- InsetUrl(string const &,string const &,string const &);
///
- ~InsetUrl();
- ///
- Inset* Clone() { return new InsetUrl(getCommand()); }
+ explicit
+ InsetUrl(InsetCommandParams const &, bool same_id = false);
///
- Inset::Code LyxCode() const { return Inset::URL_CODE; }
- ///
- void Validate(LaTeXFeatures &) const;
- ///
- void Edit(int, int);
- ///
- unsigned char Editable() const {
- return 1;
+ virtual Inset * clone(Buffer const &, bool same_id = false) const {
+ return new InsetUrl(params(), same_id);
}
///
- char const* EditMessage() {return "Opened Url";}
- ///
- bool Display() const { return false; }
- ///
- string getScreenLabel() const;
- ///
- InsetUrl::Url_Flags getFlag() { return flag; }
- ///
- void setFlag(InsetUrl::Url_Flags f) { flag = f; }
- ///
- void gotoLabel();
+ Inset::Code lyxCode() const { return Inset::URL_CODE; }
///
- int Latex(FILE *file, signed char fragile);
+ void validate(LaTeXFeatures &) const;
///
- int Latex(string &file, signed char fragile);
+ string const getScreenLabel(Buffer const *) const;
///
- int Linuxdoc(string &file);
+ EDITABLE editable() const { return IS_EDITABLE; }
///
- int DocBook(string &file);
+ void edit(BufferView *, int, int, unsigned int);
///
- static void CloseUrlCB(FL_OBJECT *, long data);
-private:
+ void edit(BufferView * bv, bool front = true);
///
- Url_Flags flag;
+ bool display() const { return false; }
///
- FL_FORM *form;
+ int latex(Buffer const *, std::ostream &,
+ bool fragile, bool free_spc) const;
///
- FL_OBJECT *url_name;
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- FL_OBJECT *name_name;
+ int linuxdoc(Buffer const *, std::ostream &) const;
///
- FL_OBJECT *radio_html;
+ int docbook(Buffer const *, std::ostream &) const;
};
#endif