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

0001 /*
0002 * This file is part of KDevelop
0003 *
0004 * Copyright 2007-2010 Alexander Dymo <adymo@kdevelop.org>
0005 * Copyright (C) 2014-2015 Miquel Sabaté Solà <mikisabate@gmail.com>
0006 *
0007 * This program is free software; you can redistribute it and/or modify
0008 * it under the terms of the GNU Library General Public License as
0009 * published by the Free Software Foundation; either version 2 of the
0010 * License, or (at your option) any later version.
0011 *
0012 * This program is distributed in the hope that it will be useful,
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 * GNU General Public License for more details.
0016 *
0017 * You should have received a copy of the GNU General Public
0018 * License along with this program; if not, write to the
0019 * Free Software Foundation, Inc.,
0020 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #ifndef RAILS_SWITCHERS_H
0024 #define RAILS_SWITCHERS_H
0025 
0026 #include <rails/export.h>
0027 #include <util/path.h>
0028 
0029 namespace ruby {
0030 
0031 class LanguageSupport;
0032 
0033 namespace rails {
0034 
0035 /**
0036  * @class Switchers
0037  *
0038  * This class has all the logic to switch between controllers, models, views
0039  * and tests, in a Rails application.
0040  */
0041 class KDEVRUBYRAILS_EXPORT Switchers : public QObject
0042 {
0043     Q_OBJECT
0044 
0045 public:
0046     explicit Switchers(ruby::LanguageSupport *language);
0047 
0048     /// @returns all the views that we can switch to.
0049     static QVector<KDevelop::Path> viewsToSwitch();
0050 
0051     /// @returns all the tests that we can switch to.
0052     static QVector<KDevelop::Path> testsToSwitch();
0053 
0054 public slots:
0055     void switchToController();
0056     void switchToModel();
0057     void switchToView();
0058     void switchToTest();
0059 };
0060 
0061 }
0062 }
0063 
0064 #endif // RAILS_SWITCHERS_H
0065