PageRenderTime 45ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/src/PluginInstance.h

http://firefox-mac-pdf.googlecode.com/
C Header | 74 lines | 48 code | 4 blank | 22 comment | 0 complexity | e759fb003c8b8c13df9653c34e1a2e40 MD5 | raw file
  1. /*
  2. * Copyright (c) 2008 Samuel Gross.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. * THE SOFTWARE.
  21. */
  22. #include "npapi.h";
  23. class PDFService;
  24. class PDFPluginShim;
  25. @class SelectionController;
  26. @class PluginPDFView;
  27. @class PluginProgressView;
  28. @interface PluginInstance : NSObject {
  29. IBOutlet PluginPDFView* pluginView;
  30. IBOutlet PluginProgressView* progressView;
  31. PDFView* pdfView;
  32. NSView* parentView;
  33. NPP _npp;
  34. BOOL _attached;
  35. SelectionController* selectionController;
  36. NSMutableArray* _searchResults;
  37. NSString* _plugin_id;
  38. NSString* _url;
  39. NSString* _mimeType;
  40. NSData* _data;
  41. BOOL written;
  42. NSString *path;
  43. PDFPluginShim* _shim;
  44. PDFService* _pdfService;
  45. }
  46. - (BOOL)attached;
  47. - (void)attachToWindow:(NSWindow*)window at:(NSPoint)point;
  48. - (void)dealloc;
  49. - (id)initWithService:(PDFService*)pdfService plugin_id:(NSString*)plugin_id npp:(NPP)npp mimeType:(NSString*)mimeType;
  50. - (void)setProgress:(int)progress total:(int)total;
  51. - (void)downloadFailed;
  52. - (void)findPrevious;
  53. - (void)save;
  54. - (void)setData:(NSData*)data;
  55. - (void)setUrl:(NSString*)url;
  56. - (void)setVisible:(bool)visible;
  57. - (void)print;
  58. - (void)requestFocus;
  59. - (void)updatePreferences;
  60. // plugin shim methods
  61. - (void)copy;
  62. - (int)find:(NSString*)string caseSensitive:(bool)caseSensitive forwards:(bool)forwards;
  63. - (void)findAll:(NSString*)string caseSensitive:(bool)caseSensitive;
  64. - (void)removeHighlights;
  65. - (BOOL)zoom:(int)zoomArg;
  66. @end
  67. @interface PluginInstance (OpenWithFinder)
  68. - (void)openWithFinder;
  69. - (NSData *)convertPostScriptDataSourceToPDF:(NSData *)data;
  70. @end