home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Apps.iso / LighthouseApps / Quantrix-2.3-MIHS / QAPI_ExportHTML-1.6-MIHS / ExportHTML.1.6 / QXExportHtml.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-15  |  3.4 KB  |  144 lines

  1. // 
  2. // Based on the following example from LightHouse:
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. // Copyright 1994-1995 Lighthouse Design, Ltd. All rights reserved.
  5. //
  6. // QXExport.h
  7. //
  8. // THIS CODE IS FOR DEMONSTRATION PURPOSES ONLY!
  9. // You may freely copy, distribute and reuse the code in this example.  
  10. // Lighthouse disclaims any warranty of any kind, expressed or implied, as to 
  11. // its fitness for any particular use.
  12. // This example implements a simple export panel.
  13. //
  14. // NOTE: This example will only work on simple models. It can be improved
  15. // by modifying -exportData:
  16. //
  17. // ^Demonstrates^
  18. //
  19. // - Exporting data
  20. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. //
  22. // QXExportHtml.h
  23. //
  24. // Copyright 1996-1997 Rudolf B. Blazek, Michigan State University. 
  25. // blazek@stt.msu.edu
  26. // All rights reserved.
  27. //
  28. // See the ReadMe.rtf file for details.
  29. //
  30.  
  31. #import <objc/Object.h>
  32. #import <streams/streams.h>
  33. #import <qapi/qapi.h>
  34.  
  35.  
  36. @interface QXExportHtml : Object <QAPIPrincipalClass, QAPISelectionDelegate>
  37. {
  38.     id <QAPIApp> qapiApp;
  39.     NXBundle* bundle;
  40.     NXStream* aStream;
  41.     char **labelsArray;
  42.  
  43.     id    infoPanel;
  44.     id    accessoryView;
  45.     id    rowLabelsSwitch;
  46.     id    colLabelsSwitch;
  47.     id    colorAttribSwitch;
  48.     id    tableBgColorWell;
  49.     id    pageBgColorWell;
  50.     id  equalColorsSwitch;
  51.     id    borderSizeField;
  52.     id    borderSizeSlider;
  53.     id    cellSpacingField;
  54.     id    cellSpacingSlider;
  55.     id    cellPaddingField;
  56.     id    cellPaddingSlider;
  57.     id  headerFontIncreaseField;
  58.     id  headerFontIncreaseSlider;
  59.  
  60.     int lastColorWell;
  61.     int useRowLabels, useColLabels, useColors;
  62.     int prevRow;
  63. }
  64.  
  65. //
  66. // ^QAPIPrincipalClass^ 
  67. //
  68.  
  69. + q_bundleSelected:(NXBundle*)aBundle;
  70.    // Called by ^Quantrix^ when the bundle is loaded or when the menu item
  71.    // defined in 'load.strings' is selected by the user.  The first time it
  72.    // is called, this class creates a static instance and then calls
  73.    // ^menuAction:^.
  74.  
  75. //
  76. // Basic Actions
  77. //
  78.  
  79. - init;
  80.    // Sets up a connection to the ^QAPIApp^ by calling [NXApp delegate].
  81.  
  82. - setBundle:(NXBundle*)aBundle;
  83.    // Stores a reference to 'aBundle'. It need 'aBundle' in order to load its
  84.    // interface file.
  85.  
  86. - menuSelected:sender;
  87.    // Issues a Save Panel, then tries to save the data from the current view.
  88.  
  89. - exportHTMLData:(id <QAPIApp>)anApp;
  90.    // Gets the current view, selects the first and last node in the first
  91.    // category, then begins an iteration.
  92.  
  93.  
  94. //
  95. // Defaults Support
  96. //
  97. - registerDefaults;
  98. - saveDefaults:sender;
  99. - restoreDefaults:sender;
  100. - saveField:aField into:(char*)name;
  101. - restoreField:aField from:(char*)name;
  102. - saveSwitch:aSwitch into:(char*)name;
  103. - restoreSwitch:aSwitch from:(char*)name;
  104. - saveColorWell:aColorWell into:(char*)name;
  105. - restoreColorWell:aColorWell from:(char*)name;
  106.  
  107.  
  108.  
  109. //
  110. // Interface Support
  111. //
  112.  
  113. - loadInterfaceFileFrom:(NXBundle*)aBundle;
  114.    // Loads an interface file named the same as receiver`s class name.
  115.  
  116. - equalColorsOnOff:sender;
  117. - pageColorChanged:sender;
  118. - tableColorChanged:sender;
  119.  
  120.  
  121.  
  122. //
  123. // HTML support
  124. //
  125.  
  126. - (char*)HTMLcolor:(NXColor)theColor;
  127.    // Converts NXColor into HTML compatible string.
  128.  
  129. //
  130. // ^QAPISelectionDelegate^ 
  131. //
  132.  
  133. - (char*)evaluateItem:(id<QAPINode>)anItem in:aSelection;
  134.    // Processes the Item names (columns only so far ...)
  135.  
  136. - (void)q_evaluateCell:(id<QAPICell>)aCell in:aSelection;
  137.    // Appends the cell's data to 'aStream'.
  138.  
  139. - (void)q_evaluateNode:(id<QAPINode>)aNode in:aSelection;
  140.    // Nothing
  141.  
  142. @end
  143.  
  144.