klayout/src/lay/gsiDeclLayHelpDialog.cc

117 lines
3.7 KiB
C++
Raw Normal View History

/*
KLayout Layout Viewer
2017-02-12 15:28:14 +01:00
Copyright (C) 2006-2017 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "layHelpDialog.h"
#include "layHelpSource.h"
#include "layMainWindow.h"
#include "laybasicCommon.h"
#include "gsiDecl.h"
#include "gsiQtExternals.h"
namespace tl
{
// type traits for HelpDialog
template <>
struct type_traits<lay::HelpDialog> : public type_traits<void> {
typedef tl::false_tag has_default_constructor;
typedef tl::false_tag has_copy_constructor;
};
}
namespace gsi
{
lay::HelpDialog *new_help_dialog (bool modal)
{
return new lay::HelpDialog (lay::MainWindow::instance (), modal);
}
lay::HelpDialog *new_help_dialog_with_parent (QWidget *parent, bool modal)
{
return new lay::HelpDialog (parent, modal);
}
Class<lay::HelpDialog> decl_HelpDialog (QT_EXTERNAL_BASE (QDialog) "HelpDialog",
method ("new", new_help_dialog,
"@brief Creates a new help dialog\n"
"@args modal\n"
"If the modal flag is true, the dialog will be shown as a modal window.\n"
) +
#if defined(HAVE_QTBINDINGS)
method ("new", new_help_dialog_with_parent,
"@brief Creates a new help dialog\n"
"@args parent, modal\n"
"If the modal flag is true, the dialog will be shown as a modal window.\n"
) +
#else
method ("show", &lay::HelpDialog::show,
"@brief Shows the dialog\n"
) +
method ("exec", &lay::HelpDialog::exec,
"@brief Executes the dialog (shows it modally)\n"
) +
#endif
method ("search", &lay::HelpDialog::search,
"@brief Issues a search on the specified topic\n"
"@args topic\n"
"This method will call the search page with the given topic.\n"
) +
method ("load", &lay::HelpDialog::load,
"@brief Loads the specified URL\n"
"@args url\n"
"This method will call the page with the given URL.\n"
),
"@brief The help dialog\n"
"\n"
"This class makes the help dialog available as an individual object.\n"
"\n"
"This class has been added in version 0.25.\n"
);
LAYBASIC_PUBLIC Class<lay::BrowserSource> &laybasicdecl_BrowserSource ();
Class<lay::HelpSource> decl_HelpSource (laybasicdecl_BrowserSource (), "HelpSource",
#if defined(HAVE_QTBINDINGS)
gsi::method ("get_dom", &lay::HelpSource::get_dom, "@brief For internal use") +
#endif
gsi::method ("urls", &lay::HelpSource::urls, "@brief Reserved for internal use") +
gsi::method ("title_for", &lay::HelpSource::title_for, gsi::arg ("path"), "@brief Reserved internal use") +
gsi::method ("parent_of", &lay::HelpSource::parent_of, gsi::arg ("path"), "@brief Reserved internal use") +
gsi::method ("create_index_file", &lay::HelpSource::create_index_file, gsi::arg ("path"), "@brief Reserved internal use"),
"@brief A \\BrowserSource implementation delivering the help text for the help dialog\n"
"This class can be used together with a \\BrowserPanel or \\BrowserDialog object to implement "
"custom help systems.\n"
"\n"
"The basic URL's served by this class are: \"int:/index.xml\" for the index page and "
"\"int:/search.xml?string=...\" for the search topic retrieval.\n"
"\n"
"This class has been added in version 0.25.\n"
);
}