1
/* This file is part of the KDE project
2
Copyright 2015 Maciej Cencora
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
20
#ifndef KDEVPLATFORM_TEXTEDITORHELPERS_H
21
#define KDEVPLATFORM_TEXTEDITORHELPERS_H
24
#include <KTextEditor/Range>
26
#include "utilexport.h"
28
namespace KTextEditor {
34
namespace KTextEditorHelpers {
36
/// @return Item's bounding rect in global screen coordinates
37
QRect KDEVPLATFORMUTIL_EXPORT getItemBoundingRect(const KTextEditor::View* view, const KTextEditor::Range& itemRange);
40
* @brief Try parsing a string such as "path_to_file:line_num:column_num".
42
* Both line_num and column_num may be empty. Thus, other valid inputs are: "path_to_file", "path_to_file:line_num"
43
* @param input Source string
44
* @param pathLength Set to the length of the "path_to_file" string, you can use this to extract the raw path from the input string
45
* @return Cursor representing line_num and column_num
47
KTextEditor::Cursor KDEVPLATFORMUTIL_EXPORT extractCursor(const QString& input, int* pathLength = nullptr);
53
#endif // KDEVPLATFORM_TEXTEDITORHELPERS_H