Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.8 KiB

  1. # The documentation is at the __END__
  2. package Win32::OLE::Enum;
  3. 1;
  4. # everything is pure XS in Win32::OLE::Enum
  5. # - new
  6. # - DESTROY
  7. #
  8. # - All
  9. # - Clone
  10. # - Next
  11. # - Reset
  12. # - Skip
  13. __END__
  14. =head1 NAME
  15. Win32::OLE::Enum - OLE Automation Collection Objects
  16. =head1 SYNOPSIS
  17. my $Sheets = $Excel->Workbooks(1)->Worksheets;
  18. my $Enum = Win32::OLE::Enum->new($Sheets);
  19. my @Sheets = $Enum->All;
  20. while (defined(my $Sheet = $Enum->Next)) { ... }
  21. =head1 DESCRIPTION
  22. This module provides an interface to OLE collection objects from
  23. Perl. It defines an enumerator object closely mirroring the
  24. functionality of the IEnumVARIANT interface.
  25. Please note that the Reset() method is not available in all implementations
  26. of OLE collections (like Excel 7). In that case the Enum object is good
  27. only for a single walk through of the collection.
  28. =head2 Functions/Methods
  29. =over 8
  30. =item Win32::OLE::Enum->new($object)
  31. Creates an enumerator for $object, which must be a valid OLE collection
  32. object. Note that correctly implemented collection objects must support
  33. the C<Count> and C<Item> methods, so creating an enumerator is not always
  34. necessary.
  35. =item $Enum->All()
  36. Returns a list of all objects in the collection. You have to call
  37. $Enum->Reset() before the enumerator can be used again. The previous
  38. position in the collection is lost.
  39. This method can also be called as a class method:
  40. my @list = Win32::OLE::Enum->All($Collection);
  41. =item $Enum->Clone()
  42. Returns a clone of the enumerator maintaining the current position within
  43. the collection (if possible). Note that the C<Clone> method is often not
  44. implemented. Use $Enum->Clone() in an eval block to avoid dying if you
  45. are not sure that Clone is supported.
  46. =item $Enum->Next( [$count] )
  47. Returns the next element of the collection. In a list context the optional
  48. $count argument specifies the number of objects to be returned. In a scalar
  49. context only the last of at most $count retrieved objects is returned. The
  50. default for $count is 1.
  51. =item $Enum->Reset()
  52. Resets the enumeration sequence to the beginning. There is no guarantee that
  53. the exact same set of objects will be enumerated again (e.g. when enumerating
  54. files in a directory). The methods return value indicates the success of the
  55. operation. (Note that the Reset() method seems to be unimplemented in some
  56. applications like Excel 7. Use it in an eval block to avoid dying.)
  57. =item $Enum->Skip( [$count] )
  58. Skip the next $count elements of the enumeration. The default for $count is 1.
  59. The functions returns TRUE if at least $count elements could be skipped. It
  60. returns FALSE if not enough elements were left.
  61. =back
  62. =head1 AUTHORS/COPYRIGHT
  63. This module is part of the Win32::OLE distribution.
  64. =cut