/*
 *
 * Copyright (C) 2002 Stefan Hellwig <stefan@stefanhellwig.de>
 *
 *   This program is free software; you can redistribute it and/or modify 
 *   it under the terms of the GNU General Public License as published by 
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 */

#ifndef _SAVERCONTROL_H
#define _SAVERCONTROL_H

/**
 * KDE ScreenSaver Control class
 *
 * This class can be used by either creating a new object and
 * using the regular ("dynamic") methods to get the status of
 * the KDE screensaver or to enable/disable it.
 *
 * You can also call the static methods of this class directly
 * from within another class to control the KDE screensaver or
 * to get its current status.
 *
 */
class SaverControl
{

public:
    /* ------------------- DYNAMIC METHODS --------------------- */

    SaverControl();
    ~SaverControl();

    /**
     * Get the current status of the KDE screensaver using DBUS.
     */
    static bool getScreenSaverStatus();

    /**
     * set screensaver status using DBUS.
     */
    void setScreenSaver(bool disable);

    /* ------------------- STATIC METHODS --------------------- */

    /**
     * Static accessor method to disable the screensaver. Returns
     * true if the operation was successful, false if it was not.
     */
    static bool disableScreenSaver();

    /**
     * Static accessor method to enable the screensaver. Returns
     * true if the operation was successful, false if it was not.
     */
    static bool enableScreenSaver();
private:
    bool startup_saver_status;
};

#endif

