add documentation to netctlprofile

This commit is contained in:
arcan1s
2014-07-15 13:32:22 +04:00
parent 05f9759d47
commit bc8655aaeb
3 changed files with 98 additions and 0 deletions

View File

@ -14,6 +14,14 @@
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file netctlprofile.h
* Header of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#ifndef NETCTLPROFILE_H
#define NETCTLPROFILE_H
@ -23,22 +31,67 @@
#include <QObject>
/**
* @brief The NetctlProfile class interacts with netctl profiles
*/
class NetctlProfile : public QObject
{
Q_OBJECT
public:
/**
* @brief NetctlProfile class constructor
* @param debugCmd show debug messages
* @param settings default settings. Needed keys are
* PROFILE_DIR (path to directory which contains profiles),
* SUDO_PATH (path to sudo command)
*/
explicit NetctlProfile(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
/**
* @brief Netctl class destructor
*/
~NetctlProfile();
/**
* @brief function which copies temporary profile to PROFILE_DIR
* @param oldPath path to temprorary profile
* @return false if components are not found or command exit code is not equal to 0
* @return true if the function was completed without errors
*/
bool copyProfile(const QString oldPath);
/**
* @brief function which creates temporary profile
* @param profile profile name
* @param settings profile configuration. All available keys will be printed to the profile
* @return temporary profile name
*/
QString createProfile(const QString profile, const QMap<QString, QString> settings);
/**
* @brief function which reads settings from profile
* @param profile profile name
* @return settings from profile
*/
QMap<QString, QString> getSettingsFromProfile(const QString profile);
/**
* @brief function which removes profile
* @param profile profile name
* @return false if components are not found or command exit code is not equal to 0
* @return true if the function was completed without errors
*/
bool removeProfile(const QString profile);
private:
/**
* @brief show debug messages
*/
bool debug;
/**
* @brief path to directory which contains profiles. Defaults is /etc/netctl
*/
QDir *profileDirectory;
/**
* @brief path to sudo command. Defaults is /usr/bin/kdesu
*/
QString sudoCommand;
};