Annotation of mstools/ole20/samples/outline/svroutl.h, revision 1.1.1.1

1.1       root        1: /*************************************************************************
                      2: ** 
                      3: **    OLE 2.0 Server Sample Code
                      4: **    
                      5: **    svroutl.h
                      6: **    
                      7: **    This file contains file contains data structure defintions, 
                      8: **       function prototypes, constants, etc. used by the OLE 2.0 server 
                      9: **    app version of the Outline series of sample applications:
                     10: **                     Outline -- base version of the app (without OLE functionality)
                     11: **                     SvrOutl -- OLE 2.0 Server sample app
                     12: **                     CntrOutl -- OLE 2.0 Containter sample app
                     13: ** 
                     14: **       (c) Copyright Microsoft Corp. 1992 - 1993 All Rights Reserved
                     15: **
                     16: *************************************************************************/
                     17: 
                     18: #if !defined( _SVROUTL_H_ )
                     19: #define _SVROUTL_H_
                     20: 
                     21: #ifndef RC_INVOKED
                     22: #pragma message ("INCLUDING SVROUTL.H from " __FILE__)
                     23: #endif  /* RC_INVOKED */
                     24: 
                     25: #include "oleoutl.h"
                     26: 
                     27: /* Defines */
                     28: 
                     29: // Enable SVROUTL and ISVROTL to emulate each other (TreatAs aka. ActivateAs)
                     30: #define SVR_TREATAS     1
                     31: 
                     32: // Enable SVROUTL and ISVROTL to convert each other (TreatAs aka. ActivateAs)
                     33: #define SVR_CONVERTTO   1
                     34: 
                     35: // Enable ISVROTL to operate as in inside-out style in-place object
                     36: #define SVR_INSIDEOUT   1
                     37: 
                     38: /* Default name used for container of the embedded object. used if
                     39: **    container forgets to call IOleObject::SetHostNames
                     40: */
                     41: // REVIEW: should load from string resource
                     42: #define DEFCONTAINERNAME       "Unknown Document"
                     43: 
                     44: /* Default prefix for auto-generated range names. This is used with 
                     45: **       links to unnamed ranges (pseudo objects).
                     46: */
                     47: // REVIEW: should load from string resource
                     48: #define DEFRANGENAMEPREFIX     "Range"
                     49: 
                     50: // Maximum length of strings passed through IOleObject::SetHostNames
                     51: #define MAXAPPNAME     32
                     52: #define MAXCONTAINERNAME       32
                     53: 
                     54: // Menu option in embedding mode
                     55: #define IDM_F_UPDATE   1151
                     56: 
                     57: /* Types */
                     58: 
                     59: /* Codes for CallBack events */
                     60: typedef enum tagOLE_NOTIFICATION {
                     61:     OLE_ONDATACHANGE,        // 0
                     62:     OLE_ONSAVE,              // 1
                     63:     OLE_ONRENAME,            // 2
                     64:     OLE_ONCLOSE              // 3
                     65: } OLE_NOTIFICATION;
                     66: 
                     67: /* Codes to indicate mode of storage for an object.  
                     68: **    Mode of the storage is modified by the IPersistStorage methods:
                     69: **             Save, HandsOffStorage, and SaveCompleted.
                     70: */
                     71: typedef enum tagSTGMODE {
                     72:        STGMODE_NORMAL          = 0,
                     73:        STGMODE_NOSCRIBBLE      = 1,
                     74:        STGMODE_HANDSOFF        = 2
                     75: } STGMODE;
                     76: 
                     77: 
                     78: /* Forward type definitions */
                     79: typedef struct tagSERVERAPP FAR* LPSERVERAPP;
                     80: typedef struct tagSERVERDOC FAR* LPSERVERDOC;
                     81: typedef struct tagPSEUDOOBJ FAR* LPPSEUDOOBJ;
                     82: 
                     83: typedef struct tagINPLACEDATA {
                     84:        OLEMENUGROUPWIDTHS              menuGroupWidths;
                     85:        HOLEMENU                                hOlemenu;
                     86:        HMENU                                   hMenuShared;
                     87:        LPOLEINPLACESITE                lpSite;
                     88:        LPOLEINPLACEUIWINDOW    lpDoc;
                     89:        LPOLEINPLACEFRAME               lpFrame;
                     90:        OLEINPLACEFRAMEINFO             frameInfo;
                     91:     HWND                    hWndFrame;
                     92:        BOOL                                    fInCSHelpMode;
                     93:        BOOL                                    fBorderOn;
                     94:        RECT                                    rcPosRect;
                     95:        RECT                                    rcClipRect;
                     96: } INPLACEDATA, FAR* LPINPLACEDATA;
                     97: 
                     98: 
                     99: /*************************************************************************
                    100: ** class SERVERDOC : OLEDOC
                    101: **    SERVERDOC is an extention to the abstract base OLEDOC class.
                    102: **    The OLEDOC class defines the fields, methods and interfaces that
                    103: **    are common to both server and client implementations. The
                    104: **    SERVERDOC class adds the fields, methods and interfaces that are
                    105: **    specific to OLE 2.0 Server functionality. There is one instance
                    106: **    of SERVERDOC object created per document open in the app. The SDI 
                    107: **    version of the app supports one SERVERDOC at a time. The MDI
                    108: **    version of the app can manage multiple documents at one time.
                    109: **    The SERVERDOC class inherits all fields from the OLEDOC class.
                    110: **    This inheritance is achieved by including a member variable of
                    111: **    type OLEDOC as the first field in the SERVERDOC structure. Thus a
                    112: **    pointer to a SERVERDOC object can be cast to be a pointer to a
                    113: **    OLEDOC object or an OUTLINEDOC object
                    114: *************************************************************************/
                    115: 
                    116: typedef struct tagSERVERDOC {
                    117:        OLEDOC                          m_OleDoc;                       // ServerDoc inherits from OleDoc
                    118:     ULONG                              m_cPseudoObj;           // total count of pseudo obj's
                    119:     LPOLECLIENTSITE     m_lpOleClientSite;     // Client associated with the obj
                    120:        LPOLEADVISEHOLDER       m_lpOleAdviseHldr;      // helper obj to hold ole advises
                    121:        LPDATAADVISEHOLDER      m_lpDataAdviseHldr;     // helper obj to hold data advises
                    122:        DWORD                           m_dwStorageMode;        // indicates state during save
                    123:     BOOL                m_fSaveWithSameAsLoad;  // was IPS::Save called with
                    124:                                             // fSameAsLoad==TRUE. 
                    125:        char                            m_szContainerApp[MAXAPPNAME];
                    126:        char                            m_szContainerObj[MAXCONTAINERNAME];
                    127:        ULONG                           m_nNextRangeNo;         // next no. for unnamed range
                    128:        LINERANGE                       m_lrSrcSelOfCopy;       // src sel if doc created for copy
                    129:        BOOL                            m_fDataChanged;         // data changed when draw disabled
                    130:        BOOL                            m_fSizeChanged;         // size changed when draw disabled
                    131:     BOOL                m_fSendDataOnStop;  // did data ever change?
                    132: #if defined( SVR_TREATAS )
                    133:        CLSID                           m_clsidTreatAs;         // clsid to pretend to be
                    134:        LPSTR                       m_lpszTreatAsType;  // user type name to pretend to be
                    135: #endif // SVR_TREATAS
                    136: 
                    137: #if defined( LATER )
                    138:        // REVIEW: is it necessary to register a WildCard Moniker
                    139:        DWORD                           m_dwWildCardRegROT;     // key if wildcard reg'ed in ROT
                    140: #endif 
                    141:        
                    142: #if defined( INPLACE_SVR )
                    143:        BOOL                            m_fInPlaceActive;
                    144:        BOOL                            m_fInPlaceVisible;
                    145:        BOOL                            m_fUIActive;
                    146:        HWND                            m_hWndParent;
                    147:        HWND                            m_hWndHatch;
                    148:        LPINPLACEDATA           m_lpIPData;
                    149:        
                    150:        struct CDocOleInPlaceObjectImpl {
                    151:                IOleInPlaceObjectVtbl FAR*      lpVtbl;
                    152:                LPSERVERDOC                                     lpServerDoc;
                    153:                int                                                     cRef;   // interface specific ref count.
                    154:        } m_OleInPlaceObject;
                    155: 
                    156:        struct CDocOleInPlaceActiveObjectImpl {
                    157:                IOleInPlaceActiveObjectVtbl FAR* lpVtbl;
                    158:                LPSERVERDOC                                              lpServerDoc;
                    159:                int                                                              cRef;// interface specific ref count.
                    160:        } m_OleInPlaceActiveObject;
                    161: #endif // INPLACE_SVR
                    162: 
                    163:        struct CDocOleObjectImpl {
                    164:                IOleObjectVtbl FAR*                     lpVtbl;
                    165:                LPSERVERDOC                                     lpServerDoc;
                    166:                int                                                     cRef;   // interface specific ref count.
                    167:        } m_OleObject;
                    168: 
                    169:        struct CDocPersistStorageImpl {
                    170:                IPersistStorageVtbl FAR*        lpVtbl;
                    171:                LPSERVERDOC                                     lpServerDoc;
                    172:                int                                                     cRef;   // interface specific ref count.
                    173:        } m_PersistStorage;
                    174: 
                    175: #if defined( SVR_TREATAS )
                    176:        struct CDocStdMarshalInfoImpl {
                    177:                IStdMarshalInfoVtbl FAR*        lpVtbl;
                    178:                LPSERVERDOC                                     lpServerDoc;
                    179:                int                                                     cRef;   // interface specific ref count.
                    180:        } m_StdMarshalInfo;
                    181: #endif // SVR_TREATAS
                    182:        
                    183: } SERVERDOC;
                    184: 
                    185: /* ServerDoc methods (functions) */
                    186: BOOL ServerDoc_Init(LPSERVERDOC lpServerDoc, BOOL fDataTransferDoc);
                    187: BOOL ServerDoc_InitNewEmbed(LPSERVERDOC lpServerDoc);
                    188: void ServerDoc_PseudoObjUnlockDoc(
                    189:                LPSERVERDOC                     lpServerDoc, 
                    190:                LPPSEUDOOBJ                     lpPseudoObj
                    191: );
                    192: void ServerDoc_PseudoObjLockDoc(LPSERVERDOC lpServerDoc);
                    193: BOOL ServerDoc_PasteFormatFromData(
                    194:                LPSERVERDOC                             lpServerDoc, 
                    195:                CLIPFORMAT                              cfFormat, 
                    196:                LPDATAOBJECT                    lpSrcDataObj, 
                    197:                BOOL                                    fLocalDataObj, 
                    198:                BOOL                                    fLink
                    199: );
                    200: BOOL ServerDoc_QueryPasteFromData(
                    201:                LPSERVERDOC                             lpServerDoc, 
                    202:                LPDATAOBJECT                    lpSrcDataObj, 
                    203:                BOOL                                    fLink
                    204: );
                    205: HRESULT ServerDoc_GetClassID(LPSERVERDOC lpServerDoc, LPCLSID lpclsid);
                    206: void ServerDoc_UpdateMenu(LPSERVERDOC lpServerDoc);
                    207: void ServerDoc_RestoreMenu(LPSERVERDOC lpServerDoc);
                    208: HRESULT ServerDoc_GetData (
                    209:                LPSERVERDOC                             lpServerDoc, 
                    210:                LPFORMATETC                             lpformatetc, 
                    211:                LPSTGMEDIUM                             lpMedium
                    212: );
                    213: HRESULT ServerDoc_GetDataHere (
                    214:                LPSERVERDOC                             lpServerDoc, 
                    215:                LPFORMATETC                             lpformatetc, 
                    216:                LPSTGMEDIUM                             lpMedium
                    217: );
                    218: HRESULT ServerDoc_QueryGetData(LPSERVERDOC lpServerDoc,LPFORMATETC lpformatetc);
                    219: HRESULT ServerDoc_EnumFormatEtc(
                    220:                LPSERVERDOC                             lpServerDoc, 
                    221:                DWORD                                   dwDirection, 
                    222:                LPENUMFORMATETC FAR*    lplpenumFormatEtc
                    223: );
                    224: HANDLE ServerDoc_GetMetafilePictData(
                    225:                LPSERVERDOC                             lpServerDoc,
                    226:                LPLINERANGE                             lplrSel
                    227: );
                    228: void ServerDoc_SendAdvise(
                    229:         LPSERVERDOC     lpServerDoc, 
                    230:         WORD            wAdvise, 
                    231:         LPMONIKER       lpmkDoc,
                    232:                DWORD                   dwAdvf
                    233: );
                    234: HRESULT ServerDoc_GetObject(
                    235:                LPSERVERDOC                             lpServerDoc, 
                    236:                LPSTR                                   lpszItem, 
                    237:                REFIID                                  riid, 
                    238:                LPVOID FAR*                             lplpvObject
                    239: );
                    240: HRESULT ServerDoc_IsRunning(LPSERVERDOC lpServerDoc, LPSTR lpszItem);
                    241: LPMONIKER ServerDoc_GetSelRelMoniker(
                    242:                LPSERVERDOC                             lpServerDoc, 
                    243:                LPLINERANGE                             lplrSel,        
                    244:                DWORD                                   dwAssign
                    245: );
                    246: LPMONIKER ServerDoc_GetSelFullMoniker(
                    247:                LPSERVERDOC                             lpServerDoc, 
                    248:                LPLINERANGE                             lplrSel,        
                    249:                DWORD                                   dwAssign
                    250: );
                    251: 
                    252: 
                    253: #if defined( INPLACE_SVR )
                    254: HRESULT ServerDoc_DoInPlaceActivate(
                    255:                LPSERVERDOC             lpServerDoc,
                    256:                LONG                    lVerb,
                    257:                LPMSG                   lpmsg, 
                    258:                LPOLECLIENTSITE lpActiveSite
                    259: );
                    260: HRESULT ServerDoc_DoInPlaceDeactivate(LPSERVERDOC lpServerDoc);
                    261: HRESULT ServerDoc_DoInPlaceHide(LPSERVERDOC lpServerDoc);
                    262: BOOL ServerDoc_AllocInPlaceData(LPSERVERDOC lpServerDoc);
                    263: void ServerDoc_FreeInPlaceData(LPSERVERDOC lpServerDoc);
                    264: 
                    265: HRESULT        ServerDoc_AssembleMenus(LPSERVERDOC lpServerDoc);
                    266: void   ServerDoc_DisassembleMenus(LPSERVERDOC lpServerDoc);
                    267: void ServerDoc_CalcInPlaceWindowPos(
                    268:                LPSERVERDOC                     lpServerDoc, 
                    269:                LPRECT                          lprcListBox, 
                    270:                LPRECT                          lprcDoc,
                    271:                LPSCALEFACTOR           lpscale
                    272: );
                    273: void ServerDoc_UpdateInPlaceWindowOnExtentChange(LPSERVERDOC lpServerDoc);
                    274: void ServerDoc_ResizeInPlaceWindow(
                    275:                LPSERVERDOC                     lpServerDoc, 
                    276:         LPCRECT             lprcPosRect,
                    277:         LPCRECT             lprcClipRect
                    278: );
                    279: void ServerDoc_ShadeInPlaceBorder(LPSERVERDOC lpServerDoc, BOOL fShadeOn);
                    280: LPOLEINPLACEFRAME ServerDoc_GetTopInPlaceFrame(LPSERVERDOC lpServerDoc);
                    281: void ServerDoc_GetSharedMenuHandles(
                    282:                LPSERVERDOC     lpServerDoc,
                    283:                HMENU FAR*              lphSharedMenu,
                    284:                HOLEMENU FAR*   lphOleMenu
                    285: );
                    286: void ServerDoc_AddFrameLevelUI(LPSERVERDOC lpServerDoc);
                    287: void ServerDoc_AddFrameLevelTools(LPSERVERDOC lpServerDoc);
                    288: void ServerDoc_UIActivate (LPSERVERDOC lpServerDoc);
                    289: 
                    290: #if defined( USE_FRAMETOOLS )
                    291: void ServerDoc_RemoveFrameLevelTools(LPSERVERDOC lpServerDoc);
                    292: #endif // USE_FRAMETOOLS
                    293: 
                    294: #endif // INPLACE_SVR
                    295: 
                    296: 
                    297: /* ServerDoc::IOleObject methods (functions) */
                    298: STDMETHODIMP SvrDoc_OleObj_QueryInterface(
                    299:                LPOLEOBJECT                             lpThis,
                    300:                REFIID                                  riid,
                    301:                LPVOID FAR*                             lplpvObj
                    302: );
                    303: STDMETHODIMP_(ULONG) SvrDoc_OleObj_AddRef(LPOLEOBJECT lpThis);
                    304: STDMETHODIMP_(ULONG) SvrDoc_OleObj_Release(LPOLEOBJECT lpThis);
                    305: STDMETHODIMP SvrDoc_OleObj_SetClientSite(
                    306:                LPOLEOBJECT                             lpThis,
                    307:                LPOLECLIENTSITE                 lpclientSite
                    308: );
                    309: STDMETHODIMP SvrDoc_OleObj_GetClientSite(
                    310:                LPOLEOBJECT             lpThis,
                    311:                LPOLECLIENTSITE FAR*    lplpClientSite
                    312: );
                    313: STDMETHODIMP SvrDoc_OleObj_SetHostNames(
                    314:                LPOLEOBJECT             lpThis,
                    315:                LPCSTR                                  szContainerApp,
                    316:                LPCSTR                                  szContainerObj
                    317: );
                    318: STDMETHODIMP SvrDoc_OleObj_Close(
                    319:                LPOLEOBJECT                             lpThis,
                    320:                DWORD                                   dwSaveOption
                    321: );
                    322: STDMETHODIMP SvrDoc_OleObj_SetMoniker(
                    323:                LPOLEOBJECT                             lpThis, 
                    324:                DWORD                                   dwWhichMoniker, 
                    325:                LPMONIKER                               lpmk
                    326: );
                    327: STDMETHODIMP SvrDoc_OleObj_GetMoniker(
                    328:                LPOLEOBJECT                             lpThis, 
                    329:                DWORD                                   dwAssign,
                    330:                DWORD                                   dwWhichMoniker, 
                    331:                LPMONIKER FAR*                  lplpmk
                    332: );
                    333: STDMETHODIMP SvrDoc_OleObj_InitFromData(
                    334:                LPOLEOBJECT             lpThis,
                    335:                LPDATAOBJECT            lpDataObject,
                    336:                BOOL                    fCreation,
                    337:                DWORD                                   reserved
                    338: );
                    339: STDMETHODIMP SvrDoc_OleObj_GetClipboardData(
                    340:                LPOLEOBJECT             lpThis,
                    341:                DWORD                                   reserved,
                    342:                LPDATAOBJECT FAR*       lplpDataObject
                    343: );
                    344: STDMETHODIMP SvrDoc_OleObj_DoVerb(
                    345:                LPOLEOBJECT             lpThis,
                    346:                LONG                    lVerb,
                    347:                LPMSG                   lpmsg,
                    348:         LPOLECLIENTSITE         lpActiveSite,
                    349:                LONG                                    lindex,
                    350:                HWND                                    hwndParent,
                    351:                LPCRECT                                 lprcPosRect
                    352: );
                    353: STDMETHODIMP SvrDoc_OleObj_EnumVerbs(
                    354:                LPOLEOBJECT                             lpThis,
                    355:                LPENUMOLEVERB FAR*              lplpenumOleVerb 
                    356: );
                    357: STDMETHODIMP SvrDoc_OleObj_Update(LPOLEOBJECT lpThis);
                    358: STDMETHODIMP SvrDoc_OleObj_IsUpToDate(LPOLEOBJECT lpThis);
                    359: STDMETHODIMP SvrDoc_OleObj_GetUserClassID(
                    360:                LPOLEOBJECT                             lpThis, 
                    361:                LPCLSID                                 lpclsid
                    362: );
                    363: STDMETHODIMP SvrDoc_OleObj_GetUserType(
                    364:                LPOLEOBJECT             lpThis,
                    365:                DWORD                                   dwFormOfType, 
                    366:                LPSTR FAR*                              lpszUserType
                    367: );
                    368: STDMETHODIMP SvrDoc_OleObj_SetExtent(
                    369:                LPOLEOBJECT                             lpThis,
                    370:                DWORD                                   dwDrawAspect,
                    371:                LPSIZEL                                 lplgrc
                    372: );
                    373: STDMETHODIMP SvrDoc_OleObj_GetExtent(
                    374:                LPOLEOBJECT                             lpThis,
                    375:                DWORD                                   dwDrawAspect,
                    376:                LPSIZEL                                 lplgrc
                    377: );
                    378: STDMETHODIMP SvrDoc_OleObj_Advise(
                    379:                LPOLEOBJECT                             lpThis, 
                    380:                LPADVISESINK                    lpAdvSink, 
                    381:                LPDWORD                                 lpdwConnection
                    382: );
                    383: STDMETHODIMP SvrDoc_OleObj_Unadvise(LPOLEOBJECT lpThis, DWORD dwConnection);
                    384: STDMETHODIMP SvrDoc_OleObj_EnumAdvise(
                    385:                LPOLEOBJECT                             lpThis, 
                    386:                LPENUMSTATDATA FAR*             lplpenumAdvise
                    387: );
                    388: STDMETHODIMP SvrDoc_OleObj_GetMiscStatus(
                    389:                LPOLEOBJECT             lpThis,
                    390:                DWORD                                   dwAspect,
                    391:                DWORD FAR*                              lpdwStatus
                    392: );
                    393: STDMETHODIMP SvrDoc_OleObj_SetColorScheme(
                    394:                LPOLEOBJECT             lpThis,
                    395:                LPLOGPALETTE            lpLogpal
                    396: );
                    397: STDMETHODIMP SvrDoc_OleObj_LockObject(
                    398:                LPOLEOBJECT             lpThis,
                    399:                BOOL                    fLock
                    400: );
                    401: 
                    402: /* ServerDoc::IPersistStorage methods (functions) */
                    403: STDMETHODIMP SvrDoc_PStg_QueryInterface(
                    404:                LPPERSISTSTORAGE                lpThis,
                    405:                REFIID                                  riid,
                    406:                LPVOID FAR*                             lplpvObj
                    407: );
                    408: STDMETHODIMP_(ULONG) SvrDoc_PStg_AddRef(LPPERSISTSTORAGE lpThis);
                    409: STDMETHODIMP_(ULONG) SvrDoc_PStg_Release(LPPERSISTSTORAGE lpThis);
                    410: STDMETHODIMP SvrDoc_PStg_GetClassID(
                    411:                LPPERSISTSTORAGE                lpThis, 
                    412:                LPCLSID                                 lpClassID
                    413: );
                    414: STDMETHODIMP  SvrDoc_PStg_IsDirty(LPPERSISTSTORAGE     lpThis);
                    415: STDMETHODIMP SvrDoc_PStg_InitNew(
                    416:                LPPERSISTSTORAGE                lpThis, 
                    417:                LPSTORAGE                               lpStg
                    418: );
                    419: STDMETHODIMP SvrDoc_PStg_Load(
                    420:                LPPERSISTSTORAGE                lpThis, 
                    421:                LPSTORAGE                               lpStg
                    422: );
                    423: STDMETHODIMP SvrDoc_PStg_Save(
                    424:         LPPERSISTSTORAGE        lpThis,
                    425:         LPSTORAGE               lpStg,
                    426:         BOOL                    fSameAsLoad
                    427: );
                    428: STDMETHODIMP SvrDoc_PStg_SaveCompleted(
                    429:         LPPERSISTSTORAGE        lpThis, 
                    430:         LPSTORAGE               lpStgNew
                    431: );
                    432: STDMETHODIMP SvrDoc_PStg_HandsOffStorage(LPPERSISTSTORAGE lpThis);
                    433: 
                    434: 
                    435: #if defined( SVR_TREATAS )
                    436: 
                    437: /* ServerDoc::IStdMarshalInfo methods (functions) */
                    438: STDMETHODIMP SvrDoc_StdMshl_QueryInterface(
                    439:         LPSTDMARSHALINFO        lpThis,
                    440:         REFIID                  riid,
                    441:         LPVOID FAR*             lplpvObj
                    442: );
                    443: STDMETHODIMP_(ULONG) SvrDoc_StdMshl_AddRef(LPSTDMARSHALINFO lpThis);
                    444: STDMETHODIMP_(ULONG) SvrDoc_StdMshl_Release(LPSTDMARSHALINFO lpThis);
                    445: STDMETHODIMP SvrDoc_StdMshl_GetClassForHandler(
                    446:         LPSTDMARSHALINFO        lpThis, 
                    447:                DWORD                                   dwDestContext, 
                    448:                LPVOID                                  pvDestContext, 
                    449:         LPCLSID                 lpClassID
                    450: );
                    451: #endif // SVR_TREATAS 
                    452: 
                    453: /*************************************************************************
                    454: ** class SERVERAPP : OLEAPP
                    455: **    SERVERAPP is an extention to the abstract base OLEAPP class.
                    456: **    The OLEAPP class defines the fields, methods and interfaces that
                    457: **    are common to both server and client implementations. The
                    458: **    SERVERAPP class adds the fields and methods that are specific to
                    459: **    OLE 2.0 Server functionality. There is one instance of
                    460: **    SERVERAPP object created per running application instance. This
                    461: **    object holds many fields that could otherwise be organized as
                    462: **    global variables. The SERVERAPP class inherits all fields
                    463: **    from the OLEAPP class. This inheritance is achieved by including a
                    464: **    member variable of type OLEAPP as the first field in the SERVERAPP
                    465: **    structure. OLEAPP inherits from OLEAPP. This inheritance is
                    466: **    achieved in the same manner. Thus a pointer to a SERVERAPP object
                    467: **    can be cast to be a pointer to an OLEAPP or an OUTLINEAPP object
                    468: *************************************************************************/
                    469: 
                    470: typedef struct tagSERVERAPP {
                    471:        OLEAPP          m_OleApp;               // ServerApp inherits all fields of OleApp
                    472: 
                    473: #if defined( INPLACE_SVR )
                    474:        HACCEL  m_hAccelIPSvr; // accelerators for server's active object commands
                    475:        HMENU   m_hMenuEdit;   // handle to Edit menu of the server app
                    476:        HMENU   m_hMenuLine;   // handle to Line menu of the server app
                    477:        HMENU   m_hMenuName;   // handle to Name menu of the server app
                    478:        HMENU   m_hMenuOptions; // handle to Options menu of the server app
                    479:        HMENU   m_hMenuDebug;           // handle to Debug menu of the server app
                    480:        HMENU   m_hMenuHelp;   // handle to Help menu of the server app
                    481:        LPINPLACEDATA   m_lpIPData;
                    482: #endif
                    483:        
                    484: } SERVERAPP;
                    485: 
                    486: /* ServerApp methods (functions) */
                    487: BOOL ServerApp_InitInstance(
                    488:                LPSERVERAPP                             lpServerApp, 
                    489:                HINSTANCE                               hInst, 
                    490:                int                                     nCmdShow
                    491: );
                    492: BOOL ServerApp_InitVtbls (LPSERVERAPP lpServerApp);
                    493: 
                    494: 
                    495: 
                    496: /*************************************************************************
                    497: ** class SERVERNAME : OUTLINENAME
                    498: **    SERVERNAME class is an extension to the OUTLINENAME base class that 
                    499: **    adds functionallity required to support linking to ranges (pseudo 
                    500: **    objects). Pseudo objects are used to allow linking to a range
                    501: **    (sub-selection) of a SERVERDOC document. The base class OUTLINENAME
                    502: **    stores a particular named selection in the document. The
                    503: **    NAMETABLE class holds all of the names defined in a particular
                    504: **    document. Each OUTLINENAME object has a string as its key and a 
                    505: **    starting line index and an ending line index for the named range. 
                    506: **    The SERVERNAME class, also, stores a pointer to a PSEUDOOBJ if one 
                    507: **    has been allocated that corresponds to the named selection.
                    508: **    The SERVERNAME class inherits all fields from the OUTLINENAME class.
                    509: **    This inheritance is achieved by including a member variable of
                    510: **    type OUTLINENAME as the first field in the SERVERNAME 
                    511: **    structure. Thus a pointer to an SERVERNAME object can be cast to be
                    512: **    a pointer to a OUTLINENAME object.
                    513: *************************************************************************/
                    514: 
                    515: typedef struct tagSERVERNAME {
                    516:        OUTLINENAME             m_Name;                 // ServerName inherits all fields of Name
                    517:        LPPSEUDOOBJ m_lpPseudoObj;      // ptr to pseudo object if allocated
                    518: } SERVERNAME, FAR* LPSERVERNAME;
                    519: 
                    520: /* ServerName methods (functions) */
                    521: void ServerName_SetSel(
                    522:                LPSERVERNAME                    lpServerName, 
                    523:                LPLINERANGE                             lplrSel, 
                    524:                BOOL                                    fRangeModified
                    525: );
                    526: void ServerName_SendPendingAdvises(LPSERVERNAME lpServerName);
                    527: LPPSEUDOOBJ ServerName_GetPseudoObj(
                    528:                LPSERVERNAME                    lpServerName, 
                    529:                LPSERVERDOC                             lpServerDoc
                    530: );
                    531: void ServerName_ClosePseudoObj(LPSERVERNAME lpServerName);
                    532: 
                    533: 
                    534: /*************************************************************************
                    535: ** class PSEUDOOBJ
                    536: **    The PSEUDOOBJ (pseudo object) is a concrete class. A pseudo object
                    537: **    is created when a link is made to a range of lines within an
                    538: **    SERVERDOC document. A pseudo object is dependent on the existance
                    539: **    of the SERVERDOC which represents the whole document.  
                    540: *************************************************************************/
                    541: 
                    542: typedef struct tagPSEUDOOBJ {
                    543:     ULONG                              m_cRef;                         // total ref count for obj
                    544:        BOOL                            m_fObjIsClosing;        // flag to guard recursive close
                    545:        LPSERVERNAME            m_lpName;                       // named range for this pseudo obj
                    546:        LPSERVERDOC                     m_lpDoc;                        // ptr to whole document
                    547:        LPOLEADVISEHOLDER       m_lpOleAdviseHldr;      // helper obj to hold ole advises
                    548:        LPDATAADVISEHOLDER      m_lpDataAdviseHldr;     // helper obj to hold data advises
                    549:        BOOL                            m_fDataChanged;         // data changed when draw disabled
                    550: 
                    551:        struct CPseudoObjUnknownImpl {
                    552:                IUnknownVtbl FAR*               lpVtbl;
                    553:                LPPSEUDOOBJ                             lpPseudoObj;
                    554:                int                                             cRef;   // interface specific ref count.
                    555:        } m_Unknown;
                    556:        
                    557:        struct CPseudoObjOleObjectImpl {
                    558:                IOleObjectVtbl FAR*             lpVtbl;
                    559:                LPPSEUDOOBJ                             lpPseudoObj;
                    560:                int                                             cRef;   // interface specific ref count.
                    561:        } m_OleObject;
                    562:        
                    563:        struct CPseudoObjDataObjectImpl {
                    564:                IDataObjectVtbl FAR*    lpVtbl;
                    565:                LPPSEUDOOBJ                             lpPseudoObj;
                    566:                int                                             cRef;   // interface specific ref count.
                    567:        } m_DataObject;
                    568:        
                    569: } PSEUDOOBJ;
                    570: 
                    571: /* PseudoObj methods (functions) */
                    572: void PseudoObj_Init(
                    573:                LPPSEUDOOBJ                             lpPseudoObj, 
                    574:                LPSERVERNAME                    lpServerName, 
                    575:                LPSERVERDOC                             lpServerDoc
                    576: );
                    577: ULONG PseudoObj_AddRef(LPPSEUDOOBJ lpPseudoObj);
                    578: ULONG PseudoObj_Release(LPPSEUDOOBJ lpPseudoObj);
                    579: HRESULT PseudoObj_QueryInterface(
                    580:                LPPSEUDOOBJ                     lpPseudoObj, 
                    581:                REFIID                          riid, 
                    582:                LPVOID FAR*                     lplpUnk
                    583: );
                    584: BOOL PseudoObj_Close(LPPSEUDOOBJ lpPseudoObj);
                    585: void PseudoObj_Destroy(LPPSEUDOOBJ lpPseudoObj);
                    586: void PseudoObj_GetSel(LPPSEUDOOBJ lpPseudoObj, LPLINERANGE lplrSel);
                    587: void PseudoObj_GetExtent(LPPSEUDOOBJ lpPseudoObj, LPSIZEL lpsizel);
                    588: void PseudoObj_GetExtent(LPPSEUDOOBJ lpPseudoObj, LPSIZEL lpsizel);
                    589: void PseudoObj_SendAdvise(
                    590:         LPPSEUDOOBJ lpPseudoObj, 
                    591:         WORD        wAdvise, 
                    592:         LPMONIKER   lpmkObj,
                    593:                DWORD           dwAdvf
                    594: );
                    595: LPMONIKER PseudoObj_GetFullMoniker(LPPSEUDOOBJ lpPseudoObj, LPMONIKER lpmkDoc);
                    596: 
                    597: /* PseudoObj::IUnknown methods (functions) */
                    598: STDMETHODIMP PseudoObj_Unk_QueryInterface(
                    599:                LPUNKNOWN                 lpThis,
                    600:                REFIID            riid,
                    601:                LPVOID FAR*       lplpvObj
                    602: );
                    603: STDMETHODIMP_(ULONG) PseudoObj_Unk_AddRef(LPUNKNOWN lpThis);
                    604: STDMETHODIMP_(ULONG) PseudoObj_Unk_Release (LPUNKNOWN lpThis);
                    605: 
                    606: /* PseudoObj::IOleObject methods (functions) */
                    607: STDMETHODIMP PseudoObj_OleObj_QueryInterface(
                    608:                LPOLEOBJECT             lpThis,
                    609:                REFIID          riid,
                    610:                LPVOID FAR*             lplpvObj
                    611: );
                    612: STDMETHODIMP_(ULONG) PseudoObj_OleObj_AddRef(LPOLEOBJECT lpThis);
                    613: STDMETHODIMP_(ULONG) PseudoObj_OleObj_Release(LPOLEOBJECT lpThis);
                    614: STDMETHODIMP PseudoObj_OleObj_SetClientSite(
                    615:                LPOLEOBJECT         lpThis,
                    616:                LPOLECLIENTSITE     lpClientSite
                    617: );
                    618: STDMETHODIMP PseudoObj_OleObj_GetClientSite(
                    619:                LPOLEOBJECT             lpThis,
                    620:                LPOLECLIENTSITE FAR*    lplpClientSite
                    621: );
                    622: STDMETHODIMP PseudoObj_OleObj_SetHostNames(
                    623:                LPOLEOBJECT             lpThis,
                    624:                LPCSTR                                  szContainerApp,
                    625:                LPCSTR                                  szContainerObj
                    626: );
                    627: STDMETHODIMP PseudoObj_OleObj_Close(
                    628:                LPOLEOBJECT             lpThis,
                    629:                DWORD                                   dwSaveOption
                    630: );
                    631: STDMETHODIMP PseudoObj_OleObj_SetMoniker(
                    632:                LPOLEOBJECT     lpThis, 
                    633:                DWORD           dwWhichMoniker, 
                    634:                LPMONIKER       lpmk
                    635: );
                    636: STDMETHODIMP PseudoObj_OleObj_GetMoniker(
                    637:                LPOLEOBJECT             lpThis, 
                    638:                DWORD                   dwAssign,
                    639:                DWORD                   dwWhichMoniker, 
                    640:                LPMONIKER FAR*  lplpmk
                    641: );
                    642: STDMETHODIMP PseudoObj_OleObj_InitFromData(
                    643:                LPOLEOBJECT             lpThis,
                    644:                LPDATAOBJECT            lpDataObject,
                    645:                BOOL                    fCreation,
                    646:                DWORD                                   reserved
                    647: );
                    648: STDMETHODIMP PseudoObj_OleObj_GetClipboardData(
                    649:                LPOLEOBJECT             lpThis,
                    650:                DWORD                                   reserved,
                    651:                LPDATAOBJECT FAR*       lplpDataObject
                    652: );
                    653: STDMETHODIMP PseudoObj_OleObj_DoVerb(
                    654:                LPOLEOBJECT             lpThis,
                    655:                LONG                    lVerb,
                    656:                LPMSG                   lpmsg,
                    657:         LPOLECLIENTSITE         lpActiveSite,
                    658:                LONG                                    lindex,
                    659:                HWND                                    hwndParent,
                    660:                LPCRECT                                 lprcPosRect
                    661: );
                    662: STDMETHODIMP PseudoObj_OleObj_EnumVerbs(
                    663:                LPOLEOBJECT                     lpThis,
                    664:                LPENUMOLEVERB FAR*      lplpenumOleVerb 
                    665: );
                    666: STDMETHODIMP PseudoObj_OleObj_Update(LPOLEOBJECT lpThis);
                    667: STDMETHODIMP PseudoObj_OleObj_IsUpToDate(LPOLEOBJECT lpThis);
                    668: STDMETHODIMP PseudoObj_OleObj_GetUserClassID(
                    669:                LPOLEOBJECT                             lpThis, 
                    670:                LPCLSID                                 lpclsid
                    671: );
                    672: STDMETHODIMP PseudoObj_OleObj_GetUserType(
                    673:                LPOLEOBJECT             lpThis,
                    674:                DWORD                                   dwFormOfType, 
                    675:                LPSTR FAR*                              lpszUserType
                    676: );
                    677: STDMETHODIMP PseudoObj_OleObj_SetExtent(
                    678:                LPOLEOBJECT                             lpThis,
                    679:                DWORD                                   dwDrawAspect,
                    680:                LPSIZEL                                 lplgrc
                    681: );
                    682: STDMETHODIMP PseudoObj_OleObj_GetExtent(
                    683:                LPOLEOBJECT                             lpThis,
                    684:                DWORD                                   dwDrawAspect,
                    685:                LPSIZEL                                 lplgrc
                    686: );
                    687: STDMETHODIMP PseudoObj_OleObj_Advise(
                    688:                LPOLEOBJECT lpThis, 
                    689:                LPADVISESINK lpAdvSink, 
                    690:                LPDWORD lpdwConnection
                    691: );
                    692: STDMETHODIMP PseudoObj_OleObj_Unadvise(LPOLEOBJECT lpThis,DWORD dwConnection);
                    693: STDMETHODIMP PseudoObj_OleObj_EnumAdvise(
                    694:                LPOLEOBJECT lpThis, 
                    695:                LPENUMSTATDATA FAR* lplpenumAdvise
                    696: );
                    697: STDMETHODIMP PseudoObj_OleObj_GetMiscStatus(
                    698:                LPOLEOBJECT             lpThis,
                    699:                DWORD                                   dwAspect,
                    700:                DWORD FAR*                              lpdwStatus
                    701: );
                    702: STDMETHODIMP PseudoObj_OleObj_SetColorScheme(
                    703:                LPOLEOBJECT             lpThis,
                    704:                LPLOGPALETTE            lpLogpal
                    705: );
                    706: STDMETHODIMP PseudoObj_OleObj_LockObject(
                    707:                LPOLEOBJECT             lpThis,
                    708:                BOOL                    fLock
                    709: );
                    710: 
                    711: /* PseudoObj::IDataObject methods (functions) */
                    712: STDMETHODIMP PseudoObj_DataObj_QueryInterface (
                    713:                LPDATAOBJECT      lpThis,
                    714:                REFIID            riid,
                    715:                LPVOID FAR*       lplpvObj
                    716: );
                    717: STDMETHODIMP_(ULONG) PseudoObj_DataObj_AddRef(LPDATAOBJECT lpThis);
                    718: STDMETHODIMP_(ULONG) PseudoObj_DataObj_Release (LPDATAOBJECT lpThis);
                    719: STDMETHODIMP PseudoObj_DataObj_GetData (
                    720:                LPDATAOBJECT    lpThis,
                    721:                LPFORMATETC             lpformatetc,
                    722:                LPSTGMEDIUM             lpMedium
                    723: );
                    724: STDMETHODIMP PseudoObj_DataObj_GetDataHere (
                    725:                LPDATAOBJECT    lpThis,
                    726:                LPFORMATETC             lpformatetc,
                    727:                LPSTGMEDIUM             lpMedium
                    728: );
                    729: STDMETHODIMP PseudoObj_DataObj_QueryGetData (
                    730:                LPDATAOBJECT    lpThis,
                    731:                LPFORMATETC             lpformatetc
                    732: );
                    733: STDMETHODIMP PseudoObj_DataObj_GetCanonicalFormatEtc (
                    734:                LPDATAOBJECT    lpThis,
                    735:                LPFORMATETC             lpformatetc,
                    736:                LPFORMATETC             lpformatetcOut
                    737: );
                    738: STDMETHODIMP PseudoObj_DataObj_SetData (
                    739:                LPDATAOBJECT    lpThis,
                    740:                LPFORMATETC             lpformatetc,
                    741:                LPSTGMEDIUM             lpmedium,
                    742:                BOOL                    fRelease
                    743: );
                    744: STDMETHODIMP PseudoObj_DataObj_EnumFormatEtc(
                    745:                LPDATAOBJECT                    lpThis,
                    746:                DWORD                                   dwDirection,
                    747:                LPENUMFORMATETC FAR*    lplpenumFormatEtc
                    748: );
                    749: STDMETHODIMP PseudoObj_DataObj_Advise(
                    750:                LPDATAOBJECT    lpThis,
                    751:                FORMATETC FAR*  lpFormatetc, 
                    752:                DWORD                   advf, 
                    753:                LPADVISESINK    lpAdvSink, 
                    754:                DWORD FAR*              lpdwConnection
                    755: );
                    756: STDMETHODIMP PseudoObj_DataObj_Unadvise(LPDATAOBJECT lpThis, DWORD dwConnection);
                    757: STDMETHODIMP PseudoObj_DataObj_EnumAdvise(
                    758:                LPDATAOBJECT lpThis,
                    759:                LPENUMSTATDATA FAR* lplpenumAdvise
                    760: );
                    761: 
                    762: 
                    763: /*************************************************************************
                    764: ** class SERVERNAMETABLE : OUTLINENAMETABLE
                    765: **    SERVERNAMETABLE class is an extension to the OUTLINENAMETABLE
                    766: **    base class that adds functionallity required to support linking
                    767: **    to ranges (pseudo objects). The name table manages the table of
                    768: **    named selections in the document. Each name table entry has a
                    769: **    string as its key and a starting line index and an ending line
                    770: **    index for the named range. The SERVERNAMETABLE entries, in
                    771: **    addition, maintain a pointer to a PSEUDOOBJ pseudo object if one
                    772: **    has been already allocated. There is always one instance of
                    773: **    SERVERNAMETABLE for each SERVERDOC object created.
                    774: **    The SERVERNAME class inherits all fields from the NAME class.
                    775: **    This inheritance is achieved by including a member variable of
                    776: **    type NAME as the first field in the SERVERNAME 
                    777: **    structure. Thus a pointer to an SERVERNAME object can be cast to be
                    778: **    a pointer to a NAME object.
                    779: *************************************************************************/
                    780: 
                    781: typedef struct tagSERVERNAMETABLE {
                    782:        OUTLINENAMETABLE        m_NameTable;    // we inherit from OUTLINENAMETABLE
                    783: 
                    784:        // ServerNameTable does NOT add any fields
                    785: 
                    786: } SERVERNAMETABLE, FAR* LPSERVERNAMETABLE;
                    787: 
                    788: /* ServerNameTable methods (functions) */
                    789: void ServerNameTable_EditLineUpdate(
                    790:                LPSERVERNAMETABLE               lpServerNameTable, 
                    791:                int                                             nEditIndex
                    792: );
                    793: void ServerNameTable_InformAllPseudoObjectsDocRenamed(
                    794:                LPSERVERNAMETABLE               lpServerNameTable, 
                    795:                LPMONIKER                               lpmkDoc
                    796: );
                    797: void ServerNameTable_InformAllPseudoObjectsDocSaved(
                    798:                LPSERVERNAMETABLE               lpServerNameTable, 
                    799:                LPMONIKER                               lpmkDoc
                    800: );
                    801: void ServerNameTable_SendPendingAdvises(LPSERVERNAMETABLE lpServerNameTable);
                    802: LPPSEUDOOBJ ServerNameTable_GetPseudoObj(
                    803:                LPSERVERNAMETABLE               lpServerNameTable, 
                    804:                LPSTR                                   lpszItem, 
                    805:                LPSERVERDOC                             lpServerDoc
                    806: );
                    807: void ServerNameTable_CloseAllPseudoObjs(LPSERVERNAMETABLE lpServerNameTable);
                    808: 
                    809: 
                    810: #if defined( INPLACE_SVR)
                    811: 
                    812: /* ServerDoc::IOleInPlaceObject methods (functions) */
                    813: 
                    814: STDMETHODIMP SvrDoc_IPObj_QueryInterface(
                    815:                LPOLEINPLACEOBJECT      lpThis,
                    816:                REFIID                          riid,
                    817:                LPVOID FAR *            lplpvObj
                    818: );
                    819: STDMETHODIMP_(ULONG) SvrDoc_IPObj_AddRef(LPOLEINPLACEOBJECT lpThis);
                    820: STDMETHODIMP_(ULONG) SvrDoc_IPObj_Release(LPOLEINPLACEOBJECT lpThis);
                    821: STDMETHODIMP SvrDoc_IPObj_GetWindow(
                    822:                LPOLEINPLACEOBJECT      lpThis,
                    823:                HWND FAR*                       lphwnd
                    824: );
                    825: STDMETHODIMP SvrDoc_IPObj_ContextSensitiveHelp(
                    826:                LPOLEINPLACEOBJECT      lpThis,
                    827:                BOOL                            fEnable
                    828: );
                    829: STDMETHODIMP SvrDoc_IPObj_InPlaceDeactivate(LPOLEINPLACEOBJECT lpThis);
                    830: STDMETHODIMP SvrDoc_IPObj_UIDeactivate(LPOLEINPLACEOBJECT lpThis);
                    831: STDMETHODIMP SvrDoc_IPObj_SetObjectRects(
                    832:                LPOLEINPLACEOBJECT      lpThis,
                    833:                LPCRECT                         lprcPosRect,
                    834:                LPCRECT                         lprcClipRect
                    835: );
                    836: STDMETHODIMP SvrDoc_IPObj_ReactivateAndUndo(LPOLEINPLACEOBJECT lpThis);
                    837: 
                    838: /* ServerDoc::IOleInPlaceActiveObject methods (functions) */
                    839: 
                    840: STDMETHODIMP SvrDoc_IPActiveObj_QueryInterface(
                    841:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    842:                REFIID                                          riidReq,
                    843:                LPVOID FAR *                            lplpUnk 
                    844: );
                    845: STDMETHODIMP_(ULONG) SvrDoc_IPActiveObj_AddRef(
                    846:                LPOLEINPLACEACTIVEOBJECT lpThis
                    847: );
                    848: STDMETHODIMP_(ULONG) SvrDoc_IPActiveObj_Release(
                    849:                LPOLEINPLACEACTIVEOBJECT lpThis
                    850: );
                    851: STDMETHODIMP SvrDoc_IPActiveObj_GetWindow(
                    852:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    853:                HWND FAR*                                       lphwnd
                    854: );
                    855: STDMETHODIMP SvrDoc_IPActiveObj_ContextSensitiveHelp(
                    856:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    857:                BOOL                                            fEnable
                    858: );
                    859: STDMETHODIMP SvrDoc_IPActiveObj_TranslateAccelerator(
                    860:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    861:                LPMSG                                           lpmsg
                    862: );
                    863: STDMETHODIMP SvrDoc_IPActiveObj_OnFrameWindowActivate(
                    864:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    865:                BOOL                                            fActivate
                    866: );
                    867: STDMETHODIMP SvrDoc_IPActiveObj_OnDocWindowActivate(
                    868:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    869:                BOOL                                            fActivate
                    870: );
                    871: STDMETHODIMP SvrDoc_IPActiveObj_ResizeBorder(
                    872:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    873:                LPCRECT                                         lprectBorder,
                    874:                LPOLEINPLACEUIWINDOW            lpIPUiWnd,
                    875:                BOOL                                            fFrameWindow
                    876: );
                    877: STDMETHODIMP SvrDoc_IPActiveObj_EnableModeless(
                    878:                LPOLEINPLACEACTIVEOBJECT        lpThis,
                    879:                BOOL                                            fEnable
                    880: );
                    881: 
                    882: #endif // INPLACE_SVR
                    883: 
                    884: #endif // _SVROUTL_H_

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.