### IDMMenuItem

  The IDMMenuItem class represents menu-specific items in a direct manipulation. Menus create objects of the IDMMenuItem class when a direct manipulation begins in a source menu.

  This class provides virtual functions that implement direct manipulation support for menus. You can derive item classes to support the direct manipulation of menu drag items if the default Open Class Library support does not meet your requirements.
  Note: This class does not support menus as the target of a direct manipulation.

### IDMMenuItem - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~IDMMenuItem

      public:
      virtual ~IDMMenuItem()

  Dismisses the menu if it has not been dismissed, because one of the following occurs:

  - The direct manipulation is cancelled.
  - Help is requested.
  - The drop is not allowed.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

IDMMenuItem

  Overload 1

      public:
      IDMMenuItem(const IDMItem::Handle& dragItem)

  dragItem
    A reference to a handle of a generic drag item that is created by the Open Class Library.

  This constructor is not used. Its definition is necessary to satisfy the requirements of the IDMItemProviderFor template class.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

  Overload 2

      public:
      IDMMenuItem(IDMSourceOperation* sourceOperation)

  sourceOperation
    A pointer to the drag source operation object to which this menu drag item object is to be added.

  Use this constructor to construct IDMMenuItem objects for the source of a direct manipulation. It is called by the member function, IDMMenuItem::generateSourceItems.

  This constructor determines which menu item is directly under the pointing device when the direct manipulation begins and selects the menu item as a visual cue. It also disables the dismissing of the menu until the direct manipulation is complete.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

### Menu Cleanup

Use these members to handle cleanup of the menu after the direct manipulation has completed.

sourceEnd

      public:
      virtual bool sourceEnd(IDMSourceEndEvent& event)

  Processes a source end event for the menu drag item. This function dismisses the menu that is the source of the direct manipulation.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

### Menu Item Operations

Use these members to set the supported direct manipulation operations for this class.

supportedOperationsFor

      public:
      virtual unsigned long
        supportedOperationsFor( const IString& selectedRMFs ) const

  Returns IDMItem::linkable as the only operation the menu drag item supports.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

### Source Items

Use these members to access and manipulate source items involved in a direct manipulation.

generateSourceItems

      public:
      static bool
        generateSourceItems( IDMSourceOperation* sourceOperation )

  Generates a menu drag item that represents a menu item object. The menu item object is selected in the source menu.

  This function is called by the menu's implementation of IDMItemProvider::provideSourceItems in the template class IDMItemProviderFor.

  The default implementation of this function in this class creates IDMMenuItem objects and adds them to the source operation. If you use the IDMItemProviderFor template class and you have defined a derived item class, you must implement IDMMenuItem::generateSourceItems in your derived menu drag item class. In your implementation, create an object of your derived menu item class and call IDMOperation::addItem to add the objects to the source operation.

  The default drag operation for menu drag items is IDMItem::linkable.
  Note: Use the sourceOperation parameter to access IDMOperation::addItem.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

### IDMMenuItem - Inherited Member Functions and Data

