Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions include/uibase/iexecutable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Mod Organizer shared UI functionality

Copyright (C) 2012 Sebastian Herbord. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef IEXECUTABLE_H
#define IEXECUTABLE_H

#include <QFileInfo>
#include <QString>

namespace MOBase
{
class IExecutable
{
public: // Information found in ExecutableInfo
/**
* @return the title of the executable.
*/
virtual const QString& title() const = 0;

/**
* @return the file info of the executable binary.
*/
virtual const QFileInfo& binaryInfo() const = 0;

/**
* @return the arguments to be passed to the executable.
*
* @note This API might be changed in the future to return a QStringList instead.
*/
virtual const QString& arguments() const = 0;

/**
* @return the Steam App ID associated with this executable, or an empty string if
* there is none.
*/
virtual const QString& steamAppID() const = 0;

/**
* @return the working directory for the executable.
*/
virtual const QString& workingDirectory() const = 0;

public: // Information found in flags
/**
* @return true if the executable is shown on the toolbar.
*/
virtual bool isShownOnToolbar() const = 0;

/**
* @return true if the executable's application icon is used for desktop shortcuts.
*/
virtual bool usesOwnIcon() const = 0;

/**
* @return true if Mod Organizer should minimize to the system tray while this
* executable is running.
*/
virtual bool minimizeToSystemTray() const = 0;

/**
* @return true if this executable is hidden in the user interface.
*/
virtual bool hide() const = 0;
};
} // namespace MOBase

#endif // IEXECUTABLE_H
75 changes: 75 additions & 0 deletions include/uibase/iexecutableslist.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
Mod Organizer shared UI functionality

Copyright (C) 2012 Sebastian Herbord. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef IEXECUTABLESLIST_H
#define IEXECUTABLESLIST_H

#include <QFileInfo>
#include <QString>

#include <generator>

#include "iexecutable.h"

namespace MOBase
{
/**
* @brief Interface to the list of executables configured in Mod Organizer.
*/
class IExecutablesList
{
public:
/**
* @brief Retrieve all configured executables.
*
* @return a generator yielding all configured executables.
*/
virtual std::generator<const IExecutable&> executables() const = 0;

/**
* @brief Retrieve an executable by its title.
*
* @param title Title of the executable to retrieve.
*
* @return the executable with the specified title, or nullptr if not found.
*/
virtual const IExecutable* getByTitle(const QString& title) const = 0;

/**
* @brief Retrieve an executable by its binary file info.
*
* @param info File info of the executable binary to retrieve.
*
* @return the executable with the specified binary, or nullptr if not found.
*/
virtual const IExecutable* getByBinary(const QFileInfo& info) const = 0;

/**
* @brief Check if an executable with the specified title exists.
*
* @param title Title of the executable to check.
*
* @return true if an executable with the specified title exists, false otherwise.
*/
virtual bool contains(const QString& title) const = 0;
};
} // namespace MOBase

#endif // IEXECUTABLESLIST_H
6 changes: 6 additions & 0 deletions include/uibase/imoinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
namespace MOBase
{

class IExecutablesList;
class IFileTree;
class IModInterface;
class IModRepositoryBridge;
Expand Down Expand Up @@ -330,6 +331,11 @@ class QDLLEXPORT IOrganizer : public QObject
*/
virtual IModList* modList() const = 0;

/**
* @return interface to the list of executables
*/
virtual IExecutablesList* executablesList() const = 0;

/**
* @return interface to the active profile
*/
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ set(root_headers
../include/uibase/versioninfo.h
)
set(interface_headers
../include/uibase/iexecutable.h
../include/uibase/iexecutableslist.h
../include/uibase/ifiletree.h
../include/uibase/ifiletree_utils.h
../include/uibase/iinstallationmanager.h
Expand Down