home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / idmevent.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  13.6 KB  |  540 lines

  1. #ifndef _IDMEVENT_
  2. #define _IDMEVENT_
  3. /*******************************************************************************
  4. * FILE NAME: idmevent.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDMEvent                                                                 *
  9. *       IDMSourceBeginEvent                                                    *
  10. *       IDMSourceRenderEvent                                                   *
  11. *         IDMSourcePrepareEvent                                                *
  12. *       IDMSourceEndEvent                                                      *
  13. *       IDMSourceDiscardEvent                                                  *
  14. *       IDMSourcePrintEvent                                                    *
  15. *                                                                              *
  16. *       IDMTargetEvent                                                         *
  17. *         IDMTargetEnterEvent                                                  *
  18. *         IDMTargetLeaveEvent                                                  *
  19. *         IDMTargetDropEvent                                                   *
  20. *       IDMTargetHelpEvent                                                     *
  21. *       IDMTargetEndEvent                                                      *
  22. *                                                                              *
  23. * COPYRIGHT:                                                                   *
  24. *   IBM Open Class Library                                                     *
  25. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  26. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  27. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  28. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  29. *                                                                              *
  30. *******************************************************************************/
  31. #include <ievent.hpp>
  32. #include <idmitem.hpp>
  33. #include <idmsrcop.hpp>
  34. #include <idmcomm.hpp>
  35.  
  36. struct _DRAGTRANSFER;
  37. struct _PRINTDEST;
  38.  
  39.  
  40.  
  41. class IDragItem;
  42. typedef IDragItem _DRAGITEM;
  43.  
  44. class IPoint;
  45. class IString;
  46. class IWindowHandle;
  47. class IPresSpaceHandle;
  48. class IContainerObject;
  49. class IContainerControl;
  50. class IDMSourceOperation;
  51. class IDMEventData;
  52.  
  53. #pragma pack(4)
  54.  
  55. class IDMEvent : public IEvent {
  56. typedef IEvent
  57.   Inherited;
  58.  
  59. public:
  60.  
  61. /*------------------------------- Constructors -------------------------------*/
  62.   IDMEvent  ( const IEvent& event );
  63.  
  64. virtual
  65.   ~IDMEvent ( );
  66.  
  67. private:
  68. /*--------------------------------- Private ----------------------------------*/
  69.   IDMEventData
  70.    *fDMEventData;
  71. }; // IDMEvent
  72.  
  73.  
  74. class IDMSourceBeginEvent : public IDMEvent {
  75. typedef IDMEvent
  76.   Inherited;
  77. typedef IDM::Source
  78.   Source;
  79. public:
  80.  
  81. /*------------------------------- Constructors -------------------------------*/
  82.   IDMSourceBeginEvent  ( const IEvent& event );
  83.  
  84. virtual
  85.   ~IDMSourceBeginEvent ( );
  86.  
  87. /*---------------------------- Event Information -----------------------------*/
  88. virtual Source
  89.   source   ( ) const;
  90.  
  91. virtual IPoint
  92.   position ( ) const;
  93.  
  94. /*---------------------------- Container Support -----------------------------*/
  95. virtual unsigned long
  96.   containerId ( ) const;
  97.  
  98. virtual IContainerObject
  99.  *object      ( ) const;
  100.  
  101. virtual IContainerControl
  102.  *container   ( ) const;
  103.  
  104. virtual ISize
  105.   offset      ( ) const;
  106.  
  107. private:
  108. /*--------------------------------- Private ----------------------------------*/
  109.  
  110. Source
  111.   src;
  112. }; // IDMSourceBeginEvent
  113.  
  114.  
  115. class IDMSourceRenderEvent : public IDMEvent {
  116. typedef IDMEvent
  117.   Inherited;
  118. public:
  119.  
  120. /*------------------------------- Constructors -------------------------------*/
  121.   IDMSourceRenderEvent  ( const IEvent& event );
  122.  
  123. virtual
  124.   ~IDMSourceRenderEvent ( );
  125.  
  126.  
  127. /*-------------------------------- Rendering ---------------------------------*/
  128. virtual IDMItem::Handle
  129.   dragItem              ( ) const;
  130.  
  131. virtual IWindow
  132.  *alternateWindow       ( ) const,
  133.  *targetWindow          ( ) const;
  134.  
  135. virtual IWindowHandle
  136.   alternateWindowHandle ( ) const,
  137.   targetWindowHandle    ( ) const;
  138.  
  139. virtual IString
  140.   selectedMechanism     ( ) const,
  141.   selectedFormat        ( ) const,
  142.   targetName            ( ) const;
  143.  
  144. virtual unsigned long
  145.   targetInfo            ( ) const;
  146.  
  147. virtual Boolean
  148.   canRetry              ( ) const;
  149.  
  150. virtual IDMSourceRenderEvent
  151.  &setTargetInfo         ( unsigned long         info ),
  152.  &setRetry              ( Boolean               allowRetry = true ),
  153.  &setCompletion         ( IDM::RenderCompletion code );
  154.  
  155. virtual IDM::RenderCompletion
  156.   completion            ( ) const;
  157.  
  158. private:
  159. /*--------------------------------- Private ----------------------------------*/
  160.  
  161. friend class IDMSourcePrepareEvent;
  162. friend class IDMSourceRenderer;
  163.  
  164. IDMItem::Handle
  165.   pDMSrcItemHandle;
  166.  
  167. IString
  168.   strSelMechanism,
  169.   strSelFormat,
  170.   strTgtName;
  171.  
  172. Boolean
  173.   bRetry;
  174.  
  175. IDM::RenderCompletion
  176.   rcCompletion;
  177.  
  178.  
  179. IWindowHandle
  180.   tgtWindowHandle;
  181.  
  182. }; // IDMSourceRenderEvent
  183.  
  184. #ifndef IC_WIN_FLAGNOP
  185. class IDMSourcePrepareEvent : public IDMSourceRenderEvent {
  186. typedef IDMSourceRenderEvent
  187.   Inherited;
  188. public:
  189.  
  190. /*------------------------------- Constructors -------------------------------*/
  191.   IDMSourcePrepareEvent  ( const IEvent& event );
  192.  
  193. virtual
  194.   ~IDMSourcePrepareEvent ( );
  195.  
  196.  
  197. /*---------------------------- Alternate Window ------------------------------*/
  198. virtual IWindow
  199.  *alternateWindow          ( ) const;
  200.  
  201. virtual IWindowHandle
  202.   alternateWindowHandle    ( ) const;
  203.  
  204. IDMSourcePrepareEvent
  205.  &setAlternateWindowHandle ( const IWindowHandle& window );
  206.  
  207. /*-------------------------------- Rendering ---------------------------------*/
  208. Boolean
  209.   targetCanRetry       ( ) const,
  210.   noSourceRendering    ( ) const;
  211.  
  212. IDMSourcePrepareEvent
  213.  &setTargetCanRetry    ( Boolean flag ),
  214.  &setNoSourceRendering ( Boolean flag );
  215.  
  216. private:
  217. /*--------------------------------- Private ----------------------------------*/
  218.  
  219. Boolean
  220.   bTgtCanRetry,
  221.   bNoSrcRendering;
  222. }; // IDMSourcePrepareEvent
  223. #endif // IC_WIN_FLAGNOP
  224.  
  225.  
  226. class IDMSourceEndEvent : public IDMEvent {
  227. typedef IDMEvent
  228.   Inherited;
  229. public:
  230.  
  231. /*------------------------------- Constructors -------------------------------*/
  232.   IDMSourceEndEvent  ( const IEvent& event );
  233.  
  234. virtual
  235.   ~IDMSourceEndEvent ( );
  236.  
  237. /*-------------------------------- Rendering ---------------------------------*/
  238. virtual IDMItem::Handle
  239.   dragItem            ( ) const;
  240.  
  241. virtual Boolean
  242.   wasTargetSuccessful ( ) const;
  243.  
  244. private:
  245. /*--------------------------------- Private ----------------------------------*/
  246.  
  247. Boolean
  248.   bWasTgtSuccessful;
  249.  
  250. IDMItem::Handle
  251.   pDMSrcItemHandle;
  252. }; // IDMSourceEndEvent
  253.  
  254.  
  255. #ifndef IC_WIN_FLAGNOP
  256. class IDMSourceDiscardEvent : public IDMEvent {
  257. typedef IDMEvent
  258.   Inherited;
  259. typedef IDM::DiscardIndicator
  260.   DiscardIndicator;
  261. public:
  262.  
  263. /*------------------------------- Constructors -------------------------------*/
  264.   IDMSourceDiscardEvent  ( const IEvent& event );
  265.  
  266. virtual
  267.   ~IDMSourceDiscardEvent ( );
  268.  
  269. /*---------------------------- Event Information -----------------------------*/
  270. IDMSourceOperation::Handle
  271.   sourceOperation    ( ) const;
  272.  
  273. virtual DiscardIndicator
  274.   whoDiscards        ( ) const;
  275.  
  276. IDMSourceDiscardEvent
  277.  &setSourceOperation ( const IDMSourceOperation::Handle& operation ),
  278.  &setWhoDiscards     ( DiscardIndicator                  indicator );
  279.  
  280. private:
  281. /*--------------------------------- Private ----------------------------------*/
  282.  
  283. IDMSourceOperation::Handle
  284.   pSrcOpH;
  285.  
  286. DiscardIndicator
  287.   discardInd;
  288. }; // IDMSourceDiscardEvent
  289. #endif // IC_WIN_FLAGNOP
  290.  
  291.  
  292. #ifndef IC_WIN_FLAGNOP
  293. class IDMSourcePrintEvent : public IDMEvent {
  294. typedef IDMEvent
  295.   Inherited;
  296. typedef IDM::PrintIndicator
  297.   PrintIndicator;
  298. public:
  299.  
  300. /*------------------------------- Constructors -------------------------------*/
  301.   IDMSourcePrintEvent  ( const IEvent& event );
  302.  
  303. virtual
  304.   ~IDMSourcePrintEvent ( );
  305.  
  306. /*------------------------------ Print Support -------------------------------*/
  307. IDMSourceOperation::Handle
  308.   sourceOperation    ( ) const;
  309.  
  310. virtual PrintIndicator
  311.   whoPrints          ( ) const;
  312.  
  313. IDMSourcePrintEvent
  314.  &setSourceOperation ( const IDMSourceOperation::Handle& operation ),
  315.  &setWhoPrints       ( PrintIndicator                    indicator );
  316.  
  317.  
  318. private:
  319. /*--------------------------------- Private ----------------------------------*/
  320.  
  321. IDMSourceOperation::Handle
  322.   pSrcOpH;
  323.  
  324. PrintIndicator
  325.   printInd;
  326. }; // IDMSourcePrintEvent
  327. #endif  // IC_WIN_FLAGNOP
  328.  
  329.  
  330. class IDMTargetEvent : public IDMEvent {
  331. typedef IDMEvent
  332.   Inherited;
  333. public:
  334.  
  335. /*------------------------------- Constructors -------------------------------*/
  336.   IDMTargetEvent     ( const IEvent& event );
  337.  
  338. virtual
  339.   ~IDMTargetEvent    ( );
  340.  
  341. /*------------------------------ Target Emphasis -----------------------------*/
  342. virtual IPresSpaceHandle
  343.   presSpace        ( );
  344.  
  345. virtual void
  346.   releasePresSpace ( );
  347.  
  348. private:
  349. /*--------------------------------- Private ----------------------------------*/
  350.  
  351. IPresSpaceHandle
  352.   hpsEmph;
  353. }; // IDMTargetEvent
  354.  
  355.  
  356. class IDMTargetEnterEvent : public IDMTargetEvent {
  357. typedef IDMTargetEvent
  358.   Inherited;
  359. typedef IDM::DropIndicator
  360.   DropIndicator;
  361. public:
  362.  
  363. /*------------------------------- Constructors -------------------------------*/
  364.   IDMTargetEnterEvent  ( const IEvent& event );
  365.  
  366. virtual
  367.   ~IDMTargetEnterEvent ( );
  368.  
  369. /*---------------------------- Event Information -----------------------------*/
  370. virtual DropIndicator
  371.   dropIndicator       ( ) const;
  372.  
  373. virtual unsigned long
  374.   defaultOperation    ( ) const;
  375.  
  376. IDMTargetEnterEvent
  377.  &setDropIndicator    ( DropIndicator  indicator ),
  378.  &setDefaultOperation ( unsigned long  operation );
  379.  
  380. virtual IPoint
  381.   position ( ) const;
  382.  
  383. /*---------------------------- Container Support -----------------------------*/
  384. virtual Boolean
  385.   isDragAfter  ( ) const,
  386.   isAboveFirst ( ) const;
  387.  
  388. virtual unsigned long
  389.   containerId  ( ) const;
  390.  
  391. virtual IContainerObject
  392.  *object       ( ) const;
  393.  
  394. virtual IContainerControl
  395.  *container    ( ) const;
  396.  
  397. private:
  398. /*--------------------------------- Private ----------------------------------*/
  399.  
  400. DropIndicator
  401.   dropInd;
  402.  
  403. unsigned long
  404.   op;
  405. }; // IDMTargetEnterEvent
  406.  
  407.  
  408. class IDMTargetLeaveEvent : public IDMTargetEvent {
  409. typedef IDMTargetEvent
  410.   Inherited;
  411. public:
  412.  
  413. /*------------------------------- Constructors -------------------------------*/
  414.   IDMTargetLeaveEvent  ( const IEvent& event );
  415.  
  416. virtual
  417.   ~IDMTargetLeaveEvent ( );
  418.  
  419. private:
  420. /*--------------------------------- Private ----------------------------------*/
  421. }; // IDMTargetLeaveEvent
  422.  
  423.  
  424. class IDMTargetDropEvent : public IDMTargetEvent {
  425. typedef IDMTargetEvent
  426.   Inherited;
  427. public:
  428.  
  429. /*------------------------------- Constructors -------------------------------*/
  430.   IDMTargetDropEvent  ( const IEvent& event );
  431.  
  432. virtual
  433.   ~IDMTargetDropEvent ( );
  434.  
  435. /*-------------------------- Target Drop Information -------------------------*/
  436. virtual IPoint
  437.   dropPosition    ( ) const;
  438.  
  439. virtual unsigned long
  440.   targetInfo      ( ) const;
  441.  
  442. virtual IDMTargetDropEvent
  443.  &setDropPosition ( const IPoint& position ),
  444.  &setTargetInfo   ( unsigned long info );
  445.  
  446. /*----------------------------- Container Support ----------------------------*/
  447. virtual unsigned long
  448.   containerId ( ) const;
  449.  
  450. virtual IContainerObject
  451.  *object      ( ) const;
  452.  
  453. virtual IContainerControl
  454.  *container   ( ) const;
  455.  
  456. private:
  457. /*--------------------------------- Private ----------------------------------*/
  458.  
  459. IPoint
  460.   pos;
  461.  
  462. unsigned long
  463.   ulTgtInfo;
  464. }; // IDMTargetDropEvent
  465.  
  466.  
  467. #ifndef IC_WIN_FLAGNOP
  468. class IDMTargetHelpEvent : public IDMEvent {
  469. typedef IDMEvent
  470.   Inherited;
  471. public:
  472.  
  473. /*------------------------------- Constructors -------------------------------*/
  474.   IDMTargetHelpEvent  ( const IEvent& event );
  475.  
  476. virtual
  477.   ~IDMTargetHelpEvent ( );
  478.  
  479.  
  480. /*---------------------------- Event Information -----------------------------*/
  481. virtual unsigned long
  482.   operation ( ) const;
  483.  
  484. private:
  485. /*--------------------------------- Private ----------------------------------*/
  486. }; // IDMTargetHelpEvent
  487. #endif  // IC_WIN_FLAGNOP
  488.  
  489.  
  490. #ifndef IC_WIN_FLAGNOP
  491. class IDMTargetEndEvent : public IDMEvent {
  492. typedef IDMEvent
  493.   Inherited;
  494. public:
  495.  
  496. /*------------------------------- Constructors -------------------------------*/
  497.   IDMTargetEndEvent  ( const IEvent& event );
  498.  
  499. virtual
  500.   ~IDMTargetEndEvent ( );
  501.  
  502. /*------------------------------ Alternate Window ----------------------------*/
  503. virtual IWindow
  504.  *alternateWindow       ( ) const;
  505.  
  506. virtual IWindowHandle
  507.   alternateWindowHandle ( ) const;
  508.  
  509. /*---------------------------------- Rendering -------------------------------*/
  510. Boolean
  511.   renderingFailed ( ) const,
  512.   targetCanRetry  ( ) const;
  513.  
  514. virtual IDMItem::Handle
  515.   dragItem              ( ) const;
  516.  
  517. virtual unsigned long
  518.   targetInfo            ( ) const;
  519.  
  520. private:
  521. /*--------------------------------- Private ----------------------------------*/
  522.  
  523. IDMItem::Handle
  524.   targetItemFromPM ( _DRAGITEM *pDragItem );
  525.  
  526. IDMItem::Handle
  527.   pDMTgtItemHandle;
  528.  
  529. unsigned long
  530.   usCompletion;
  531.  
  532. }; // IDMTargetEndEvent
  533. #endif  // IC_WIN_FLAGNOP
  534.  
  535. #pragma pack()
  536.  
  537.   #include <idmevent.inl>
  538.  
  539. #endif //_IDMEVENT_
  540.