#### Inherited Public Functions

  IDMItem

  -     virtual ~IDMItem()

  -     virtual IDMItem& addRMF(const IString& rmf)

  -     virtual IDMItem&
          addRMF( const IString& rm,
                  const IString& rf )

  -     virtual IDMItem& addType(const char* aType)

  -     static void appendRMF(IString& rmfs, const IString& rmf)

  -     virtual unsigned long attributes() const

  -     virtual bool canBeCopied() const

  -     virtual bool canBeLinked() const

  -     virtual bool canBeMoved() const

  -     static IString compressedRMFs(const IString& rmfs)

  -     virtual IString containerName() const

  -     virtual IString contents() const

  -     virtual unsigned long contentsSize() const

  -     static void deleteRMF(IString& rmfs, const IString& rmf)

  -     DropIndicator dropStatus() const

  -     virtual IDMItem& enableCopy(bool copyable = true)

  -     virtual IDMItem& enableLink(bool linkable = true)

  -     virtual IDMItem& enableMove(bool moveable = true)

  -     bool hasImage() const

  -     virtual bool hasType(const char* aType) const

  -     IDMItem(const IDMItem& dragItem)

  -     IDMItem( IDMSourceOperation* sourceOperation,
                 const IString& types,
                 const unsigned long supportedOperations = unknown,
                 const unsigned long attributes = none )

  -     IDMItem(const Handle& item)

  -     IDMItem( IDMTargetOperation* targetOperation,
                 _DRAGITEM* dragItem )

  -     virtual IDMImage& image()

  -     virtual ISize imageOffset() const

  -     virtual bool isContainer() const

  -     virtual bool isGroup() const

  -     virtual bool isOnRemovableMedia() const

  -     virtual bool isOpen() const

  -     virtual bool isReference() const

  -     bool isTargetTheSource() const

  -     static IString
          matchingRMFs( const IString& rmfs1,
                        const IString& rmfs2,
                        bool firstOnly = false )

  -     virtual IString nativeRF() const

  -     virtual IString nativeRM() const

  -     virtual IString nativeRMF() const

  -     virtual void* object() const

  -     IDMItem& operator =(const IDMItem& item)

  -     Handle operator =(const Handle& item)

  -     virtual IDMItem&
          removeRMF( const IString& rm,
                     const IString& rf )

  -     virtual IDMItem& removeRMF(const IString& rmf)

  -     virtual IDMItem& removeType(const char* aType)

  -     unsigned renderer() const

  -     virtual bool requiresPreparation() const

  -     static IString rfForThisProcess()

  -     static IString rfFrom(const IString& rmf)

  -     static IString
          rmfFrom( const IString& rm,
                   const IString& rf )

  -     static IString rmFrom(const IString& rmf)

  -     virtual IString rmfs() const

  -     static IString rmfsFrom(const IString& rmfs)

  -     static IString
          rmfsFrom( const IString& rm,
                    const IString& rf )

  -     IString selectedRMF() const

  -     virtual IDMItem& setContainer(bool container = true)

  -     IDMItem& setContainerName(const char* containerName)

  -     virtual bool setContents(const IString& data)

  -     IDMItem& setDropStatus(DropIndicator status)

  -     virtual IDMItem& setGroup(bool group = true)

  -     virtual IDMItem& setImage(IDMImage& image)

  -     virtual IDMItem& setNativeRMF(const IString& rmf)

  -     virtual IDMItem&
          setNativeRMF( const IString& rm,
                        const IString& rf )

  -     virtual IDMItem& setObject(void* pointerToObject)

  -     virtual IDMItem&
          setOnRemovableMedia( bool onRemovableMedia = true )

  -     virtual IDMItem& setOpen(bool open = true)

  -     virtual IDMItem& setReference(bool reference = true)

  -     IDMItem& setRenderer(unsigned position)

  -     virtual IDMItem&
          setRequiresPreparation( bool requiresPrep = true )

  -     virtual IDMItem& setRMFs(const IString& rmfs)

  -     IDMItem& setSelectedRMF(const IString& rmf)

  -     IDMItem& setSourceName(const char* sourceName)

  -     IDMItem& setSourceWindowHandle(IWindowHandle window)

  -     IDMItem& setTargetName(const char* targetName)

  -     virtual IDMItem& setTrueType(const char* aType)

  -     virtual IDMItem& setTypes(const char* types)

  -     virtual bool sourceDiscard(IDMSourceDiscardEvent& event)

  -     static Handle sourceItemFor(const Handle& targetItem)

  -     virtual IString sourceName() const

  -     virtual IDMSourceOperation* sourceOperation()

  -     virtual bool sourcePrepare(IDMSourcePrepareEvent& event)

  -     virtual bool sourcePrint(IDMSourcePrintEvent& event)

  -     virtual bool sourceRender(IDMSourceRenderEvent& event)

  -     virtual IWindow* sourceWindow() const

  -     virtual IWindowHandle sourceWindowHandle() const

  -     virtual unsigned long supportedOperations() const

  -     virtual bool
          supportsRMF( const IString& rm,
                       const IString& rf )

  -     virtual bool supportsRMF(const IString& rmf)

  -     virtual bool targetDrop(IDMTargetDropEvent& event)

  -     virtual bool targetEnd(IDMTargetEndEvent& event)

  -     virtual IString targetName() const

  -     virtual IDMTargetOperation* targetOperation()

  -     unsigned long tokenForWPSObject() const

  -     virtual IString trueType() const

  -     virtual IString types() const

  IMRefCounted

  -     void addRef()

  -     unsigned long count() const

  -     void removeRef()

#### Inherited Public Data

  IDMItem

  -     static const unsigned long container

  -     static const unsigned long copyable

  -     static const unsigned long group

  -     static const unsigned long linkable

  -     static const unsigned long moveable

  -     static const unsigned long none

  -     static const unsigned long open

  -     static const unsigned long prepare

  -     static const unsigned long reference

  -     static const unsigned long removableMedia

  -     static const unsigned long unknown

#### Inherited Protected Functions

  IMRefCounted

  -     virtual ~IMRefCounted()

  -     IMRefCounted()

  -     IMRefCounted(const IMRefCounted&)

  -     IMRefCounted& operator =(const IMRefCounted&)

  IDMItem

  -     IString generateSourceName()

#### Inherited Protected Data

  IDMItem

  -     IString strContents