1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1995 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#ifndef __AFXODLGS_H__
#define __AFXODLGS_H__
#ifdef _AFX_NO_OLE_SUPPORT
#error OLE classes not supported in this library variant.
#endif
#ifndef __AFXOLE_H__
#include <afxole.h>
#endif
#ifndef __AFXDLGS_H__
#include <afxdlgs.h>
#endif
#ifdef _MAC
// include OLE dialog/helper APIs
#include <ole2ui.h>
#else
// include OLE dialog/helper APIs
#ifndef _OLEDLG_H_
#include <oledlg.h>
#endif
#endif
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif
#ifndef _AFX_FULLTYPEINFO
#pragma component(mintypeinfo, on)
#endif
#ifdef _AFX_PACKING
#pragma pack(push, _AFX_PACKING)
#endif
/////////////////////////////////////////////////////////////////////////////
// AFXODLGS.H - MFC OLE dialogs
// Classes declared in this file
//CCommonDialog
class COleDialog; // base class for OLE dialog wrappers
class COleInsertDialog; // insert object dialog
class COleConvertDialog; // convert dialog
class COleChangeIconDialog; // change icon dialog
class COlePasteSpecialDialog; // paste special dialog
class COleLinksDialog; // edit links dialog
class COleUpdateDialog; // update links/embeddings dialog
class COleBusyDialog; // used for
class COlePropertiesDialog;
class COleChangeSourceDialog;
/////////////////////////////////////////////////////////////////////////////
// AFXDLL support
#undef AFX_DATA
#define AFX_DATA AFX_OLE_DATA
/////////////////////////////////////////////////////////////////////////////
// COleUILinkInfo -- used internally to implement
// IOleUILinkInfo and IOleUILinkContainer
// used by COleLinksDialog and COleChangeSourceDialog
class COleUILinkInfo : public IOleUILinkInfo
{
public:
COleUILinkInfo(COleDocument* pDocument);
// Implementation
COleDocument* m_pDocument; // document being manipulated
COleClientItem* m_pSelectedItem; // primary selected item in m_pDocument
POSITION m_pos; // used during link enumeration
BOOL m_bUpdateLinks; // update links?
BOOL m_bUpdateEmbeddings; // update embeddings?
STDMETHOD_(ULONG, AddRef)();
STDMETHOD_(ULONG, Release)();
STDMETHOD(QueryInterface)(REFIID, LPVOID*);
// IOleUILinkContainer
STDMETHOD_(DWORD,GetNextLink)(DWORD);
STDMETHOD(SetLinkUpdateOptions)(DWORD, DWORD);
STDMETHOD(GetLinkUpdateOptions)(DWORD, LPDWORD);
STDMETHOD(SetLinkSource)(DWORD, LPTSTR, ULONG, ULONG*, BOOL);
STDMETHOD(GetLinkSource)(DWORD, LPTSTR*, ULONG*, LPTSTR*, LPTSTR*, BOOL*,
BOOL*);
STDMETHOD(OpenLinkSource)(DWORD);
STDMETHOD(UpdateLink)(DWORD, BOOL, BOOL);
STDMETHOD(CancelLink)(DWORD);
// IOleUILinkInfo
STDMETHOD(GetLastUpdate)(DWORD dwLink, FILETIME* lpLastUpdate);
};
/////////////////////////////////////////////////////////////////////////////
// Wrappers for OLE UI dialogs
class COleDialog : public CCommonDialog
{
DECLARE_DYNAMIC(COleDialog)
// Attributes
public:
UINT GetLastError() const;
// Implementation
public:
int MapResult(UINT nResult);
COleDialog(CWnd* pParentWnd);
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
UINT m_nLastError;
protected:
friend UINT CALLBACK _AfxOleHookProc(HWND, UINT, WPARAM, LPARAM);
};
/////////////////////////////////////////////////////////////////////////////
// COleInsertDialog
class COleInsertDialog : public COleDialog
{
DECLARE_DYNAMIC(COleInsertDialog)
// Attributes
public:
OLEUIINSERTOBJECT m_io; // structure for OleUIInsertObject
// Constructors
COleInsertDialog(DWORD dwFlags = IOF_SELECTCREATENEW,
CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
BOOL CreateItem(COleClientItem* pItem);
// call after DoModal to create item based on dialog data
// Attributes (after DoModal returns IDOK)
enum Selection { createNewItem, insertFromFile, linkToFile };
UINT GetSelectionType() const;
// return type of selection made
CString GetPathName() const; // return full path name
REFCLSID GetClassID() const; // get class ID of new item
DVASPECT GetDrawAspect() const;
// DVASPECT_CONTENT or DVASPECT_ICON
HGLOBAL GetIconicMetafile() const;
// returns HGLOBAL to METAFILEPICT struct with iconic data
// Implementation
public:
virtual ~COleInsertDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
TCHAR m_szFileName[_MAX_PATH];
// contains full path name after return
};
/////////////////////////////////////////////////////////////////////////////
// COleConvertDialog
class COleConvertDialog : public COleDialog
{
DECLARE_DYNAMIC(COleConvertDialog)
// Attributes
public:
OLEUICONVERT m_cv; // structure for OleUIConvert
// Constructors
COleConvertDialog(COleClientItem* pItem,
DWORD dwFlags = CF_SELECTCONVERTTO, CLSID* pClassID = NULL,
CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
// just display the dialog and collect convert info
BOOL DoConvert(COleClientItem* pItem);
// do the conversion on pItem (after DoModal == IDOK)
// Attributes (after DoModal returns IDOK)
enum Selection { noConversion, convertItem, activateAs };
UINT GetSelectionType() const;
HGLOBAL GetIconicMetafile() const; // will return NULL if same as before
REFCLSID GetClassID() const; // get class ID to convert or activate as
DVASPECT GetDrawAspect() const; // get new draw aspect
// Implementation
public:
virtual ~COleConvertDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
};
/////////////////////////////////////////////////////////////////////////////
// COleChangeIconDialog
class COleChangeIconDialog : public COleDialog
{
DECLARE_DYNAMIC(COleChangeIconDialog)
// Attributes
public:
OLEUICHANGEICON m_ci; // structure for OleUIChangeIcon
// Constructors
COleChangeIconDialog(COleClientItem* pItem,
DWORD dwFlags = CIF_SELECTCURRENT,
CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
BOOL DoChangeIcon(COleClientItem* pItem);
// Attributes
HGLOBAL GetIconicMetafile() const;
// Implementation
public:
virtual ~COleChangeIconDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
};
/////////////////////////////////////////////////////////////////////////////
// COlePasteSpecialDialog
class COlePasteSpecialDialog : public COleDialog
{
DECLARE_DYNAMIC(COlePasteSpecialDialog)
// Attributes
public:
OLEUIPASTESPECIAL m_ps; // structure for OleUIPasteSpecial
// Constructors
COlePasteSpecialDialog(DWORD dwFlags = PSF_SELECTPASTE,
COleDataObject* pDataObject = NULL, CWnd *pParentWnd = NULL);
// Operations
OLEUIPASTEFLAG AddLinkEntry(UINT cf);
void AddFormat(const FORMATETC& formatEtc, LPTSTR lpszFormat,
LPTSTR lpszResult, DWORD flags);
void AddFormat(UINT cf, DWORD tymed, UINT nFormatID, BOOL bEnableIcon,
BOOL bLink);
void AddStandardFormats(BOOL bEnableLink = TRUE);
virtual int DoModal();
BOOL CreateItem(COleClientItem *pNewItem);
// creates a standard OLE item from selection data
// Attributes (after DoModal returns IDOK)
int GetPasteIndex() const; // resulting index to use for paste
enum Selection { pasteLink = 1, pasteNormal = 2, pasteStatic = 3, pasteOther = 4};
UINT GetSelectionType() const;
// get selection type (pasteLink, pasteNormal, pasteStatic)
DVASPECT GetDrawAspect() const;
// DVASPECT_CONTENT or DVASPECT_ICON
HGLOBAL GetIconicMetafile() const;
// returns HGLOBAL to METAFILEPICT struct with iconic data
// Implementation
public:
virtual ~COlePasteSpecialDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
unsigned int m_arrLinkTypes[8];
// size limit imposed by MFCUIx32.DLL library
};
/////////////////////////////////////////////////////////////////////////////
// COleLinksDialog
class COleLinksDialog : public COleDialog
{
DECLARE_DYNAMIC(COleLinksDialog)
// Attributes
public:
OLEUIEDITLINKS m_el; // structure for OleUIEditLinks
// Constructors
COleLinksDialog(COleDocument* pDoc, CView* pView, DWORD dwFlags = 0,
CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal(); // display the dialog and edit links
// Implementation
public:
virtual ~COleLinksDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
public:
COleUILinkInfo m_xLinkInfo; // implements IOleUILinkContainer
};
/////////////////////////////////////////////////////////////////////////////
// COleUpdateDialog
class COleUpdateDialog : public COleLinksDialog
{
DECLARE_DYNAMIC(COleUpdateDialog)
// Constructors
public:
COleUpdateDialog(COleDocument* pDoc,
BOOL bUpdateLinks = TRUE, BOOL bUpdateEmbeddings = FALSE,
CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
// Implementation
public:
virtual ~COleUpdateDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
CString m_strCaption; // caption for the dialog
};
/////////////////////////////////////////////////////////////////////////////
// COleBusyDialog - useful in managing concurrency
class COleBusyDialog : public COleDialog
{
DECLARE_DYNAMIC(COleBusyDialog)
// Attributes
public:
OLEUIBUSY m_bz;
// Constructors
COleBusyDialog(HTASK htaskBusy, BOOL bNotResponding = FALSE,
DWORD dwFlags = 0, CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
enum Selection { switchTo = 1, retry = 2, callUnblocked = 3 };
UINT GetSelectionType() const;
// Implementation
public:
~COleBusyDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
Selection m_selection; // selection after DoModal returns IDOK
};
/////////////////////////////////////////////////////////////////////////////
// COleEditProperties
class COlePropertiesDialog : public COleDialog
{
DECLARE_DYNAMIC(COlePropertiesDialog)
// Attributes
public:
OLEUIOBJECTPROPS m_op; // structure for OleUIObjectProperties
OLEUIGNRLPROPS m_gp; // specific to "General" page
OLEUIVIEWPROPS m_vp; // specific to "View" page
OLEUILINKPROPS m_lp; // specific to "Link" page
PROPSHEETHEADER m_psh; // PROPSHEETHEADER for customization
// Constructors
public:
COlePropertiesDialog(COleClientItem* pItem,
UINT nScaleMin = 10, UINT nScaleMax = 500, CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
// Overridables
virtual BOOL OnApplyScale(
COleClientItem* pItem, int nCurrentScale, BOOL bRelativeToOrig);
// Implementation
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
virtual BOOL OnInitDialog();
BEGIN_INTERFACE_PART(OleUIObjInfo, IOleUIObjInfo)
INIT_INTERFACE_PART(COlePropertiesDialog, OleUIObjInfo)
STDMETHOD(GetObjectInfo) (THIS_ DWORD dwObject,
DWORD* lpdwObjSize, LPTSTR* lplpszLabel,
LPTSTR* lplpszType, LPTSTR* lplpszShortType,
LPTSTR* lplpszLocation);
STDMETHOD(GetConvertInfo) (THIS_ DWORD dwObject,
CLSID* lpClassID, WORD* lpwFormat,
CLSID* lpConvertDefaultClassID,
LPCLSID* lplpClsidExclude, UINT* lpcClsidExclude);
STDMETHOD(ConvertObject) (THIS_ DWORD dwObject, REFCLSID clsidNew);
STDMETHOD(GetViewInfo) (THIS_ DWORD dwObject,
HGLOBAL* phMetaPict, DWORD* pdvAspect, int* pnCurrentScale);
STDMETHOD(SetViewInfo) (THIS_ DWORD dwObject,
HGLOBAL hMetaPict, DWORD dvAspect,
int nCurrentScale, BOOL bRelativeToOrig);
END_INTERFACE_PART(OleUIObjInfo)
COleUILinkInfo m_xLinkInfo; // implements IOleUILinkContainer
};
/////////////////////////////////////////////////////////////////////////////
// COleChangeSourceDialog
class COleChangeSourceDialog : public COleDialog
{
DECLARE_DYNAMIC(COleChangeSourceDialog)
// Attributes
public:
OLEUICHANGESOURCE m_cs; // structure for OleUIChangeSource
// Constructors
public:
COleChangeSourceDialog(COleClientItem* pItem, CWnd* pParentWnd = NULL);
// Operations
virtual int DoModal();
// Attributes (after DoModal returns IDOK)
BOOL IsValidSource();
CString GetDisplayName();
CString GetFileName();
CString GetItemName();
CString GetFromPrefix();
CString GetToPrefix();
// Implementation
public:
COleUILinkInfo m_xLinkInfo;
virtual ~COleChangeSourceDialog();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
virtual void PreInitDialog();
};
/////////////////////////////////////////////////////////////////////////////
// Inline function declarations
#ifdef _AFX_PACKING
#pragma pack(pop)
#endif
#ifdef _AFX_ENABLE_INLINES
#define _AFXODLGS_INLINE inline
#include <afxole.inl>
#undef _AFXODLGS_INLINE
#endif
#undef AFX_DATA
#define AFX_DATA
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, on)
#endif
#ifndef _AFX_FULLTYPEINFO
#pragma component(mintypeinfo, off)
#endif
#endif //__AFXODLGS_H__
/////////////////////////////////////////////////////////////////////////////
|