Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

560 lines
13 KiB

  1. /*
  2. File: PMApplication.h
  3. Contains: Carbon Printing Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1998-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __PMAPPLICATION__
  11. #define __PMAPPLICATION__
  12. #ifndef __PMCORE__
  13. #include <PMCore.h>
  14. #endif
  15. #ifndef __DIALOGS__
  16. #include <Dialogs.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. /* Callbacks */
  28. typedef CALLBACK_API( void , PMItemProcPtr )(DialogRef theDialog, short item);
  29. typedef CALLBACK_API( void , PMPrintDialogInitProcPtr )(PMPrintSettings printSettings, PMDialog *theDialog);
  30. typedef CALLBACK_API( void , PMPageSetupDialogInitProcPtr )(PMPageFormat pageFormat, PMDialog *theDialog);
  31. typedef CALLBACK_API( void , PMSheetDoneProcPtr )(PMPrintSession printSession, WindowRef documentWindow, Boolean accepted);
  32. typedef STACK_UPP_TYPE(PMItemProcPtr) PMItemUPP;
  33. typedef STACK_UPP_TYPE(PMPrintDialogInitProcPtr) PMPrintDialogInitUPP;
  34. typedef STACK_UPP_TYPE(PMPageSetupDialogInitProcPtr) PMPageSetupDialogInitUPP;
  35. typedef STACK_UPP_TYPE(PMSheetDoneProcPtr) PMSheetDoneUPP;
  36. /*
  37. * NewPMItemUPP()
  38. *
  39. * Availability:
  40. * Non-Carbon CFM: not available
  41. * CarbonLib: in CarbonLib 1.0 and later
  42. * Mac OS X: in version 10.0 and later
  43. */
  44. EXTERN_API_C( PMItemUPP )
  45. NewPMItemUPP(PMItemProcPtr userRoutine);
  46. /*
  47. * NewPMPrintDialogInitUPP()
  48. *
  49. * Availability:
  50. * Non-Carbon CFM: not available
  51. * CarbonLib: in CarbonLib 1.0 and later
  52. * Mac OS X: in version 10.0 and later
  53. */
  54. EXTERN_API_C( PMPrintDialogInitUPP )
  55. NewPMPrintDialogInitUPP(PMPrintDialogInitProcPtr userRoutine);
  56. /*
  57. * NewPMPageSetupDialogInitUPP()
  58. *
  59. * Availability:
  60. * Non-Carbon CFM: not available
  61. * CarbonLib: in CarbonLib 1.0 and later
  62. * Mac OS X: in version 10.0 and later
  63. */
  64. EXTERN_API_C( PMPageSetupDialogInitUPP )
  65. NewPMPageSetupDialogInitUPP(PMPageSetupDialogInitProcPtr userRoutine);
  66. /*
  67. * NewPMSheetDoneUPP()
  68. *
  69. * Availability:
  70. * Non-Carbon CFM: not available
  71. * CarbonLib: in CarbonLib 1.1 and later
  72. * Mac OS X: in version 10.0 and later
  73. */
  74. EXTERN_API_C( PMSheetDoneUPP )
  75. NewPMSheetDoneUPP(PMSheetDoneProcPtr userRoutine);
  76. /*
  77. * DisposePMItemUPP()
  78. *
  79. * Availability:
  80. * Non-Carbon CFM: not available
  81. * CarbonLib: in CarbonLib 1.0 and later
  82. * Mac OS X: in version 10.0 and later
  83. */
  84. EXTERN_API_C( void )
  85. DisposePMItemUPP(PMItemUPP userUPP);
  86. /*
  87. * DisposePMPrintDialogInitUPP()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: not available
  91. * CarbonLib: in CarbonLib 1.0 and later
  92. * Mac OS X: in version 10.0 and later
  93. */
  94. EXTERN_API_C( void )
  95. DisposePMPrintDialogInitUPP(PMPrintDialogInitUPP userUPP);
  96. /*
  97. * DisposePMPageSetupDialogInitUPP()
  98. *
  99. * Availability:
  100. * Non-Carbon CFM: not available
  101. * CarbonLib: in CarbonLib 1.0 and later
  102. * Mac OS X: in version 10.0 and later
  103. */
  104. EXTERN_API_C( void )
  105. DisposePMPageSetupDialogInitUPP(PMPageSetupDialogInitUPP userUPP);
  106. /*
  107. * DisposePMSheetDoneUPP()
  108. *
  109. * Availability:
  110. * Non-Carbon CFM: not available
  111. * CarbonLib: in CarbonLib 1.1 and later
  112. * Mac OS X: in version 10.0 and later
  113. */
  114. EXTERN_API_C( void )
  115. DisposePMSheetDoneUPP(PMSheetDoneUPP userUPP);
  116. /*
  117. * InvokePMItemUPP()
  118. *
  119. * Availability:
  120. * Non-Carbon CFM: not available
  121. * CarbonLib: in CarbonLib 1.0 and later
  122. * Mac OS X: in version 10.0 and later
  123. */
  124. EXTERN_API_C( void )
  125. InvokePMItemUPP(
  126. DialogRef theDialog,
  127. short item,
  128. PMItemUPP userUPP);
  129. /*
  130. * InvokePMPrintDialogInitUPP()
  131. *
  132. * Availability:
  133. * Non-Carbon CFM: not available
  134. * CarbonLib: in CarbonLib 1.0 and later
  135. * Mac OS X: in version 10.0 and later
  136. */
  137. EXTERN_API_C( void )
  138. InvokePMPrintDialogInitUPP(
  139. PMPrintSettings printSettings,
  140. PMDialog * theDialog,
  141. PMPrintDialogInitUPP userUPP);
  142. /*
  143. * InvokePMPageSetupDialogInitUPP()
  144. *
  145. * Availability:
  146. * Non-Carbon CFM: not available
  147. * CarbonLib: in CarbonLib 1.0 and later
  148. * Mac OS X: in version 10.0 and later
  149. */
  150. EXTERN_API_C( void )
  151. InvokePMPageSetupDialogInitUPP(
  152. PMPageFormat pageFormat,
  153. PMDialog * theDialog,
  154. PMPageSetupDialogInitUPP userUPP);
  155. /*
  156. * InvokePMSheetDoneUPP()
  157. *
  158. * Availability:
  159. * Non-Carbon CFM: not available
  160. * CarbonLib: in CarbonLib 1.1 and later
  161. * Mac OS X: in version 10.0 and later
  162. */
  163. EXTERN_API_C( void )
  164. InvokePMSheetDoneUPP(
  165. PMPrintSession printSession,
  166. WindowRef documentWindow,
  167. Boolean accepted,
  168. PMSheetDoneUPP userUPP);
  169. #if PM_USE_SESSION_APIS
  170. #else
  171. /* Print loop */
  172. /*
  173. * PMBeginDocument()
  174. *
  175. * Availability:
  176. * Non-Carbon CFM: not available
  177. * CarbonLib: in CarbonLib 1.0 and later
  178. * Mac OS X: in version 10.0 and later
  179. */
  180. EXTERN_API( OSStatus )
  181. PMBeginDocument(
  182. PMPrintSettings printSettings,
  183. PMPageFormat pageFormat,
  184. PMPrintContext * printContext);
  185. /*
  186. * PMEndDocument()
  187. *
  188. * Availability:
  189. * Non-Carbon CFM: not available
  190. * CarbonLib: in CarbonLib 1.0 and later
  191. * Mac OS X: in version 10.0 and later
  192. */
  193. EXTERN_API( OSStatus )
  194. PMEndDocument(PMPrintContext printContext);
  195. /*
  196. * PMBeginPage()
  197. *
  198. * Availability:
  199. * Non-Carbon CFM: not available
  200. * CarbonLib: in CarbonLib 1.0 and later
  201. * Mac OS X: in version 10.0 and later
  202. */
  203. EXTERN_API( OSStatus )
  204. PMBeginPage(
  205. PMPrintContext printContext,
  206. const PMRect * pageFrame);
  207. /*
  208. * PMEndPage()
  209. *
  210. * Availability:
  211. * Non-Carbon CFM: not available
  212. * CarbonLib: in CarbonLib 1.0 and later
  213. * Mac OS X: in version 10.0 and later
  214. */
  215. EXTERN_API( OSStatus )
  216. PMEndPage(PMPrintContext printContext);
  217. /* Printing Dialogs */
  218. /*
  219. * PMPageSetupDialog()
  220. *
  221. * Availability:
  222. * Non-Carbon CFM: not available
  223. * CarbonLib: in CarbonLib 1.0 and later
  224. * Mac OS X: in version 10.0 and later
  225. */
  226. EXTERN_API( OSStatus )
  227. PMPageSetupDialog(
  228. PMPageFormat pageFormat,
  229. Boolean * accepted);
  230. /*
  231. * PMPrintDialog()
  232. *
  233. * Availability:
  234. * Non-Carbon CFM: not available
  235. * CarbonLib: in CarbonLib 1.0 and later
  236. * Mac OS X: in version 10.0 and later
  237. */
  238. EXTERN_API( OSStatus )
  239. PMPrintDialog(
  240. PMPrintSettings printSettings,
  241. PMPageFormat constPageFormat,
  242. Boolean * accepted);
  243. /*
  244. * PMPageSetupDialogInit()
  245. *
  246. * Availability:
  247. * Non-Carbon CFM: not available
  248. * CarbonLib: in CarbonLib 1.0 and later
  249. * Mac OS X: in version 10.0 and later
  250. */
  251. EXTERN_API( OSStatus )
  252. PMPageSetupDialogInit(
  253. PMPageFormat pageFormat,
  254. PMDialog * newDialog);
  255. /************************/
  256. /* PMPrintDialogInit is not recommended. You should instead use */
  257. /* PMPrintDialogInitWithPageFormat or PMSessionPrintDialogInit */
  258. /************************/
  259. /*
  260. * PMPrintDialogInit()
  261. *
  262. * Availability:
  263. * Non-Carbon CFM: not available
  264. * CarbonLib: in CarbonLib 1.0 and later
  265. * Mac OS X: in version 10.0 and later
  266. */
  267. EXTERN_API( OSStatus )
  268. PMPrintDialogInit(
  269. PMPrintSettings printSettings,
  270. PMDialog * newDialog);
  271. /*
  272. * PMPrintDialogInitWithPageFormat()
  273. *
  274. * Availability:
  275. * Non-Carbon CFM: not available
  276. * CarbonLib: in CarbonLib 1.1 and later
  277. * Mac OS X: in version 10.0 and later
  278. */
  279. EXTERN_API( OSStatus )
  280. PMPrintDialogInitWithPageFormat(
  281. PMPrintSettings printSettings,
  282. PMPageFormat constPageFormat,
  283. PMDialog * newDialog);
  284. /*
  285. * PMPrintDialogMain()
  286. *
  287. * Availability:
  288. * Non-Carbon CFM: not available
  289. * CarbonLib: in CarbonLib 1.0 and later
  290. * Mac OS X: in version 10.0 and later
  291. */
  292. EXTERN_API( OSStatus )
  293. PMPrintDialogMain(
  294. PMPrintSettings printSettings,
  295. PMPageFormat constPageFormat,
  296. Boolean * accepted,
  297. PMPrintDialogInitUPP myInitProc);
  298. /*
  299. * PMPageSetupDialogMain()
  300. *
  301. * Availability:
  302. * Non-Carbon CFM: not available
  303. * CarbonLib: in CarbonLib 1.0 and later
  304. * Mac OS X: in version 10.0 and later
  305. */
  306. EXTERN_API( OSStatus )
  307. PMPageSetupDialogMain(
  308. PMPageFormat pageFormat,
  309. Boolean * accepted,
  310. PMPageSetupDialogInitUPP myInitProc);
  311. #endif /* PM_USE_SESSION_APIS */
  312. /* Printing Dialog accessors */
  313. /*
  314. * PMGetDialogPtr()
  315. *
  316. * Availability:
  317. * Non-Carbon CFM: not available
  318. * CarbonLib: in CarbonLib 1.0 and later
  319. * Mac OS X: in version 10.0 and later
  320. */
  321. EXTERN_API( OSStatus )
  322. PMGetDialogPtr(
  323. PMDialog pmDialog,
  324. DialogRef * theDialog);
  325. #define PMGetDialogRef PMGetDialogPtr
  326. /*
  327. * PMGetModalFilterProc()
  328. *
  329. * Availability:
  330. * Non-Carbon CFM: not available
  331. * CarbonLib: in CarbonLib 1.0 and later
  332. * Mac OS X: in version 10.0 and later
  333. */
  334. EXTERN_API( OSStatus )
  335. PMGetModalFilterProc(
  336. PMDialog pmDialog,
  337. ModalFilterUPP * filterProc);
  338. /*
  339. * PMSetModalFilterProc()
  340. *
  341. * Availability:
  342. * Non-Carbon CFM: not available
  343. * CarbonLib: in CarbonLib 1.0 and later
  344. * Mac OS X: in version 10.0 and later
  345. */
  346. EXTERN_API( OSStatus )
  347. PMSetModalFilterProc(
  348. PMDialog pmDialog,
  349. ModalFilterUPP filterProc);
  350. /*
  351. * PMGetItemProc()
  352. *
  353. * Availability:
  354. * Non-Carbon CFM: not available
  355. * CarbonLib: in CarbonLib 1.0 and later
  356. * Mac OS X: in version 10.0 and later
  357. */
  358. EXTERN_API( OSStatus )
  359. PMGetItemProc(
  360. PMDialog pmDialog,
  361. PMItemUPP * itemProc);
  362. /*
  363. * PMSetItemProc()
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: not available
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. */
  370. EXTERN_API( OSStatus )
  371. PMSetItemProc(
  372. PMDialog pmDialog,
  373. PMItemUPP itemProc);
  374. /*
  375. * PMGetDialogAccepted()
  376. *
  377. * Availability:
  378. * Non-Carbon CFM: not available
  379. * CarbonLib: in CarbonLib 1.0 and later
  380. * Mac OS X: in version 10.0 and later
  381. */
  382. EXTERN_API( OSStatus )
  383. PMGetDialogAccepted(
  384. PMDialog pmDialog,
  385. Boolean * process);
  386. /*
  387. * PMSetDialogAccepted()
  388. *
  389. * Availability:
  390. * Non-Carbon CFM: not available
  391. * CarbonLib: in CarbonLib 1.0 and later
  392. * Mac OS X: in version 10.0 and later
  393. */
  394. EXTERN_API( OSStatus )
  395. PMSetDialogAccepted(
  396. PMDialog pmDialog,
  397. Boolean process);
  398. /*
  399. * PMGetDialogDone()
  400. *
  401. * Availability:
  402. * Non-Carbon CFM: not available
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Mac OS X: in version 10.0 and later
  405. */
  406. EXTERN_API( OSStatus )
  407. PMGetDialogDone(
  408. PMDialog pmDialog,
  409. Boolean * done);
  410. /*
  411. * PMSetDialogDone()
  412. *
  413. * Availability:
  414. * Non-Carbon CFM: not available
  415. * CarbonLib: in CarbonLib 1.0 and later
  416. * Mac OS X: in version 10.0 and later
  417. */
  418. EXTERN_API( OSStatus )
  419. PMSetDialogDone(
  420. PMDialog pmDialog,
  421. Boolean done);
  422. /* Presets */
  423. /*
  424. * PMSessionEnablePrinterPresets()
  425. *
  426. * Summary:
  427. * Enable the use of printer presets in the print dialog.
  428. *
  429. * Discussion:
  430. * Displaying the print dialog on a session after making this call
  431. * will show the presets available for the specified graphis type.
  432. * In addition this call will enable the use of the simplified print
  433. * dialog. On OS 9 this function returns kPMNotImplemented.
  434. *
  435. * Parameters:
  436. *
  437. * session:
  438. * The session that will be used to present the print dialog.
  439. *
  440. * graphicsType:
  441. * The printer presets in the dialog should be suitable for
  442. * rendering this type of graphic. Currently defined graphics
  443. * types are: "Photo"
  444. *
  445. * Availability:
  446. * Non-Carbon CFM: not available
  447. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  448. * Mac OS X: in version 10.2 and later
  449. */
  450. EXTERN_API( OSStatus )
  451. PMSessionEnablePrinterPresets(
  452. PMPrintSession session,
  453. CFStringRef graphicsType);
  454. /*
  455. * PMSessionDisablePrinterPresets()
  456. *
  457. * Summary:
  458. * Disable the use of printer presets in the print dialog.
  459. *
  460. * Discussion:
  461. * On OS 9 this function returns noErr since presets are never used
  462. * in that OS.
  463. *
  464. * Parameters:
  465. *
  466. * session:
  467. * The session that will be used to present the print dialog.
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: not available
  471. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  472. * Mac OS X: in version 10.2 and later
  473. */
  474. EXTERN_API( OSStatus )
  475. PMSessionDisablePrinterPresets(PMPrintSession session);
  476. #ifdef PRAGMA_IMPORT_OFF
  477. #pragma import off
  478. #elif PRAGMA_IMPORT
  479. #pragma import reset
  480. #endif
  481. #ifdef __cplusplus
  482. }
  483. #endif
  484. #endif /* __PMAPPLICATION__ */