Logo Search packages:      
Sourcecode: kmess version File versions  Download package

kmessapplication.h

/***************************************************************************
                          kmessapplication.h -  description
                             -------------------
    begin                : Wed 7 13 2005
    copyright            : (C) 2005 by Diederik van der Boor
    email                : vdboor --at-- codingdomain.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KMESSAPPLICATION_H
#define KMESSAPPLICATION_H

#include <kapplication.h>
#include <kdeversion.h>

class KMess;

/**
 * @brief KApplication subclass to handle quit requests.
 *
 * This class stores the data to close or quit KMess correctly.
 * When quitSelected() is false, the main window should only close.
 * When it's true, or sessionSaving() returns true, the application is exiting.
 * For compatibility with KDE 3.1.0, the sessionSaving() is implemented in an <code>\#if</code> block,
 * so users can still compile KMess at their old systems.
 * 
 * @author Mike K. Bennett (original work), Diederik van der Boor (new class)
 * @ingroup Root
 */
00038 class KMessApplication : public KApplication
{
  public:
    // Constructor
                KMessApplication();

    // Destructor
    virtual    ~KMessApplication();

#if KDE_IS_VERSION(3,1,1)
    // KDE has a sessionSaving() method
#else
    // QApplication wants to save the session
    virtual void commitData(QSessionManager &sm);
    // Return true if we're saving the session (for queryExit())
    bool         sessionSaving() const;
#endif

    // Return true if quit was selected
    bool         quitSelected() const;
    // Tell the application that quit was selected
    void         setQuitSelected(bool quitSelected);

  private:
    // True when entering the commitData() method
    bool         savingSession_;
    // True when quit was selected
    bool         quitSelected_;
};

#endif

Generated by  Doxygen 1.6.0   Back to index