home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1997 July / Sezamfile97_2.iso / windows / program / activex / axtsamp.exe / TSBRANCH.EXE / INC / IPAPER.H < prev    next >
Text File  |  1996-12-17  |  5KB  |  143 lines

  1. /*+==========================================================================
  2.   File:      IPAPER.H
  3.  
  4.   Summary:   This is the common include file for the drawing paper-related
  5.              COM Interfaces.  The Interface abstract base classes are
  6.              declared.
  7.  
  8.              This file is global to all the Tutorial Code Samples (kept in
  9.              the ..\INC directory).  It is a good practice to factor out
  10.              Interface and GUID specifications to reduce the possibility
  11.              of GUID or interface conflicts.
  12.  
  13.   Classes:   IPaper, IPaperSink.
  14.  
  15.   Functions: .
  16.  
  17.   Origin:    6-10-96: atrent - Revised for the ActiveX Tutorial Samples.
  18.  
  19. ----------------------------------------------------------------------------
  20.   This file is part of the Microsoft ActiveX Tutorial Code Samples.
  21.  
  22.   Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  23.  
  24.   This source code is intended only as a supplement to Microsoft
  25.   Development Tools and/or on-line documentation.  See these other
  26.   materials for detailed information regarding Microsoft code samples.
  27.  
  28.   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  29.   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  30.   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  31.   PARTICULAR PURPOSE.
  32. ==========================================================================+*/
  33.  
  34. #if !defined(IPAPER_H)
  35. #define IPAPER_H
  36.  
  37. #if !defined(RC_INCLUDE)
  38.  
  39.  
  40. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  41.   Interface: IPaper
  42.  
  43.   Summary:   Interface for free-form drawing on scratch-pad electronic
  44.              paper-like COM Objects.
  45.  
  46.   Methods:   InitPaper
  47.                Init Paper object. Create Ink Data array.
  48.              Lock
  49.                Client takes control of the Paper. Locks out other clients.
  50.              Unlock
  51.                Client relinquishes control of the Paper.
  52.              Load
  53.                Load Paper content from client's compound file. Does Redraw.
  54.              Save
  55.                Save Paper content to client's compound file.
  56.              InkStart
  57.                Client starts color ink drawing to the Paper surface.
  58.              InkDraw
  59.                Client puts ink data points on the electronic Paper surface.
  60.              InkStop
  61.                Client stops ink drawing to the Paper surface.
  62.              Erase
  63.                Erase the current Paper content. Notify Sinks.
  64.              Resize
  65.                Resize the drawing paper rectangle size.
  66.              Redraw
  67.                Redraw content of Paper object. Notify sinks.
  68. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  69. DECLARE_INTERFACE_(IPaper, IUnknown)
  70. {
  71.   // IUnknown methods.
  72.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  73.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  74.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  75.  
  76.   // IPaper methods.
  77.   STDMETHOD(InitPaper)  (THIS_ RECT*, BOOL*) PURE;
  78.   STDMETHOD(Lock)       (THIS_ SHORT*) PURE;
  79.   STDMETHOD(Unlock)     (THIS_ SHORT) PURE;
  80.   STDMETHOD(Load)       (THIS_ SHORT, IStorage*) PURE;
  81.   STDMETHOD(Save)       (THIS_ SHORT, IStorage*) PURE;
  82.   STDMETHOD(InkStart)   (THIS_ SHORT, SHORT, SHORT, SHORT, COLORREF) PURE;
  83.   STDMETHOD(InkDraw)    (THIS_ SHORT, SHORT, SHORT) PURE;
  84.   STDMETHOD(InkStop)    (THIS_ SHORT, SHORT, SHORT) PURE;
  85.   STDMETHOD(Erase)      (THIS_ SHORT) PURE;
  86.   STDMETHOD(Resize)     (THIS_ SHORT, SHORT, SHORT) PURE;
  87.   STDMETHOD(Redraw)     (THIS_ SHORT) PURE;
  88. };
  89.  
  90. typedef IPaper* PIPaper;
  91.  
  92.  
  93. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  94.   Interface: IPaperSink
  95.  
  96.   Summary:   Sink Connection Interface for drawing paper-like COM Objects
  97.              that communicate events back to the client.
  98.  
  99.   Methods:   Locked
  100.                A client has taken control and locked its use of the Paper.
  101.              Unlocked
  102.                A client has relinquished control of the Paper.
  103.              Loaded
  104.                A client has loaded Paper content from its own compound file.
  105.              Saved
  106.                A client has saved Paper content to its own compound file.
  107.              InkStart
  108.                A client started a color ink drawing sequence to the Paper.
  109.              InkDraw
  110.                A client is putting ink data points on the Paper surface.
  111.              InkStop
  112.                A client stopped its ink drawing sequence to the Paper.
  113.              Erased
  114.                A client has erased all ink data from the Paper.
  115.              Resized
  116.                A client has resized the Paper.
  117. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  118. DECLARE_INTERFACE_(IPaperSink, IUnknown)
  119. {
  120.   // IUnknown methods.
  121.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  122.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  123.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  124.  
  125.   // IPaperSink methods.
  126.   STDMETHOD(Locked)     (THIS) PURE;
  127.   STDMETHOD(Unlocked)   (THIS) PURE;
  128.   STDMETHOD(Loaded)     (THIS) PURE;
  129.   STDMETHOD(Saved)      (THIS) PURE;
  130.   STDMETHOD(InkStart)   (THIS_ SHORT, SHORT, SHORT, COLORREF) PURE;
  131.   STDMETHOD(InkDraw)    (THIS_ SHORT, SHORT) PURE;
  132.   STDMETHOD(InkStop)    (THIS_ SHORT, SHORT) PURE;
  133.   STDMETHOD(Erased)     (THIS) PURE;
  134.   STDMETHOD(Resized)    (THIS_ SHORT, SHORT) PURE;
  135. };
  136.  
  137. typedef IPaperSink* PIPaperSink;
  138.  
  139.  
  140. #endif // RC_INCLUDE
  141.  
  142. #endif // IPAPER_H
  143.