Changeset 986 for trunk/src/gui
- Timestamp:
- Aug 16, 2011, 12:57:10 AM (14 years ago)
- Location:
- trunk/src/gui/kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qmime_pm.cpp
r776 r986 290 290 } 291 291 292 293 294 295 292 296 QPMMime::DefaultDragWorker::DefaultDragWorker(bool exclusive) 293 297 : d(new Data(this, exclusive)) … … 297 301 } 298 302 303 304 305 299 306 QPMMime::DefaultDragWorker::~DefaultDragWorker() 300 307 { … … 303 310 } 304 311 312 313 314 305 315 bool QPMMime::DefaultDragWorker::cleanup(bool isCancelled) 306 316 { … … 341 351 } 342 352 353 354 355 343 356 bool QPMMime::DefaultDragWorker::isExclusive() const 344 357 { … … 346 359 } 347 360 361 362 363 348 364 ULONG QPMMime::DefaultDragWorker::itemCount() const 349 365 { … … 351 367 } 352 368 369 370 371 353 372 ULONG QPMMime::DefaultDragWorker::hwnd() const 354 373 { … … 356 375 } 357 376 377 378 379 358 380 QByteArray QPMMime::DefaultDragWorker::composeFormatString() 359 381 { … … 392 414 } 393 415 416 417 418 394 419 bool QPMMime::DefaultDragWorker::prepare(const char *drm, const char *drf, 395 420 DRAGITEM *item, ULONG itemIndex) … … 434 459 } 435 460 461 462 463 436 464 void QPMMime::DefaultDragWorker::defaultFileType(QString &type, 437 465 QString &ext) … … 676 704 } 677 705 706 707 708 709 710 711 712 713 714 678 715 bool QPMMime::DefaultDragWorker::addProvider(const QByteArray &drf, Provider *provider, 679 716 ULONG itemCnt /* = 1 */) … … 701 738 } 702 739 740 741 742 743 703 744 // static 704 745 bool QPMMime::DefaultDragWorker::canRender(const char *drm) … … 748 789 }; 749 790 791 792 793 750 794 QPMMime::DefaultDropWorker::DefaultDropWorker() : d(new Data(this)) 751 795 { … … 755 799 } 756 800 801 802 803 757 804 QPMMime::DefaultDropWorker::~DefaultDropWorker() 758 805 { … … 760 807 } 761 808 809 810 811 762 812 void QPMMime::DefaultDropWorker::cleanup(bool isAccepted) 763 813 { … … 776 826 } 777 827 828 829 830 778 831 bool QPMMime::DefaultDropWorker::isExclusive() const 779 832 { … … 781 834 } 782 835 836 837 838 783 839 bool QPMMime::DefaultDropWorker::hasFormat(const QString &mimeType) const 784 840 { … … 786 842 } 787 843 844 845 846 788 847 QStringList QPMMime::DefaultDropWorker::formats() const 789 848 { … … 824 883 } 825 884 885 886 887 826 888 QVariant QPMMime::DefaultDropWorker::retrieveData(const QString &mimeType, 827 889 QVariant::Type preferredType) const … … 1132 1194 } 1133 1195 1196 1197 1198 1199 1200 1201 1202 1203 1134 1204 bool QPMMime::DefaultDropWorker::addProvider(const QString &mimeType, 1135 1205 Provider *provider) … … 1145 1215 } 1146 1216 1217 1218 1219 1220 1221 1222 1223 1224 1147 1225 bool QPMMime::DefaultDropWorker::addExclusiveProvider(const QString &mimeType, 1148 1226 Provider *provider) … … 1158 1236 } 1159 1237 1238 1239 1240 1241 1160 1242 // static 1161 1243 bool QPMMime::DefaultDropWorker::canRender(DRAGITEM *item, const char *drf) … … 1488 1570 DRAGITEM structures in order to represent different mime data types). As 1489 1571 opposed to super exclusive workers (identified by isExclusive() returning 1490 TRUE and by itemCount() returning zero), exclusive and cooperative workers1572 ), exclusive and cooperative workers 1491 1573 do not create DRAGINFO/DRAGITEM structures on their own, they implement a 1492 1574 subset of methods that is used by the drag manager to fill drag structures … … 1504 1586 mime type. 1505 1587 1506 \note Subclasses must NOT free the DRAGINFO structure they allocated and1507 returned by createDragInfo().1508 1509 1588 \note Every exclusive drag worker must implement createDragInfo() and must 1510 not implement composeFormatSting()/canRender()/prepare()/defaultFileType(). 1511 And vice versa, every cooperative drag worker must implement the latter 1512 three functions but not the former two. 1513 1514 \note The return value of cleanup() is whether the Move operation is 1515 disallowed by this worker or not (if the worker doesn't participate in the 1516 DND session, it should return FALSE, to let other workers allow Move). 1589 not implement composeFormatSting()/prepare()/defaultFileType(). And vice 1590 versa, every cooperative drag worker must implement the latter three 1591 functions but not the former two. 1592 */ 1593 1594 /*! 1595 \fn QPMMime::DragWorker::DragWorker() 1596 1597 Constructs a new instance. 1598 */ 1599 1600 /*! 1601 \fn QPMMime::DragWorker::~DragWorker() 1602 1603 Destroys the instance. 1604 */ 1605 1606 /*! 1607 \fn QPMMime::DragWorker::source() const 1608 1609 Returns the source of the current drag operation. 1610 */ 1611 1612 /*! 1613 \fn QPMMime::DragWorker::init() 1614 1615 Initializes the instance before the drag operation. 1616 */ 1617 1618 /*! 1619 \fn QPMMime::DragWorker::cleanup(bool isCancelled) 1620 1621 Performs cleanup after the drag operation. If the drag operation was 1622 cancelled, \a isCancelled will be \c true. 1623 1624 Returns \c true if the Move operation is disallowed by this worker. Note 1625 that if this worker doesn't participate in a given DnD session, it should 1626 return \c false to let other workers allow Move. 1627 1628 Must be reimplemented in subclasses. 1629 */ 1630 1631 /*! 1632 \fn QPMMime::DragWorker::isExclusive() const 1633 1634 Returns \c true if this is an exclusive drag worker. 1635 1636 Must be reimplemented in subclasses. 1637 */ 1638 1639 /*! 1640 \fn QPMMime::DragWorker::itemCount() const 1641 1642 Returns the number of DRAGITEM elements this drag worker needs to represent 1643 its data. If isExclusive() is \c true and this method returns 0, this drag 1644 worker will manage creation of the DRAGINFO structure on its onwn. 1645 1646 Must be reimplemented in subclasses. 1647 */ 1648 1649 /*! 1650 \fn QPMMime::DragWorker::hwnd() const 1651 1652 Returns a window handle to be associated with DRAGITEM elemetns of this drag 1653 worker. 1654 1655 Must be reimplemented in subclasses. 1656 */ 1657 1658 /*! 1659 \fn QPMMime::DragWorker::createDragInfo(const QString &targetName, USHORT 1660 supportedOps) 1661 1662 Creates a new DRAGINFO structure for the drag operation with the suggested 1663 \a targetName and supported operations represented by \a supportedOps. 1664 1665 \note The created structure is owned by QPMMime and should be not freed by 1666 subclasses. 1667 1668 Must be reimplemented in subclasses if the isExclusive() implementation 1669 returns \c true and itemCount() returns 0. 1670 */ 1671 1672 /*! 1673 \fn QPMMime::DragWorker::composeFormatString() 1674 1675 Returns a format string containing "<mechanism,format>" pairs supported by 1676 this drag worker. 1677 1678 Must be reimplemented in subclasses if the isExclusive() implementation 1679 returns \c false. 1680 */ 1681 1682 /*! 1683 \fn QPMMime::DragWorker::prepare(const char *drm, const char *drf, 1684 DRAGITEM *item, ULONG itemIndex) 1685 1686 Prepares this worker for the drop operation of the \a item having 1687 \a itemIndex using the mechanism and format specified in \a drm and \a drf, 1688 respectively. 1689 1690 Must be reimplemented in subclasses if the isExclusive() implementation 1691 returns \c false. 1692 */ 1693 1694 /*! 1695 \fn QPMMime::DragWorker::defaultFileType(QString &type, QString &ext) 1696 1697 Returns the default file \a type (and extension \a ext) for the data 1698 represented by this worker. 1699 1700 Must be reimplemented in subclasses if the isExclusive() implementation 1701 returns \c false. 1517 1702 */ 1518 1703 … … 1528 1713 1529 1714 /*! 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1530 1748 \class QPMMime::DropWorker 1531 1749 … … 1539 1757 processing the drop event, all other workers are silently ignored. 1540 1758 1541 \note Subclasses must NOT free the DRAGINFO structure pointed to by info(). 1542 1543 \note Subclasses must NOT send DM_ENDCONVERSATION to the source. 1759 \note Subclasses must \b not send \c DM_ENDCONVERSATION to the source. 1760 */ 1761 1762 /*! 1763 \fn QPMMime::DropWorker::DropWorker() 1764 1765 Constructs a new instance. 1766 */ 1767 1768 /*! 1769 \fn QPMMime::DropWorker::~DropWorker() 1770 1771 Destroys the instance. 1772 */ 1773 1774 /*! 1775 \fn QPMMime::DropWorker::info() const 1776 1777 Returns a pointer to the DRAGINFO sctructure describing the current 1778 drag operation. 1779 1780 \note Subclasses must \b not free this DRAGINFO structure. 1781 */ 1782 1783 /*! 1784 \fn QPMMime::DropWorker::init() 1785 1786 Initializes the instance before the drop operation. 1787 */ 1788 1789 /*! 1790 \fn QPMMime::DropWorker::cleanup(bool isAccepted) 1791 1792 Performs the cleanup after the drop operation. If the drag was accepted, 1793 \a isAccepted will be \c true. 1794 */ 1795 1796 /*! 1797 \fn QPMMime::DropWorker::isExclusive() const 1798 1799 Returns \c true if this is an exclusive drop worker. 1800 1801 Must be reimplemented in subclasses. 1802 */ 1803 1804 /*! 1805 \fn QPMMime::DropWorker::hasFormat(const QString &mimeType) const 1806 1807 Returns \c true if this drop worker supports the given \a mimeType. 1808 1809 Must be reimplemented in subclasses. 1810 */ 1811 1812 /*! 1813 \fn QPMMime::DropWorker::formats() const 1814 1815 Returns a list of all MIME types supported by this drop worker. 1816 1817 Must be reimplemented in subclasses. 1818 */ 1819 1820 /*! 1821 \fn QPMMime::DropWorker::retrieveData(const QString &mimeType, 1822 QVariant::Type preferredType) const 1823 1824 Returns data represented by this drag worker converted to the given 1825 \a mimeType. The QVariant type preferred by the caller is indicated by 1826 \a preferredType. 1827 1828 Must be reimplemented in subclasses. 1544 1829 */ 1545 1830 … … 1552 1837 formats to particular mime types and apply postprocessing of data after 1553 1838 rendering. 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1554 1865 */ 1555 1866 … … 1701 2012 mechanism and can be rendered by a target w/o involving the source (i.e., 1702 2013 \c DRM_OS2FILE is the first supported format and a valid file name with full 1703 path is provided). If the function returns \c TRUE, \a fullName (if not2014 path is provided). If the function returns \c , \a fullName (if not 1704 2015 \c NULL) will be assigned the item's full source file name (composed from 1705 2016 \c hstrContainerName and \c hstrSourceName fields). -
trunk/src/gui/kernel/qwidget_pm.cpp
r938 r986 239 239 with the given region using the \a op operation (CRGN_*); otherwise they are 240 240 directly validated on the window. The scope of relativeness is defined by 241 the \ flargument which is one or more PWO_* flags OR-ed together.241 the \ argument which is one or more PWO_* flags OR-ed together. 242 242 243 243 Returns the complexity of the combined region (only when \a hrgn is not
Note:
See TracChangeset
for help on using the changeset viewer.