File indexing completed on 2024-04-21 04:35:50

0001 /* This file is part of KDevelop
0002  *
0003  * Copyright (C) 2012-2015 Miquel Sabaté Solà <mikisabate@gmail.com>
0004  *
0005  * This program is free software: you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation, either version 3 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 
0020 #ifndef RUBYCOMPLETIONHELPERS_H
0021 #define RUBYCOMPLETIONHELPERS_H
0022 
0023 
0024 #include <QtCore/QList>
0025 #include <QtCore/QVariant>
0026 #include <completion/completionexport.h>
0027 
0028 
0029 namespace KTextEditor {
0030     class Document;
0031 }
0032 
0033 namespace KDevelop {
0034     class Declaration;
0035 }
0036 
0037 namespace ruby {
0038 
0039 class NormalItem;
0040 
0041 /**
0042  * Get a string representing an indentation.
0043  *
0044  * @param document The current document.
0045  * @returns a QString containing the indentation to be used.
0046  */
0047 const QString KDEVRUBYCOMPLETION_EXPORT indentString(KTextEditor::Document *document);
0048 
0049 /// Get the indentation of a given @p line.
0050 QString KDEVRUBYCOMPLETION_EXPORT getIndendation(const QString &line);
0051 
0052 /**
0053  * Get the representation of the arguments list of a method declaration.
0054  * @param decl The declaration of the method.
0055  * @param highlighting A list of the highlighted items of the text. You
0056  * usually want this list empty before calling this method.
0057  * @note the DUChain must be locked.
0058  * @returns a QString representing the argument list of the given method.
0059  */
0060 QString KDEVRUBYCOMPLETION_EXPORT getArgumentList(KDevelop::Declaration *decl, QList<QVariant> *highlighting);
0061 
0062 }
0063 
0064 
0065 #endif // RUBYCOMPLETIONHELPERS_H