File indexing completed on 2024-05-19 05:41:55

0001 // codevisdbusinterface.h                                       -*-C++-*-
0002 
0003 /*
0004 // Copyright 2023 Codethink Ltd <codethink@codethink.co.uk>
0005 // SPDX-License-Identifier: Apache-2.0
0006 //
0007 // Licensed under the Apache License, Version 2.0 (the "License");
0008 // you may not use this file except in compliance with the License.
0009 // You may obtain a copy of the License at
0010 //
0011 //     http://www.apache.org/licenses/LICENSE-2.0
0012 //
0013 // Unless required by applicable law or agreed to in writing, software
0014 // distributed under the License is distributed on an "AS IS" BASIS,
0015 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016 // See the License for the specific language governing permissions and
0017 // limitations under the License.
0018 */
0019 
0020 #ifndef LAKOSDIAGRAMDBUSINTERFACE_H
0021 #define LAKOSDIAGRAMDBUSINTERFACE_H
0022 
0023 #include <QObject>
0024 #include <mainwindow.h>
0025 
0026 class CodeVisDBusInterface : public QObject {
0027     Q_OBJECT
0028     Q_CLASSINFO("D-Bus Interface", "org.codethink.CodeVis")
0029 
0030   public:
0031     explicit CodeVisDBusInterface(MainWindow& mainWindow);
0032 
0033     // Tab Management
0034     // requests a new tab from the main window
0035   public Q_SLOTS:
0036     Q_SCRIPTABLE void requestNewTab();
0037 
0038     // requests to close the current tab
0039     Q_SCRIPTABLE void requestCloseCurrentTab();
0040 
0041     // toggles the split view on / off
0042     Q_SCRIPTABLE void requestToggleSplitView();
0043 
0044     // if split view is on, selects the left.
0045     Q_SCRIPTABLE void requestSelectLeftSplitView();
0046 
0047     // if split view is off, selects the right
0048     Q_SCRIPTABLE void requestSelectRightSplitView();
0049 
0050     // requests to close the application
0051     Q_SCRIPTABLE void requestQuit();
0052 
0053     // requests a database to open.
0054     Q_SCRIPTABLE bool requestLoadProject(const QString& project);
0055 
0056     // requests to load a package on the current tab
0057     Q_SCRIPTABLE void requestLoadPackage(const QString& qualifiedName);
0058 
0059     // requests to load a package on the current tab
0060     Q_SCRIPTABLE void requestLoadClass(const QString& qualifiedName);
0061 
0062     // requests to load a package on the current tab
0063     Q_SCRIPTABLE void requestLoadComponent(const QString& qualifiedName);
0064 
0065   private:
0066     MainWindow& mainWindow;
0067 };
0068 
0069 #endif