~kdevelop/kdevplatform/master

« back to all changes in this revision

Viewing changes to util/texteditorhelpers.h

  • Committer: Friedrich W. H. Kossebau
  • Date: 2017-08-13 21:54:31 UTC
  • Revision ID: git-v1:8ce76bea4df0831deb2fb243af33cc90d3cc8043
Wipe master branch and point in README to new location

Summary: also add util script for moving over existing personal branches

Reviewers: #kdevelop, apol, kfunk

Reviewed By: #kdevelop, apol, kfunk

Subscribers: kfunk, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D7244

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE project
2
 
   Copyright 2015 Maciej Cencora
3
 
 
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.
8
 
 
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.
13
 
 
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.
18
 
*/
19
 
 
20
 
#ifndef KDEVPLATFORM_TEXTEDITORHELPERS_H
21
 
#define KDEVPLATFORM_TEXTEDITORHELPERS_H
22
 
 
23
 
#include <QRect>
24
 
#include <KTextEditor/Range>
25
 
 
26
 
#include "utilexport.h"
27
 
 
28
 
namespace KTextEditor {
29
 
class View;
30
 
}
31
 
 
32
 
namespace KDevelop {
33
 
 
34
 
namespace KTextEditorHelpers {
35
 
 
36
 
/// @return Item's bounding rect in global screen coordinates
37
 
QRect KDEVPLATFORMUTIL_EXPORT getItemBoundingRect(const KTextEditor::View* view, const KTextEditor::Range& itemRange);
38
 
 
39
 
/**
40
 
 * @brief Try parsing a string such as "path_to_file:line_num:column_num".
41
 
 *
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
46
 
 * */
47
 
KTextEditor::Cursor KDEVPLATFORMUTIL_EXPORT extractCursor(const QString& input, int* pathLength = nullptr);
48
 
 
49
 
}
50
 
 
51
 
}
52
 
 
53
 
#endif // KDEVPLATFORM_TEXTEDITORHELPERS_H