File indexing completed on 2024-04-28 11:20:48

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2009 Alexander Rieder <alexanderrieder@gmail.com>
0004 */
0005 
0006 #include "syntaxhelpobject.h"
0007 using namespace Cantor;
0008 
0009 #include "session.h"
0010 
0011 #include <QTimer>
0012 
0013 class Cantor::SyntaxHelpObjectPrivate{
0014     public:
0015         QString command;
0016         Cantor::Session* session;
0017         QString htmlResult;
0018 };
0019 
0020 SyntaxHelpObject::SyntaxHelpObject(const QString& command, Cantor::Session* session) : QObject(session),
0021                                                                                        d(new SyntaxHelpObjectPrivate)
0022 {
0023     d->command=command;
0024     d->session=session;
0025 }
0026 
0027 SyntaxHelpObject::~SyntaxHelpObject()
0028 {
0029     delete d;
0030 }
0031 
0032 void SyntaxHelpObject::fetchSyntaxHelp()
0033 {
0034     //Start a delayed fetch
0035     QTimer::singleShot(0, this, &SyntaxHelpObject::fetchInformation);
0036 }
0037 
0038 
0039 QString SyntaxHelpObject::toHtml()
0040 {
0041     return d->htmlResult;
0042 }
0043 
0044 void SyntaxHelpObject::setHtml(const QString& result)
0045 {
0046     d->htmlResult=result;
0047 }
0048 
0049 QString SyntaxHelpObject::command()
0050 {
0051     return d->command;
0052 }
0053 
0054 Session* SyntaxHelpObject::session()
0055 {
0056     return d->session;
0057 }