1 /* 2 Copyright (C) 2015 Volker Krause <vkrause@kde.org> 3 4 This program is free software; you can redistribute it and/or modify it 5 under the terms of the GNU Library General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or (at your 7 option) any later version. 8 9 This program is distributed in the hope that it will be useful, but WITHOUT 10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 12 License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program. If not, see <https://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef CODENAVIGATOR_H 19 #define CODENAVIGATOR_H 20 21 class QAction; 22 class QString; 23 class QUrl; 24 class QWidget; 25 26 /** Navigate to a given code path in your favorite IDE. */ 27 namespace CodeNavigator 28 { 29 /** Returns @c true if we can do code navigation. */ 30 bool isValid(); 31 32 /** Open @p filePath, and navigate to line @p line if that's greater or equal to 0. */ 33 void goTo(const QString &filePath, int line = -1); 34 /** URL-encoded form of the above. */ 35 void goTo(const QUrl &url); 36 37 /** Returns a action for selecting your preferred IDE. */ 38 QAction* configMenu(QWidget *parent = nullptr); 39 } 40 41 #endif // CODENAVIGATOR_H 42