Source Code (Use browser search to find items of interest.)

Class Index

kdelibs'KListAction (./kdelibs/kdeui/kaction.h:827)

class KListAction : public KSelectAction
{
    Q_OBJECT
public:
    /**
     * Construct a list action with text and potential keyboard
     * accelerator but nothing else. Use this only if you really
     * know what you are doing.
     *
     * @param text The text that will be displayed.
     * @param accel The corresponding keyboard accelerator (shortcut).
     * @param parent This action's parent.
     * @param name An internal name for this action.
     */
    KListAction( const QString& text, int accel = 0, QObject* parent = 0,
                  const char* name = 0 );

    /**
     *  @param text The text that will be displayed.
     *  @param accel The corresponding keyboard accelerator (shortcut).
     *  @param receiver The SLOT's parent.
     *  @param slot The SLOT to invoke to execute this action.
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( const QString& text, int accel, const QObject* receiver,
                  const char* slot, QObject* parent, const char* name = 0 );

    /**
     *  @param text The text that will be displayed.
     *  @param pix The icons that go with this action.
     *  @param accel The corresponding keyboard accelerator (shortcut).
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( const QString& text, const QIconSet& pix, int accel = 0,
	              QObject* parent = 0, const char* name = 0 );

    /**
     *  @param text The text that will be displayed.
     *  @param pix The dynamically loaded icon that goes with this action.
     *  @param accel The corresponding keyboard accelerator (shortcut).
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( const QString& text, const QString& pix, int accel = 0,
	              QObject* parent = 0, const char* name = 0 );

    /**
     *  @param text The text that will be displayed.
     *  @param pix The icons that go with this action.
     *  @param accel The corresponding keyboard accelerator (shortcut).
     *  @param receiver The SLOT's parent.
     *  @param slot The SLOT to invoke to execute this action.
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( const QString& text, const QIconSet& pix, int accel,
		          const QObject* receiver, const char* slot, QObject* parent,
                  const char* name = 0 );

    /**
     *  @param text The text that will be displayed.
     *  @param pix The dynamically loaded icon that goes with this action.
     *  @param accel The corresponding keyboard accelerator (shortcut).
     *  @param receiver The SLOT's parent.
     *  @param slot The SLOT to invoke to execute this action.
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( const QString& text, const QString& pix, int accel,
                 const QObject* receiver, const char* slot, QObject* parent,
                 const char* name = 0 );

    /**
     *  @param parent This action's parent.
     *  @param name An internal name for this action.
     */
    KListAction( QObject* parent = 0, const char* name = 0 );

    /**
     * Destructor
     */
    virtual ~KListAction();

    /**
     *  Sets the currently checked item.
     *
     *  @param index Index of the item (remember the first item is zero).
     */
    virtual void setCurrentItem( int index );

    virtual QString currentText() const;
    virtual int currentItem() const;

private:
    class KListActionPrivate;
    KListActionPrivate *d;
};

/**
 *  This class is an action to handle a recent files submenu.
 *
 *  @author Michael Koch
 *  @short Recent files action
 */

kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1336)

KListAction::KListAction( const QString& text, int accel, QObject* parent,
                          const char* name )
  : KSelectAction( text, accel, parent, name )
{
  d = new KListActionPrivate;
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1343)

KListAction::KListAction( const QString& text, int accel,
                          const QObject* receiver, const char* slot,
                          QObject* parent, const char* name )
  : KSelectAction( text, accel, parent, name )
{
  d = new KListActionPrivate;
  connect( this, SIGNAL(activated(int)), receiver, slot );
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1352)

KListAction::KListAction( const QString& text, const QIconSet& pix,
                          int accel, QObject* parent, const char* name )
  : KSelectAction( text, pix, accel, parent, name )
{
  d = new KListActionPrivate;
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1359)

KListAction::KListAction( const QString& text, const QString& pix,
                            int accel, QObject* parent, const char* name )
  : KSelectAction( text, pix, accel, parent, name )
{
  d = new KListActionPrivate;
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1366)

KListAction::KListAction( const QString& text, const QIconSet& pix,
                          int accel, const QObject* receiver,
                          const char* slot, QObject* parent,
                          const char* name )
  : KSelectAction( text, pix, accel, receiver, slot, parent, name )
{
  d = new KListActionPrivate;
  connect( this, SIGNAL(activated(int)), receiver, slot );
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1376)

KListAction::KListAction( const QString& text, const QString& pix,
                          int accel, const QObject* receiver,
                          const char* slot, QObject* parent,
                          const char* name )
  : KSelectAction( text, pix, accel, receiver, slot, parent, name )
{
  d = new KListActionPrivate;
  connect( this, SIGNAL(activated(int)), receiver, slot );
}


kdelibs'KListAction::KListAction() (./kdelibs/kdeui/kaction.cpp:1386)

KListAction::KListAction( QObject* parent, const char* name )
  : KSelectAction( parent, name )
{
  d = new KListActionPrivate;
}


kdelibs'KListAction::~KListAction() (./kdelibs/kdeui/kaction.cpp:1392)

KListAction::~KListAction()
{
  delete d; d = 0;
}


kdelibs'KListAction::setCurrentItem() (./kdelibs/kdeui/kaction.cpp:1397)

void KListAction::setCurrentItem( int index )
{
  d->m_current = index;

  //  emit KAction::activated();
  //  emit activated( currentItem() );
  // emit activated( currentText() );
}


kdelibs'KListAction::currentText() (./kdelibs/kdeui/kaction.cpp:1406)

QString KListAction::currentText() const
{
  if ( currentItem() < 0 )
      return QString::null;

  return items()[ currentItem() ];
}


kdelibs'KListAction::currentItem() (./kdelibs/kdeui/kaction.cpp:1414)

int KListAction::currentItem() const
{
  return d->m_current;
}

class KRecentFilesAction::KRecentFilesActionPrivate
{
public:
  KRecentFilesActionPrivate()
  {
    m_maxItems = 0;
  }
  uint m_maxItems;
};