Source: iconsizemenu.h


Annotated List
Files
Globals
Hierarchy
Index
/*
******************************************************************************
*  File Name  :  iconsizemenu.h  -  application header file
*  Created on :  Thursday, June 27, 2002
*  Product id :  KitClasses  version 1.0  -  KInterDev Add-on Classes for KDE
*   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*  Copyright :  © 2002 by Bruce Hunt    Supporting Cast
*  Email     :  SuppCast@users.sourceforge.net
*  Web site  :  http://kinterdev.sourceforge.net
******************************************************************************
*  This program is being provided under the LICENSING terms and conditions as
*  specified in the file "COPYING" which has been included with this software
*  package. This program is distributed WITHOUT ANY WARRANTY, without even the
*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
******************************************************************************
*   D e v e l o p e r  N o t e s
*  Add the MenuSizes enums together to determine which menu entries to present
******************************************************************************
*    M o d i f i c a t i o n   L o g
*
*****************************************************************************/
#ifndef KIT_ICONSIZEMENU_H
#define KIT_ICONSIZEMENU_H

#include 

/**
 * KitIconSizeMenu creates a popup context menu to select icon sizes.
 * It is similar to the context menus used by KDE tool bars.
 *
 * @short A popup context menu for icon size selection.
 * @author Bruce Hunt 
 */
class KitIconSizeMenu : public KPopupMenu
{
   Q_OBJECT

public:
   /**
    * Icon sizes
    * @li @p Default - use the default size setting. Can be used to  retrieve the global setting.
    */
   enum IconSize{ Default = 0, Tiny = 16, Small = 22, Medium = 32, Large = 48, Huge = 64 };
   /**
    * The menu entries to include in the popup. Combine entries and pass to the constructor.
    */
   enum MenuEntries{ EntDefault = 1, EntTiny = 2, EntSmall = 4, EntMedium = 8, EntLarge = 16, EntHuge = 32, EntAll = 63 };
   /**
    * Default constructor
    */
   KitIconSizeMenu( QWidget *parent = 0, int sizes = KitIconSizeMenu::EntAll, const char *name = 0 );
   /**
    * Constructor with a popup menu title
    */
   KitIconSizeMenu( const QString & title, QWidget *parent = 0, int sizes = KitIconSizeMenu::EntAll, const char *name = 0 );
   /**
    * Destructor
    */
   ~KitIconSizeMenu();
   /**
    * @return the current selected icon size
    */
   int iconSize();

public slots:
   /**
    * Set the icon size.
    */
   void setIconSize( int size );

signals:
   /**
    * Emitted when a menu selection is made.
    */
   void iconSizeSelected( int size );

protected:
   /**
    * Empty method for sub-classed processing.
    * Processed just before iconSizeSelected is emitted.
    */
   void processSelected( int size );

private:
   int iIconSize;

   void createMenu( int );

private slots:
   void pumDefaultSize();
   void pumTinySize();
   void pumSmallSize();
   void pumMediumSize();
   void pumLargeSize();
   void pumHugeSize();

};

#endif

Generated by: bhunt on Lurch on Sun Nov 24 02:45:27 2002, using kdoc 2.0a54.