1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
2007-10-13 19:06:09 +00:00
|
|
|
* \file InsetHyperlink.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author José Matos
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2007-10-13 19:06:09 +00:00
|
|
|
#ifndef INSET_HYPERLINK_H
|
|
|
|
#define INSET_HYPERLINK_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCommand.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2007-10-13 19:06:09 +00:00
|
|
|
/** The hyperlink inset
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
2008-04-08 20:19:23 +00:00
|
|
|
class InsetHyperlink : public InsetCommand
|
|
|
|
{
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2010-10-27 21:35:13 +00:00
|
|
|
InsetHyperlink(Buffer * buf, InsetCommandParams const &);
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2010-10-27 21:35:13 +00:00
|
|
|
/// \name Public functions inherited from Inset class
|
|
|
|
//@{
|
2003-05-26 09:13:55 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return HYPERLINK_CODE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool hasSettings() const override { return true; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool isInToc() const override { return true; }
|
2010-10-27 21:35:13 +00:00
|
|
|
///
|
2023-12-31 13:09:17 +00:00
|
|
|
bool findUsesToString() const override { return true; }
|
2023-05-18 16:07:40 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void toString(odocstream &) const override;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void forOutliner(docstring &, size_t const, bool const) const override;
|
2010-12-20 21:55:09 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const override;
|
2010-10-27 21:35:13 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
std::string contextMenuName() const override;
|
2010-10-27 21:35:13 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void validate(LaTeXFeatures &) const override;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const override;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2013-03-08 19:52:18 +00:00
|
|
|
int plaintext(odocstringstream & ods, OutputParams const & op,
|
2020-10-01 07:42:11 +00:00
|
|
|
size_t max_length = INT_MAX) const override;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void docbook(XMLStream &, OutputParams const &) const override;
|
2009-06-05 17:48:14 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring xhtml(XMLStream &, OutputParams const &) const override;
|
2021-01-10 06:50:01 +00:00
|
|
|
///
|
|
|
|
std::pair<int, int> isWords() const override;
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/// \name Static public methods obligated for InsetCommand derived classes
|
|
|
|
//@{
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2017-07-03 17:45:58 +00:00
|
|
|
static bool isCompatibleCommand(std::string const & s)
|
2007-10-25 04:13:56 +00:00
|
|
|
{ return s == "href"; }
|
2009-12-10 18:30:48 +00:00
|
|
|
///
|
2010-10-27 21:35:13 +00:00
|
|
|
static std::string defaultCommand() { return "href"; }
|
2010-08-29 16:40:52 +00:00
|
|
|
///
|
2010-10-27 21:35:13 +00:00
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
|
|
|
//@}
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
private:
|
2010-10-27 21:35:13 +00:00
|
|
|
/// \name Private functions inherited from Inset class
|
|
|
|
//@{
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
|
2010-08-29 17:23:35 +00:00
|
|
|
///
|
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
2020-10-01 07:42:11 +00:00
|
|
|
FuncStatus & flag) const override;
|
2010-08-29 17:23:35 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override { return new InsetHyperlink(*this); }
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/// \name Private functions inherited from InsetCommand class
|
|
|
|
//@{
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring screenLabel() const override;
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
///
|
|
|
|
void viewTarget() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2010-10-27 21:35:13 +00:00
|
|
|
#endif // INSET_HYPERLINK_H
|