/***************************************************************************
                          SIMPLY POWERFUL TOOLKIT (SPTK)
                          cevent.h  -  description
                             -------------------
    begin                : Thu Apr 27 2000
    copyright            : (C) 2000-2005 by Alexey S.Parshin
    email                : alexeyp@gmail.com
 ***************************************************************************/

/***************************************************************************
   This library is free software; you can redistribute it and/or modify it 
   under the terms of the GNU Library General Public License as published by
   the Free Software Foundation; either version 2 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 Library
   General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; if not, write to the Free Software Foundation, 
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

   Please report all bugs and problems to "alexeyp@gmail.com"
 ***************************************************************************/

#ifndef __CEVENT_H__
#define __CEVENT_H__

/// @addtogroup gui GUI Classes
/// @{

/// Event type constants
enum CEvent {
   CE_NONE,             ///< Empty event (no event)
   CE_DATA_CHANGED,     ///< Control data changed
   CE_FOCUS,            ///< Control received focus
   CE_UNFOCUS,          ///< Control lost focus
   CE_SHOW,             ///< Control visibility changed to show
   CE_HIDE,             ///< Control visibility changed to hide
   CE_KEYBOARD,         ///< Keyboard event in control
   CE_MOUSE_CLICK,      ///< Mouse clicked on control
   CE_MOUSE_DOUBLE_CLICK, ///< Mouse double-clicked on control
   CE_MOUSE_DRAG,       ///< Mouse dragged on control 
   CE_MOUSE_MOVE,       ///< Mouse moved over control 
   CE_MOUSE_RELEASE,    ///< Mouse released over control 
   CE_MOUSE_WHEEL,      ///< Mouse wheel over control 
   CE_PROGRESS,         ///< Progress event (if control supports it)
   CE_BUTTON_PRESSED,   ///< Keyboard button pressed
   UC_ADD_ITEM,         ///< List event - item added (if control supports it)
   UC_EDIT_ITEM,        ///< List event - item edited or changed (if control supports it)
   UC_DELETE_ITEM,      ///< List event - item deleted (if control supports it)
   UC_REFRESH,          ///< List event - list refreshed (if control supports it)
   CE_LAST_EVENT        ///< Last event number (no event)
};

/// Event type information
class CEventInfo {

   CEvent        m_event;     ///< Event type
   long          m_argument;  ///< Event argument
public:
   /// Constructor
   /// @param eventType CEvent, event type
   /// @param eventArg CEvent, event argument
   CEventInfo(CEvent eventType=CE_NONE,long eventArg=0) { m_event = eventType; m_argument = eventArg; }
   /// Reports event type
   CEvent  type() const { return m_event; }
   /// Reports event argument
   long    argument() const { return m_argument; }
};

/// @}

#endif
