OOFILE  1.9
oofrep1.cpp
Go to the documentation of this file.
1 // COPYRIGHT 1996 A.D. Software, All rights reserved
2 
3 // report-writer layer of OOFILE database
4 
5  #include "oofpch_r.h" // for precompilation of report files
6 
7 #ifndef H_OOF3
8  #include "oof3.h"
9 #endif
10 #ifndef H_OOFREP
11  #include "oofrep.h"
12 #endif
13 #ifndef _STRING
14  #include <string.h>
15 #endif
16 #ifndef H_OOFGRPHS
17  #include "oofGrphs.h"
18 #endif
19 #ifndef H_OOFIOS
20  #include "oofios.h"
21 #endif
22 #ifndef H_OOFREPREND
23  #include "oofreprn.h" // abstract renderers
24 #endif
25 #ifndef H_OOFREPEDITOR
26  #include "oofrepeditor.h"
27 #endif
28 
29 #ifdef OOF_MEM_DEBUG_LAST_INCLUDE
30  #include OOF_MEM_DEBUG_LAST_INCLUDE
31 #endif
32 
33 #ifndef OOF_NO_STDLIB
34  #ifndef std
35  using namespace std;
36  #endif
37 #endif
38 
39 
41 oofRepLayoutBand* oofRepLayoutBand::sCurrentLayout;
42 
43 
44 
45 
46 // -------------------------------------------------------
47 // O O F _ r e p M a k e R e n d e r V i s i t o r
48 // -------------------------------------------------------
54 public:
56  mEnv(inEnv)
57  {};
58 
59 protected:
60  virtual void VisitDrawable(oofRepDrawable*);
61  virtual void VisitAdorner(oofAdorner*);
62 
63 private:
64  oofRepEnvironment& mEnv;
65 };
66 
67 
68 void
70 {
71  VisitAdornerList(inDrawable->adorners());
72  mEnv.makeRenderDispatch(inDrawable);
73 }
74 
75 
76 void
78 {
79  mEnv.makeRenderDispatch(inAdorner);
80 }
81 
82 
83 // -------------------------------------------------------
84 // O O F _ r e p F i n i s h C o n s t r u c t i o n V i s i t o r
85 // -------------------------------------------------------
91 protected:
92  virtual void VisitBandList(oofRepBandList&);
93  virtual void VisitDrawable(oofRepDrawable*);
94 };
95 
96 
97 void
99 {
100  inDrawable->finishConstruction();
101 }
102 
103 
104 void
106 {
107  oofRepVisitor::VisitBandList(inBands); // must be AFTER bands finished, eg: calc fixed height
108  inBands.finishConstruction();
109 }
110 
111 
112 
113 // -------------------------------------------------------
114 // O O F _ r e p B u f f e r S e t t i n g V i s i t o r
115 // -------------------------------------------------------
119 void
121 {
122  dbTable* viewTable = inView->table();
123  if (viewTable) {
124  if (mSettingBufferForever)
126  else { // reset
127  if (viewTable->isRelatedClone())
129  else
131  }
132  }
133 // now iterate all fields in case any of them point to related tables
134 // which also require their save option changing
135  const unsigned int numFields = inView->count();
136  const dbTable::saveOptionsT newOption = mSettingBufferForever ?
138  dbTable::requireExplicitAndBuffer; // if not setting, assume all related
139 
140  for (unsigned int col=0; col<numFields; col++) { // start field iteration (horizontal)
141  dbTable* fieldTable = inView->field(col).fieldTable();
142  if (fieldTable && fieldTable!=viewTable)
143  fieldTable->setSaveOption(newOption);
144  } // loop all fields
145 }
146 
147 
148 // -------------------------------------------------------
149 // o o f R e p S c h e m a V i s i t o r
150 // -------------------------------------------------------
151 void
153 {
154  for (unsigned short i=0;; i++) {
155  dbView* theView = inDrawable->view(i); // drawables can have multiple views
156  if (theView)
157  VisitView(theView);
158  else
159  break;
160  }
161 }
162 
163 
164 
165 // -------------------------------------------------------
166 // o o f R e p D a t a
167 // -------------------------------------------------------
175 public:
176  oofRepData(dbView&);
177  oofRepData(dbView*);
179  virtual ~oofRepData();
180  void InitRepData(dbTable*);
181 
182  virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined);
183 
184  void useRepContext();
185  void restoreDataSelection();
186 
187 private:
188  OOF_Selection* mRepSelection; // owned
189  OOF_Selection* mSavedSelection; // owned
190  dbTable* mTable; // reference, may be nil
191  unsigned long mSavedRecNo; // until bug in setSelection fixed
192 };
193 
194 
196 {
197  InitRepData(inView.table());
198 }
199 
200 
202 {
203  InitRepData(inView->table());
204 }
205 
206 
208 {
209  InitRepData(inTable);
210 }
211 
212 
214 {
215  delete mSavedSelection;
216  delete mRepSelection;
217 }
218 
219 
220 bool
221 oofRepData::receiveMsg(OOFmsgT msg, unsigned long /*senderDefined*/)
222 {
223  if (msg==OOFmsg_BroadcasterClosing) { // table has been deleted
224  mListensTo = 0;
225  mTable = 0; // won't try to change its selection!
226  }
227  return true;
228 }
229 
230 
231 void
233 {
234  mTable = inTable;
235  if (inTable) { // allow for views without tables!!!
236  subscribeTo(inTable);
237  // REALLY need a way to declare dbSelection with no params!!!!
238  mRepSelection = inTable->currentSelection().internalSelection()->clone();
239  }
240  else
241  mRepSelection = 0;
242  mSavedSelection = 0;
243 }
244 
245 
246 
247 void
249 {
250  if (mTable) {
251  delete mSavedSelection;
252  mSavedSelection = mTable->currentSelection().internalSelection()->clone();
253  const unsigned long numRecs = mSavedSelection->count();
254  if (numRecs>0) {
255  mSavedRecNo = mTable->recordNumber();
256  if (mSavedRecNo>=numRecs)
257  mSavedRecNo=0;
258  }
259  mTable->setSelection(mRepSelection);
260  }
261 }
262 
263 
264 void
266 {
267  if (mSavedSelection) {
268  mTable->setSelection(mSavedSelection);
269  if (mSavedSelection->count()) // can't gotoRecord if empty selection (weird but true, some reports have no selection!)
270  mTable->gotoRecord(mSavedRecNo); // until bug in setSeleciton fixed
271  }
272 }
273 
274 
275 // -------------------------------------------------------
276 // o o f R e p
277 // -------------------------------------------------------
278 
279 oofRep::oofRep(dbTable* inTableForDefaultBody, unsigned long startingPageNumber) :
280  mTopBand(new oofRepViewBand(inTableForDefaultBody->makeView(), false /* default not boxed*/)),
281  mCurrentBand(0),
282  mCurrentBreak(0),
283  mHeadersStartAt(0),
284  mFootersStartAt(0),
285  mFirstPage(true),
286  mFirstPageHeaderHeight(0),
287  mFirstPageFooterHeight(0),
288  mPageFooterHeight(0),
289  mPageHeaderHeight(0),
290  mPageHeight(0),
291  mVerticalPos(0),
292  mDrawingEnv(0),
293  mSettings(0),
294  mPageNumber(0),
295  mFinishedConstruction(false),
296  mLastRenderType(0),
297  mNestedIteratingBandLevel(0),
298  mRepData(0),
299  mStartingPageNumber(startingPageNumber)
300 {
301  mReferences = new unsigned short(1);
302 }
303 
304 
305 oofRep::oofRep(dbView* adoptedViewForDefaultBody, unsigned long startingPageNumber) :
306  mTopBand(new oofRepViewBand(adoptedViewForDefaultBody, false /* default not boxed*/)),
307  mCurrentBand(0),
308  mCurrentBreak(0),
309  mHeadersStartAt(0),
310  mFootersStartAt(0),
311  mFirstPage(true),
312  mFirstPageHeaderHeight(0),
313  mFirstPageFooterHeight(0),
314  mPageFooterHeight(0),
315  mPageHeaderHeight(0),
316  mPageHeight(0),
317  mVerticalPos(0),
318  mDrawingEnv(0),
319  mSettings(0),
320  mPageNumber(0),
321  mFinishedConstruction(false),
322  mLastRenderType(0),
323  mNestedIteratingBandLevel(0),
324  mRepData(0),
325  mStartingPageNumber(startingPageNumber)
326 {
327  mReferences = new unsigned short(1);
328 }
329 
330 
331 oofRep::oofRep(const dbView& inViewForDefaultBody, unsigned long startingPageNumber) :
332  mTopBand(new oofRepViewBand(inViewForDefaultBody, false /* default not boxed*/)),
333  mCurrentBand(0),
334  mCurrentBreak(0),
335  mHeadersStartAt(0),
336  mFootersStartAt(0),
337  mFirstPage(true),
338  mFirstPageHeaderHeight(0),
339  mFirstPageFooterHeight(0),
340  mPageFooterHeight(0),
341  mPageHeaderHeight(0),
342  mPageHeight(0),
343  mVerticalPos(0),
344  mDrawingEnv(0),
345  mSettings(0),
346  mPageNumber(0),
347  mFinishedConstruction(false),
348  mLastRenderType(0),
349  mNestedIteratingBandLevel(0),
350  mRepData(0),
351  mStartingPageNumber(startingPageNumber)
352 {
353  mReferences = new unsigned short(1);
354 }
355 
356 
357 oofRep::oofRep(oofRepIterableTreeBand* topBand, unsigned long startingPageNumber) :
358  mTopBand(topBand),
359  mCurrentBand(0),
360  mCurrentBreak(0),
361  mHeadersStartAt(0),
362  mFootersStartAt(0),
363  mFirstPage(true),
364  mFirstPageHeaderHeight(0),
365  mFirstPageFooterHeight(0),
366  mPageFooterHeight(0),
367  mPageHeaderHeight(0),
368  mPageHeight(0),
369  mVerticalPos(0),
370  mDrawingEnv(0),
371  mSettings(0),
372  mPageNumber(0),
373  mFinishedConstruction(false),
374  mLastRenderType(0),
375  mNestedIteratingBandLevel(0),
376  mRepData(0),
377  mStartingPageNumber(startingPageNumber)
378 {
379  mReferences = new unsigned short(1);
380 }
381 
382 
383 oofRep::oofRep(const oofRep& rhs) :
384  mFirstPageHeaders(rhs.mFirstPageHeaders),
385  mFirstPageFooters(rhs.mFirstPageFooters),
386  mPageHeaders(rhs.mPageHeaders),
387  mPageFooters(rhs.mPageFooters),
388  mTopBand(rhs.mTopBand), // refcount makes this safe to share
389  mCurrentBand(0),
390  mCurrentBreak(0),
391  mFirstPageHeaderHeight(rhs.mFirstPageHeaderHeight),
392  mFirstPageFooterHeight(rhs.mFirstPageFooterHeight),
393  mPageHeaderHeight(rhs.mPageHeaderHeight),
394  mPageFooterHeight(rhs.mPageFooterHeight),
395  mPageHeight(rhs.mPageHeight),
396  mHeadersStartAt(rhs.mHeadersStartAt),
397  mFootersStartAt(rhs.mFootersStartAt),
398  mVerticalPos(rhs.mVerticalPos),
399  mBodyStart(rhs.mBodyStart),
400  mBodyWidth(rhs.mBodyWidth),
401  mPageWidth(rhs.mPageWidth),
402  mFirstPageBodyStart(rhs.mFirstPageBodyStart),
403  mFirstPageFootersStartAt(rhs.mFirstPageFootersStartAt),
404  mFirstPage(rhs.mFirstPage),
405  mDrawingEnv(rhs.mDrawingEnv),
406  mSettings(rhs.mSettings),
407  mPageNumber(rhs.mPageNumber),
408  mFinishedConstruction(rhs.mFinishedConstruction),
409  mLastRenderType(rhs.mLastRenderType),
410  mNestedIteratingBandLevel(rhs.mNestedIteratingBandLevel),
411  mRepData(rhs.mRepData), // refcount makes this safe to share
412  mStartingPageNumber(rhs.mStartingPageNumber),
413  mReferences(rhs.mReferences)
414 {
415  assert(mReferences);
416  (*mReferences)++;
417 }
418 
419 
421 {
422  if (*mReferences==1) {
424  OOF_repBufferSettingVisitor saveModeSetter(false);
425  saveModeSetter.visit(this);
426  }
427  delete mReferences;
428  delete mTopBand;
429  delete mRepData;
430  delete mSettings;
431  }
432  else
433  (*mReferences)--;
434 }
435 
436 
437 bool
439 {
440  return false;
441 }
442 
443 
444 
445 void
447 {
448  sCurrentReport = this;
449 }
450 
451 
454 {
455  if (!mSettings)
456  mSettings = new oofRepSettings();
457  return mSettings;
458 }
459 
460 
463 {
465 }
466 
467 
468 const oofRepSettings*
470 {
471  if (mSettings) // if the report has its own settings
472  return mSettings;
473  else // use defaults
474  return defaultSettings();
475 }
476 
477 
478 void
480 {
481  if (!inEnv.canDraw())
482  return; //****** early exit - unable to draw (probably cancel a Save As dialog)
483 
484  // pickup defaults if we have none - BEFORE makeRender()
485  if (mPageHeaders.count()==0)
487  if (mPageFooters.count()==0)
489 
490  becomeCurrent(); // reports are NOT thread-safe, assume use of static sCurrentReport
491  mDrawingEnv = &inEnv;
492  resetIteratingBandLevel(); // if re-running report which only draws headings at top levels, would see gradual vanishing
493 
494  mPageHeight = mDrawingEnv->calcPageHeight(); // *after* we have set the mDrawingEnv
495  if (mPageHeight==0)
496  return; //***** early exit - error condition getting page height
497 
498  mPageWidth = mBodyWidth = mDrawingEnv->calcPageWidth(); // *after* we have set the mDrawingEnv
506  if( mFirstPageFooters.count() > 0 )
509  mFirstPage = true;
510  if( mFirstPageHeaders.count() > 0 )
513 
514 
515  if (!mFinishedConstruction) {
516  // complete the report objects now that we have them all
517  // this happens ONCE regardless of how many times we draw and
518  // regardless of environment
519  mFinishedConstruction = true;
521  theVisitor.visit(this);
522 
523  if (reportAllowsEditing()) {
525  assert(setupVisitor);
526  setupVisitor->visit(this);
527  delete setupVisitor;
528  }
529  }
530 
531 
532 // make renderers each time we have a new environment
533  oofRepRenderT newRenderType = inEnv.renderType();
534  if (mLastRenderType != newRenderType) {
535  mLastRenderType = newRenderType;
536  inEnv.makeRender();
537 
538  OOF_repMakeRenderVisitor theVisitor(inEnv);
539  theVisitor.visit(this);
540  }
541 
542 // bit of a conceptual hack for now - restore the data context unconditionally on re-runs
543 /*
544  if (mRepData)
545  mRepData->useRepContext();
546  else
547  mRepData = new oofRepData(mTopBand->view()); // save context for later
548 */
549 
551 
552  inEnv.startEnvironment(); // start whatever initial drawing state or precursor written out
553 
554  bool drawPageHeadersAndFooters = !mDrawingEnv->preprocessesPageHeadersAndFooters();
555  //mDrawingEnv->moveToVerticalPos(mHeadersStartAt);
557  if (drawPageHeadersAndFooters) {
558  if( firstPageHeaders().count() > 0 )
560  else
561  drawPageHeaders();
562  }
563 
564  //mDrawingEnv->moveToVerticalPos(mBodyStart);
565  if( mFirstPageHeaders.count() > 0 )
567  else
570 
571 // NOT YET IMPLEMENTED - allow for having just finished a page exactly
572 // with the last band drawn
573 // so we would currently draw two lots of footers
574  //mDrawingEnv->moveToVerticalPos(mFootersStartAt);
575 
576  if (drawPageHeadersAndFooters) {
577  if( firstPageFooters().count() > 0 && mFirstPage ) {
580  mFirstPage = false;
581  }
582  else {
584  drawPageFooters();
585  }
586  }
587 
588  inEnv.endEnvironment();
589 
590  if (mRepData)
592 }
593 
594 
595 void
597 {
598  if( settings()->borderType() > 0 ) {
599  // draw from outside the body section
600  //Rect borderInfo = { settings()->topMargin(),
601  // settings()->leftMargin(),
602  // pageHeight()-settings()->bottomMargin(),
603  // settings()->leftMargin()+bodyWidth()};
604 
606  settings()->topMargin(),
607  settings()->leftMargin(),
608  pageHeight()-settings()->bottomMargin(),
609  settings()->leftMargin()+bodyWidth() );
610  }
611 
612  const bool hasHeaders = (mPageHeaders.count()>0);
613  if (hasHeaders) {
614  DrawBandList(mPageHeaders,false);
615  }
616 }
617 
618 
619 void
621 {
622  DrawBandList(mPageFooters,false);
623 }
624 
625 
626 void
628 {
629  if( settings()->borderType() > 0 ) {
630  // draw from outside the body section
631  //Rect borderInfo = { settings()->topMargin(),
632  // settings()->leftMargin(),
633  // pageHeight()-settings()->bottomMargin(),
634  // settings()->leftMargin()+bodyWidth()};
635 
637  settings()->topMargin(),
638  settings()->leftMargin(),
639  pageHeight()-settings()->bottomMargin(),
640  settings()->leftMargin()+bodyWidth() );
641  }
642 
643  const bool hasHeaders = (mFirstPageHeaders.count()>0);
644  if (hasHeaders) {
646  }
647 }
648 
649 
650 void
652 {
654 }
655 
656 
657 void
659 {
660  bool drawPageHeadersAndFooters = !mDrawingEnv->preprocessesPageHeadersAndFooters();
661  //assert(mVerticalPos <= mFootersStartAt); // Debugging
662  //mDrawingEnv->moveToVerticalPos(mFootersStartAt);
663  if (drawPageHeadersAndFooters) {
664  if( firstPageFooters().count() > 0 && mFirstPage ) {
667  mFirstPage = false;
668  }
669  else {
671  drawPageFooters();
672  }
673  }
674 
675  mPageNumber++;
676 
678 
679  //mDrawingEnv->moveToVerticalPos(mHeadersStartAt);
681  if (drawPageHeadersAndFooters)
682  drawPageHeaders();
683 
684  //mDrawingEnv->moveToVerticalPos(mBodyStart);
686 }
687 
688 
696 {
697  mLastRenderType = 0; // if change body want to force regeneration of renderers
698  delete mTopBand;
699  mTopBand = adoptedBody;
700  return adoptedBody;
701 }
702 
703 
713 {
714  dbView EmptyView; // view with no table will iterate exacly one row
715  EmptyView << " "; // single empty, owned field on this view
716  oofRepViewBand* adoptedBody = new oofRepViewBand(EmptyView, false);
717  getLocalSettings()->drawHeadingsDownToLevel(0); // disable column headings
718  return body(adoptedBody);
719 }
720 
721 
725 bool
727 {
728  unsigned short drawDownTo = settings()->drawHeadingsDownToLevel();
729  bool ret = (drawDownTo >= mNestedIteratingBandLevel);
730  return ret;
731 }
732 
733 
734 void
736 {
737  if (inList.count()==0)
738  return; // TRIVIAL EXIT - empty bandlist
739 
740  if (inBody) { // check if band fits, breaks etc.
741  if (inList.keepTogether()) { // definitely not a view band in the list!
742  const long spaceLeft = bodyEnd()-mVerticalPos;
743  const long fixedHeight = inList.fixedHeight();
744  long reduceBy = 0;
745  if (fixedHeight>spaceLeft) { // too large, maybe it can squeeze to fit
746  // if our min height allows us to fit then we calculate an amount
747  // by which we have to reduce from our normal fixedHeight, and ask
748  // each band in turn to whittle away at that reduceBy space.
749 
750  // Note: this is not a very good algorithm if you had several bands mixed
751  // which could all reduce but our common situation at present is that only
752  // one type of band (graph) will reduce and usually only one is mixed with
753  // other bands in a list
754  const long maxAvailHeight = bodyHeight();
755  const long minHeight = inList.minHeight();
756  if (minHeight<=spaceLeft || minHeight>maxAvailHeight)
757  reduceBy = fixedHeight - spaceLeft; // it thinks it can fit or we make it
758  // because it's bigger than the page
759  else {
760  if (fixedHeight>maxAvailHeight) // list is taller than page without shrinking
761  reduceBy = fixedHeight - maxAvailHeight;
762  drawPageBreak(); // can't fit and fits within a page, so get a new one
763  }
764  } // might not fit
765 
766  for (inList.start(); inList.more(); inList.next()) {
767  mCurrentBand = inList();
768  if (reduceBy>0)
769  mCurrentBand->drawSquished(reduceBy); // always reduces reduceBy
770  else
771  mCurrentBand->draw(); // no need to see if things fit
772  } // loop kept together bands
773  }
774  else { // may contain view bands, may split across pages
775  for (inList.start(); inList.more(); inList.next()) {
776  oofRepBand* theBand = inList();
777  if (theBand->maybeComplexBand()) {
778  DrawComplexBand(theBand);
779  }
780  else {
781  mCurrentBand = theBand;
782  const long bandFixedHeight = theBand->fixedHeight();
783  long reduceByForWholePage=bandFixedHeight-bodyHeight();
784  if (reduceByForWholePage<0)
785  reduceByForWholePage=0;
786 
787  if (mVerticalPos > mBodyStart) { // only part page available
788  const long spaceLeft = bodyEnd()-mVerticalPos;
789  if (bandFixedHeight > spaceLeft)
790  drawPageBreak(); // break because more space next page
791  }
792  // either at top of new page, or top of original, and need to squish anyway, or we fitted
793  if (reduceByForWholePage>0)
794  theBand->drawSquished(reduceByForWholePage); // squish - it's taller than a page
795  else
796  theBand->draw(); // draw original height
797  }
798  } // loop bands
799  } // keep together or not
800  }
801  else { // not in body so don't care about keeptogether etc.
802  for (inList.start(); inList.more(); inList.next()) {
803  oofRepBand* theBand = inList();
804  if (theBand->maybeComplexBand()) {
805  DrawComplexBand(theBand);
806  }
807  else { // can't break if not in body
808  mCurrentBand = theBand;
809  theBand->draw();
810  }
811  } // loop bands
812  } // inBody or not
813 }
814 
815 
816 void
817 oofRep::ProcessBreakList(oofRepBreakList& inList, bool beforeRecord)
818 {
819  bool newPage = false;
820  oofRepBreakList triggeredBreaks(false);
821  for (inList.start(); inList.more(); inList.next()) {
822  oofRepBreak* theBreak = inList();
823  if (theBreak->breaks()) {
824  if (theBreak->newPage())
825  newPage = true;
826  triggeredBreaks << theBreak;
827  }
828  } // loop all possible breaks
829 
830  if (beforeRecord) {
831  if (newPage)
832  drawPageBreak();
833  DrawBreakList(triggeredBreaks);
834  }
835  else {
836  DrawBreakList(triggeredBreaks);
837  if (newPage)
838  drawPageBreak();
839  }
840 }
841 
842 
843 void
845 {
846  for (inList.start(); inList.more(); inList.next()) {
847  oofRepBreak* theBreak = inList();
848  oofRepBand* theBand = theBreak->band();
849  if (theBand) {
850  if (theBand->maybeComplexBand()) {
851  DrawComplexBand(theBand);
852  }
853  else {
854  // Do we fit on the page..
855  if ((theBand->fixedHeight()+mVerticalPos)>bodyEnd()) {
856  drawPageBreak();
857  }
858  mCurrentBand = theBand;
859  theBand->draw();
860  }
861  } // break without a band
862  }
863 }
864 
865 
877 void
879 {
880  if (!inBand)
881  return; // it *is* legal to have empty bands
882 
883  OOF_mixIterableBand* iteratingInterface = inBand->asIterableBand();
884  OOF_mixBandWithSubBands* subBandInterface = inBand->asBandWithSubBands();
885  OOF_mixBandWithTableWrappers* tableInterface = inBand->asBandWithTableWrappers();
886 
887 
888  if (iteratingInterface)
889  incrementIteratingBandLevel(); // so we know what level we're down to, for heading control
890  // remembering breaks and other bands on the following view may themselves be view bands
891 
892  mCurrentBand = inBand;
893 
894  if (tableInterface)
895  tableInterface->startTableWrapper();
896 
897  if (subBandInterface)
898  DrawBandList(subBandInterface->headers());
899 
900  if (tableInterface)
901  tableInterface->startTableBody();
902 
903  if (iteratingInterface) {
904  for (iteratingInterface->start(); iteratingInterface->more(); iteratingInterface->next()) {
905  ProcessBreakList(iteratingInterface->headerBreaks(), true);
906  inBand->draw();
907  ProcessBreakList(iteratingInterface->footerBreaks(), false);
908  }
909  }
910  else {
911  inBand->draw();
912  }
913  if (tableInterface)
914  tableInterface->endTableBody();
915 
916  if (subBandInterface)
917  DrawBandList(subBandInterface->footers());
918  if (tableInterface)
919 
920  tableInterface->endTableWrapper();
921 
923 }
924 
925 
926 void
927 oofRep::describe(ostream& os)
928 {
929  mSettings->describe(os);
930 
931 }
932 
933 // -------------------------------------------------------
934 // o o f R e p M u l t i
935 // -------------------------------------------------------
937 {}
938 
940 {
941  const unsigned long numSections = mSections.count();
942  for (unsigned long i=0; i<numSections; i++) {
943  oofRepSection* theSection = section(i);
944  delete theSection;
945  }
947 }
948 
949 
950 bool
952 {
953  return true;
954 }
955 
956 
957 void
959 {
960  appendReport(*adoptedReport);
961  delete adoptedReport;
962 }
963 
964 
965 void
967 {
968  if (inRep.isMultiReport()) {
969  oofRepMulti* multiRep = (oofRepMulti*)(&inRep); // safe downcast
970  const unsigned short numAdopting = multiRep->count();
971  for (unsigned short i=0; i<numAdopting; i++) {
972  oofRepSection* theSection = multiRep->orphanSection(i);
973  mSections.append((unsigned long)theSection);
974  }
975  }
976  else {
977  oofRepSection* theSection = new oofRepSection(inRep);
978  mSections.append((unsigned long)theSection);
979  }
980 }
981 
982 
983 oofRepMulti&
985 {
986  appendReport(*adoptedReport);
987  delete adoptedReport;
988  return *this;
989 }
990 
991 
992 oofRepMulti&
994 {
995  appendReport(inRep);
996  return *this;
997 }
998 
999 
1000 oofRepSection*
1002 {
1004  mSections[n] = 0; // clear our pointer
1005  return ret;
1006 }
1007 
1008 
1009 void
1011 {
1012  if (!inEnv.canDraw())
1013  return; //****** early exit - unable to draw (probably cancel a Save As dialog)
1014 
1015  const unsigned long numSections = mSections.count();
1016  assert(numSections); // silly to be drawing if no reports
1017  if (numSections==0)
1018  return; // clean runtime exit
1019 
1020  // pickup defaults if we have none - BEFORE makeRender()
1021  if (mPageHeaders.count()==0)
1023  if (mPageFooters.count()==0)
1025 
1026  becomeCurrent();
1027  mDrawingEnv = &inEnv;
1028  resetIteratingBandLevel(); // if re-running report which only draws headings at top levels, would see gradual vanishing
1029 
1030  mPageHeight = mDrawingEnv->calcPageHeight(); // *after* we have set the mDrawingEnv
1031  mPageWidth = mBodyWidth = mDrawingEnv->calcPageWidth(); // *after* we have set the mDrawingEnv
1032  mBodyWidth -= settings()->leftMargin();
1039  if( mFirstPageFooters.count() > 0 )
1042  mFirstPage = true;
1043  if( mFirstPageHeaders.count() > 0 )
1046 
1047  for (unsigned short i=0; i<numSections; i++) {
1048  oofRepSection* theSection = section(i);
1049  assert(theSection);
1050  theSection->setDimensions(inEnv, this);
1051  }
1052 
1053  if (!mFinishedConstruction) {
1054  mFinishedConstruction = true;
1055 
1057  theVisitor.visit(this);
1058  }
1059  oofRepRenderT newRenderType = inEnv.renderType();
1060  if (mLastRenderType != newRenderType) {
1061  mLastRenderType = newRenderType;
1062  inEnv.makeRender();
1063 
1064  OOF_repMakeRenderVisitor theVisitor(inEnv);
1065  theVisitor.visit(this);
1066  }
1067 
1068  becomeCurrent();
1069  inEnv.startEnvironment(); // AFTER getting page headers and footers & makeRender
1070 
1071  for (unsigned short j=0; j<numSections; j++) {
1072  oofRepSection* theSection = section(j);
1073  assert(theSection);
1074  theSection->drawSection(inEnv, this, j);
1075  }
1076 
1077  becomeCurrent();
1078  inEnv.endEnvironment();
1079 }
1080 
1081 
1082 // -------------------------------------------------------
1083 // o o f R e p S e c t i o n
1084 // -------------------------------------------------------
1085 oofRepSection::oofRepSection(oofRepIterableTreeBand* adoptedBody, unsigned long startingPageNumber, bool resetPageNumber, bool pageBreak) :
1086  oofRep(adoptedBody, startingPageNumber),
1087  mResetPageNumber(resetPageNumber),
1088  mPageBreak(pageBreak)
1089 {
1090 }
1091 
1092 
1093 oofRepSection::oofRepSection(const oofRep& inRep, bool resetPageNumber, bool pageBreak) : // special copy ctor
1094  oofRep(inRep),
1095  mResetPageNumber(resetPageNumber),
1096  mPageBreak(pageBreak)
1097 
1098 {
1099  assert(mTopBand); // current model demands a view band
1100 }
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 void
1111 {
1112  becomeCurrent();
1114  // pickup parent's, which will have been defaulted if not set
1115  if (mPageHeaders.count()==0)
1116  mPageHeaders = parentReport->mPageHeaders;
1117  if (mPageFooters.count()==0)
1118  mPageFooters = parentReport->mPageFooters;
1119 
1120  if (mFirstPageHeaders.count()==0)
1121  mFirstPageHeaders = parentReport->mFirstPageHeaders;
1122  if (mFirstPageFooters.count()==0)
1123  mFirstPageFooters = parentReport->mFirstPageFooters;
1124 
1125  mDrawingEnv = &inEnv;
1126  resetIteratingBandLevel(); // if re-running report which only draws headings at top levels, would see gradual vanishing
1127  mPageHeight = parentReport->mPageHeight;
1128  mPageWidth = parentReport->mPageWidth;
1129  mBodyWidth = parentReport->mBodyWidth;
1135  if( mFirstPageFooters.count() > 0 )
1138  if( mFirstPageHeaders.count() > 0 )
1141 }
1142 
1143 
1144 void
1145 oofRepSection::drawSection(oofRepEnvironment& inEnv, oofRepMulti* parentReport, unsigned short inSectionNumber)
1146 {
1147  mFirstPage = (inSectionNumber==0);
1148 
1149  becomeCurrent();
1151 // bit of a conceptual hack for now - restore the data context unconditionally on re-runs
1152  if (mRepData)
1154  else
1155  mRepData = new oofRepData(mTopBand->view()); // save context for later
1156 
1157 // never set for sections assert(mFinishedConstruction);
1158 
1159  if (mResetPageNumber)
1161  else
1162  mPageNumber = parentReport->pageNumber();
1163 
1165 // if not the first section being drawn, we need to break
1166 // after the last one,
1167  if (!mFirstPage && mPageBreak) {
1168  // assume prev section drew its final page footer
1170  // our normal start of section logic below will draw header if appropriate
1171  }
1172 
1173  bool drawPageHeadersAndFooters = !mDrawingEnv->preprocessesPageHeadersAndFooters();
1175  if (drawPageHeadersAndFooters) { // ie we have not drawn them in start enviroment
1176  if( firstPageHeaders().count() > 0 )
1178  else
1179  drawPageHeaders();
1180  }
1181 
1182  if( mFirstPageHeaders.count() > 0 )
1184  else
1186 
1188 
1189 // NOT YET IMPLEMENTED - allow for having just finished a page exactly
1190 // with the last band drawn
1191 // so we would currently draw two lots of footers
1192 
1193  if (drawPageHeadersAndFooters) {
1194  if( firstPageFooters().count() > 0 && mFirstPage ) {
1197  mFirstPage = false;
1198  }
1199  else {
1201  drawPageFooters();
1202  }
1203  }
1204 
1205  if (mRepData)
1207 
1208 // reset the current page number in the parent so it knows where we are up to
1209  parentReport->pageNumber(mPageNumber);
1210 }
1211 
1212 
1213 // -------------------------------------------------------
1214 // o o f R e p D r a w a b l e
1215 // -------------------------------------------------------
1217  oofRepTextStylable(adoptedStyle),
1218  mRender(0)
1219 {
1220 }
1221 
1222 
1224  oofRepTextStylable(rhs)
1225 {
1226  if (rhs.mRender)
1227  mRender = rhs.mRender->clone(this);
1228  else
1229  mRender = 0;
1230 }
1231 
1233 {
1234  delete mRender;
1235 }
1236 
1237 
1241 void
1243 {
1244 }
1245 
1252 dbView*
1253 oofRepDrawable::view(unsigned short /*whichView*/) const
1254 {
1255  return 0;
1256 }
1257 
1258 
1264 void
1266 {
1267  assert(mRender);
1269 }
1270 
1271 
1272 
1273 unsigned long
1275 {
1276  assert( !"oofRepDrawable::fixedHeight should be overridden in all derived classes" );
1277  return 0; // placed in base class for adorner call
1278 }
1279 
1280 
1281 unsigned long
1283 {
1284  unsigned long ret = mRender->width();
1285  return ret;
1286 }
1287 
1288 
1289 
1295 void
1297 {
1298  if (!mRender)
1299  return;
1300 
1301  const unsigned long adornCount = adorners().count();
1302  unsigned long i;
1303 
1304  if (adornCount) {
1305  // call adorners for before the band
1306  adorners().start();
1307  for( i=0; i<adornCount; i++ ) {
1308  oofAdorner* currentAdorner = adorners().current();
1309  if( currentAdorner->drawWhen() == oofAdorner::drawBefore ) {
1310  currentAdorner->draw( this, fixedHeight(), oofRep::currentReport()->bodyWidth() );
1311  }
1312  adorners().next();
1313  }
1314  }
1315  mRender->draw();
1316 
1317  if (adornCount) {
1318  // call adorners for after the band
1319  adorners().start();
1320  for( i=0; i<adornCount; i++ ) {
1321  oofAdorner* currentAdorner = adorners().current();
1322  if( currentAdorner->drawWhen() == oofAdorner::drawAfter ) {
1323  currentAdorner->draw( this, fixedHeight(), oofRep::currentReport()->bodyWidth() );
1324  }
1325  adorners().next();
1326  }
1327  }
1328 }
1329 
1330 
1331 // default render factories so if user chooses not to implement
1332 // a render for their report object, we still behave OK, just ignore them
1333 void
1335 {
1336  delete mRender;
1337  mRender = 0;
1338 }
1339 
1340 
1341 void
1342 oofRepDrawable::makeRender(const oofRepMacCGEnv&)
1343 {
1344  delete mRender;
1345  mRender = 0;
1346 }
1347 
1348 
1349 void
1351 {
1352  delete mRender;
1353  mRender = 0;
1354 }
1355 
1356 
1357 void
1359 {
1360  delete mRender;
1361  mRender = 0;
1362 }
1363 
1364 
1365 void
1367 {
1368  delete mRender;
1369  mRender = 0;
1370 }
1371 
1372 
1373 void
1375 {
1376  delete mRender;
1377  mRender = 0;
1378 }
1379 
1380 
1381 void
1383 {
1384  delete mRender;
1385  mRender = 0;
1386 }
1387 
1388 
1389 void
1391 {
1392  delete mRender;
1393  mRender = 0;
1394 }
1395 
1396 
1397 void
1399 {
1400  delete mRender;
1401  mRender = 0;
1402 }
1403 
1404 
1405 void
1407 {
1408  delete mRender;
1409  mRender = 0;
1410 }
1411 
1412 #ifndef OOF_REP_NO_GUI
1413 
1422 {
1423  return NULL;
1424 }
1425 #endif
1426 
1427 // -------------------------------------------------------
1428 // o o f R e p R e n d e r
1429 // -------------------------------------------------------
1430 long
1432 {
1433  oofRep* curRep = oofRep::currentReport();
1434  const oofRepSettings* currSettings = curRep->settings();
1435  const unsigned short leftMargin = currSettings->leftMargin();
1436  const unsigned short bandIndenting = currSettings->bandIndenting();
1437 
1438  const long ret = leftMargin+bandIndenting;
1439  return ret;
1440 }
1441 
1442 
1443 unsigned long
1445 {
1446  return 0; // NOT YET IMPLEMENTED - smarter default
1447 }
1448 
1449 
1450 // -------------------------------------------------------
1451 // o o f R e p R e n d e r D e c o r a t o r
1452 // -------------------------------------------------------
1453 oofRepRenderDecorator::oofRepRenderDecorator(oofRepRender* adoptedRender) :
1454  mWrappedRender(adoptedRender)
1455 {
1456 }
1457 
1458 
1460 {
1461  delete mWrappedRender;
1462 }
1463 
1464 
1465 void
1467 {
1469 }
1470 
1471 
1472 void
1474 {
1475  // just forward to wrapped render, but subclasses likely to override
1476  mWrappedRender->draw();
1477 }
1478 
1479 
1480 void
1482 {
1484 }
1485 
1486 
1487 long
1489 {
1490  return mWrappedRender->leftDrawMargin();
1491 }
1492 
1493 
1494 unsigned long
1496 {
1497  return mWrappedRender->width();
1498 }
1499 
1500 
1501 
1502 // -------------------------------------------------------
1503 // o o f R e p B a n d
1504 // -------------------------------------------------------
1505 
1506 unsigned long
1508 {
1509  assert( !"You should override this function: oofRepBand::fixedHeight()" );
1510  return 0;
1511 }
1512 
1513 
1514 unsigned long
1516 {
1517  return fixedHeight();
1518 }
1519 
1520 
1525 bool
1527 {
1528  return false;
1529 }
1530 
1531 
1532 bool
1534 {
1535  return false;
1536 }
1537 
1538 
1539 void
1540 oofRepBand::drawSquished(long& /*balanceToSave*/)
1541 {
1542  draw();
1543 }
1544 
1545 
1548 {
1549  return 0;
1550 }
1551 
1552 
1555 {
1556  return 0;
1557 }
1558 
1559 
1562 {
1563  return 0;
1564 }
1565 
1566 
1569 {
1570  return 0;
1571 }
1572 
1573 
1574 
1575 // -------------------------------------------------------
1576 // o o f R e p B l o c k
1577 // -------------------------------------------------------
1578 
1580  oofRepDrawable(adoptedStyle),
1581  mAlignment(alignLeft),
1582  mMoveDownAfter(false),
1583  mFixedWidth(0)
1584 {
1585 }
1586 
1587 
1588 oofRepBlock&
1590 {
1591  mAlignment = A;
1592  return *this; // allow chaining in << lists
1593 }
1594 
1595 
1596 oofRepBlock&
1597 oofRepBlock::fixedWidth(unsigned long inWidth)
1598 {
1599  mFixedWidth = inWidth;
1600  return *this; // allow chaining in << lists
1601 }
1602 
1603 
1608 oofRepBlock&
1610 {
1611  mMoveDownAfter = b;
1612  return *this; // allow chaining in << lists
1613 }
1614 
1615 
1623 {
1624  if (mStyle)
1625  return mStyle;
1626  else {
1627  oofRepLayoutBand* drawingUs = oofRepLayoutBand::currentLayout(); // in case called from context when not true,
1628 
1629  oofRepTextStyle* ret = 0;
1630  if (drawingUs)
1631  ret = drawingUs->textStyle();
1632  return ret;
1633  }
1634 }
1635 
1636 
1637 unsigned int
1639 {
1640  return 0;
1641 }
1642 
1643 
1644 oofString
1645 oofRepBlock::getCellText(bool* outIsEditable, oofString* /*outLocationName*/, long /*row*/, short /*col*/) const
1646 {
1647  if (outIsEditable)
1648  *outIsEditable = false;
1649 
1650  return oofString();
1651 }
1652 
1653 
1654 void
1655 oofRepBlock::setCellText(const oofString&, long /*row*/, short /*col*/)
1656 {
1657 }
1658 
1659 
1660 
1661 // -------------------------------------------------------
1662 // o o f R e p T e x t S t y l e
1663 // -------------------------------------------------------
1664 
1665 oofRepTextStyle::oofRepTextStyle(): // protected default
1666  mFontSize(0),
1667  mStyleNum(0),
1668  mLeading(0),
1669  mColor(oofColor::Black),
1670  mAlignment(oofColSizer::alignLeft)
1671 {
1672 #ifdef _Windows
1673  memset(&mLogFont, 0, sizeof(LOGFONT));
1674 #endif
1675 }
1676 
1677 
1678 oofRepTextStyle::oofRepTextStyle(const char* fontName, unsigned short fontSize, unsigned char styleNum, short leading, oofColor color,oofColSizer::colAlignT aLin) :
1679  mFontName(fontName),
1680  mFontSize(fontSize),
1681  mStyleNum(styleNum),
1682  mLeading(leading),
1683  mColor(color),
1684  mAlignment(aLin)
1685 {
1687 }
1688 
1689 #ifdef _Windows
1690 /*
1691 AD 981008 removed as it doesn't set the other members
1692 and isn't in use at present. If we want to use it again it
1693 MUST set the other members particularly mLeading
1694 
1695 oofRepTextStyle::oofRepTextStyle(const LOGFONT& lf) :
1696  mLogFont(lf)
1697 {
1698 }
1699 */
1700 #endif
1701 
1702 oofRepTextStyle::oofRepTextStyle(const char* fontName, unsigned short fontSize,oofColSizer::colAlignT aLin, unsigned char styleNum, short leading, oofColor color):
1703  mFontName(fontName),
1704  mFontSize(fontSize),
1705  mStyleNum(styleNum),
1706  mLeading(leading),
1707  mColor(color),
1708  mAlignment(aLin)
1709 {
1711 }
1712 
1713 
1714 void
1716 {
1717 #ifdef _Windows
1718  memset(&mLogFont, 0, sizeof(LOGFONT));
1719 
1720  strcpy(mLogFont.lfFaceName, mFontName);
1721  mLogFont.lfHeight = -mFontSize;
1722  mLogFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
1723  mLogFont.lfCharSet = DEFAULT_CHARSET; // rely on size & family
1724  mLogFont.lfWeight = mStyleNum & bold ? FW_BOLD : FW_NORMAL;
1725  mLogFont.lfItalic = mStyleNum & italic ? TRUE : FALSE;
1726  mLogFont.lfUnderline = mStyleNum & underline ? TRUE : FALSE;
1727 #endif
1728  assert(invariant());
1729 }
1730 
1731 
1734 {
1735  return new oofRepTextStyle(*this);
1736 }
1737 
1738 
1739 bool
1741 {
1742 // compare in order of fastest comparisons (eg: ints) but also most likely to differ
1743 // so put color last
1744  const bool ret = (
1745  (mFontSize == rhs.mFontSize) &&
1746  (mStyleNum == rhs.mStyleNum) &&
1747  (mLeading == rhs.mLeading) &&
1748  (mFontName == rhs.mFontName) &&
1749  (mColor == rhs.mColor)
1750  );
1751  return ret;
1752 }
1753 
1754 
1755 
1756 unsigned long
1758 {
1759  unsigned long ret = oofRep::currentReport()->environment()->heightOfTextStyle(this);
1760  return ret;
1761 }
1762 
1763 
1764 void
1765 oofRepTextStyle::extract(ostream& os) const
1766 {
1767  os << mFontName << " " << mFontSize << " " << mStyleNum << " " << mLeading << " " << mColor ;
1768 }
1769 
1770 
1771 // -------------------------------------------------------
1772 // o o f R e p T e x t S t y l a b l e
1773 // -------------------------------------------------------
1775  mStyle(adoptedStyle)
1776 {
1777 }
1778 
1779 
1780 oofRepTextStylable::oofRepTextStylable(const char* fontName, unsigned short fontSize, unsigned char styleNum, short leading, oofColor color)
1781 {
1782  mStyle = new oofRepTextStyle(fontName, fontSize, styleNum, leading, color);
1783 }
1784 
1785 
1787  mStyle(0)
1788 {
1789  if (rhs.mStyle)
1790  mStyle = rhs.mStyle->clone();
1791 }
1792 
1793 
1795 {
1796  delete mStyle;
1797 }
1798 
1799 
1803 void
1805 {
1806  delete mStyle;
1807  mStyle = adoptedStyle;
1808 }
1809 
1810 
1814 void
1815 oofRepTextStylable::textStyle(const char* fontName, unsigned short fontSize, unsigned char styleNum, short leading, oofColor color)
1816 {
1817  delete mStyle;
1818  mStyle = new oofRepTextStyle(fontName, fontSize, styleNum, leading, color);
1819 }
1820 
1821 
1828 {
1829  if (mStyle)
1830  return mStyle;
1831  else {
1833  return ret;
1834  }
1835 }
1836 
1843 {
1844  if (!mStyle)
1845  mStyle = textStyle()->clone();
1846  return mStyle;
1847 }
1848 
1849 
1850 
1851 
1852 // -------------------------------------------------------
1853 // o o f R e p B a n d L i s t
1854 // -------------------------------------------------------
1855 
1857  mKeepTogether(keepTogether),
1858  mFixedHeight(ULONG_MAX)
1859 {
1860 }
1861 
1862 
1864 {
1865  *this = rhs;
1866 }
1867 
1868 
1869 const oofRepBandList&
1871 {
1872  mKeepTogether = rhs.mKeepTogether;
1873  mFixedHeight = rhs.mFixedHeight;
1874  mMinHeight = rhs.mMinHeight;
1875  unsigned long numItems = rhs.count();
1876  for (unsigned long i=0; i<numItems; i++) {
1877  oofRepBand* theBand = rhs.value(i);
1878  append(theBand->clone());
1879  }
1880  return *this;
1881 }
1882 
1883 
1885 {
1886  for (start(); more(); next()) {
1887  oofRepBand* theBand = current();
1888  delete theBand;
1889  }
1890 }
1891 
1892 
1895 {
1896  return new oofRepBandList(*this);
1897 }
1898 
1899 
1900 void
1902 {
1903  mBands.append((unsigned long) adoptedBand);
1904 }
1905 
1906 
1907 unsigned long
1909 {
1910  if (mFixedHeight==ULONG_MAX) { // calc it
1911  unsigned long totFixedHeight = 0;
1912  const unsigned long numItems = count();
1913  for (unsigned long i=0; i<numItems; i++) {
1914  oofRepBand* theBand = value(i);
1915  totFixedHeight += theBand->fixedHeight();
1916  }
1917  mFixedHeight = totFixedHeight;
1918  }
1919  return mFixedHeight;
1920 }
1921 
1922 
1923 void
1925 {
1926 // remember that finishConstruction is not called again just because report size changes!
1927  bool canKeepTogether = true;
1928  unsigned long totFixedHeight = 0;
1929  unsigned long totMinHeight = 0;
1930  const unsigned long numItems = count();
1931  for (unsigned long i=0; i<numItems; i++) {
1932  oofRepBand* theBand = value(i);
1933  if (theBand->maybeComplexBand())
1934  canKeepTogether = false; // variable height view bands can't be in keepTogether
1935  else {
1936  // save virtual calls to viewband as it has no height
1937  totFixedHeight += theBand->fixedHeight();
1938  totMinHeight += theBand->minHeight(); // call after band has finishConstruction
1939  }
1940  }
1941  if (mKeepTogether==eDefaultTogether)
1942  keepTogether(canKeepTogether);
1943 
1944 // store totals back into member variables
1945 // fixed height uncalculated or hasn't changed
1946  assert((mFixedHeight==ULONG_MAX) || (mFixedHeight == totFixedHeight));
1947  mFixedHeight = totFixedHeight;
1948  mMinHeight = totMinHeight;
1949 }
1950 
1951 
1952 
1953 
1954 
1955 // -------------------------------------------------------
1956 // o o f R e p B l o c k L i s t
1957 // -------------------------------------------------------
1958 
1960 {
1961 }
1962 
1963 
1965 {
1966  *this = rhs;
1967 }
1968 
1969 
1970 const oofRepBlockList&
1972 {
1973  unsigned long numItems = rhs.count();
1974  for (unsigned long i=0; i<numItems; i++) {
1975  oofRepBlock* theBlock = rhs.value(i);
1976  append(theBlock->clone());
1977  }
1978  return *this;
1979 }
1980 
1981 
1984 {
1985  return new oofRepBlockList(*this);
1986 }
1987 
1988 
1990 {
1991  for (start(); more(); next()) {
1992  oofRepBlock* theBlock = current();
1993  delete theBlock;
1994  }
1995 }
1996 
1997 
1998 void
2000 {
2001  mBlocks.append((unsigned long) adoptedBlock);
2002 }
2003 
2004 
2005 unsigned long
2007 {
2008 // sum of tallest blocks in each row
2009  unsigned long ret = 0;
2010  unsigned long maxHeightInRow = 0;
2011  unsigned long numItems = count();
2012  for (unsigned long i=0; i<numItems; i++) {
2013  oofRepBlock* theBlock = value(i);
2014  unsigned long bh = theBlock->fixedHeight();
2015  if (bh > maxHeightInRow) {
2016  maxHeightInRow = bh;
2017  }
2018  if (theBlock->moveDownAfter()) {
2019  ret += maxHeightInRow;
2020  maxHeightInRow = 0;
2021  }
2022  }
2023  ret += maxHeightInRow; // add height of last row even if not a moveDownAfter
2024  return ret;
2025 }
2026 
2027 
2028 
2029 
2030 
2031 // -------------------------------------------------------
2032 // o o f R e p B r e a k L i s t
2033 // -------------------------------------------------------
2034 
2036  mOwnsBreaks(ownsBreaks)
2037 {
2038 }
2039 
2040 
2042 {
2043  *this = rhs;
2044 }
2045 
2046 
2047 const oofRepBreakList&
2049 {
2050  unsigned long numItems = rhs.count();
2051  for (unsigned long i=0; i<numItems; i++) {
2052  oofRepBreak* theBreak = rhs.value(i);
2053  append(theBreak->clone());
2054  }
2055  return *this;
2056 }
2057 
2058 
2061 {
2062  return new oofRepBreakList(*this);
2063 }
2064 
2065 
2067 {
2068  if (mOwnsBreaks)
2069  for (start(); more(); next()) {
2070  oofRepBreak* theBreak = current();
2071  delete theBreak;
2072  }
2073 }
2074 
2075 
2076 void
2078 {
2079  mBreaks.append((unsigned long) adoptedBreak);
2080 }
2081 
2082 
2083 // -------------------------------------------------------
2084 // o o f R e p B r e a k
2085 // -------------------------------------------------------
2086 
2087 oofRepBreak::oofRepBreak(oofRepBand* band, bool newPageEveryTime) :
2088  mBand(band),
2089  mNewPageEveryTime(newPageEveryTime)
2090 {
2091 }
2092 
2093 
2095  mBand(rhs.mBand->clone()),
2096  mNewPageEveryTime(rhs.mNewPageEveryTime)
2097 {
2098 }
2099 
2100 
2102 {
2103  delete mBand;
2104 }
2105 
2106 
2107 bool
2109 {
2110  return mNewPageEveryTime;
2111 }
2112 
2113 
2114 void
2116 {
2117  if (mBand)
2119  // we OWN this band so we finishConstructing it, the band is not owned
2120  // or accessible by any other report entity
2121 }
2122 
2123 
2124 
2125 // -------------------------------------------------------
2126 // o o f R e p B r e a k E v e r y R e c o r d
2127 // -------------------------------------------------------
2129  oofRepBreak(band, newPageEveryTime)
2130 {
2131 }
2132 
2133 
2134 oofRepBreak*
2136 {
2137  return new oofRepBreakEveryRecord(*this);
2138 }
2139 
2140 
2141 bool
2143 {
2144  return true;
2145 }
2146 
2147 
2148 oofString
2150 {
2151  return "oofRepBreakEveryRecord";
2152 }
2153 
2154 
2155 void
2157 {
2158 #ifdef OOF_READ_XML
2160 #endif
2161 }
2162 
2163 
2166 {
2167  // NOT YET IMPLEMENTED
2168  return 0;
2169 }
2170 
2171 
2172 oofString
2174 {
2175  if (mNewPageEveryTime)
2176  return "T";
2177  else
2178  return "F";
2179 }
2180 
2181 
2182 
2183 // -------------------------------------------------------
2184 // o o f D E
2185 // -------------------------------------------------------
2186 void
2188 // factory that records element with current page
2189 {
2191  assert(currentPage);
2192  currentPage->appendElement(adoptedDE);
2193 }
2194 
2195 
2196 
2197 // -------------------------------------------------------
2198 // o o f R e p C u s t o m V i e w D r a w e r
2199 // -------------------------------------------------------
2206 oofString
2208 {
2209  return inField->copyString();
2210 }
void restoreDataSelection()
Definition: oofrep1.cpp:265
virtual ~oofRepMulti()
Definition: oofrep1.cpp:939
oofRepBandList * clone()
Definition: oofrep1.cpp:1894
unsigned short drawHeadingsDownToLevel() const
Definition: oofrep3.cpp:515
static oofRep * sCurrentReport
Definition: oofrep.h:666
unsigned long fixedHeight()
Definition: oofrep1.cpp:1908
unsigned long mFirstPageBodyStart
Definition: oofrep.h:651
unsigned long mFootersStartAt
Definition: oofrep.h:651
oofRepBreak * value(unsigned long) const
Definition: oofrep.h:2495
oofRepBreakList & footerBreaks()
Definition: oofrep.h:2124
static oofRepLayoutBand * currentLayout()
Definition: oofrep.h:2195
blockAlignT mAlignment
Definition: oofrep.h:1436
void incrementIteratingBandLevel()
Call when visiting tree enters band implementing OOF_mixIterableBand.
Definition: oofrep.h:2025
saveOptionsT
Definition: oof1.h:464
oofRepEditor * reportEditor() const
Definition: oofrep3.cpp:646
oofRepSection(oofRepIterableTreeBand *adoptedBody=0, unsigned long startingPageNumber=1, bool resetPageNumber=true, bool pageBreak=true)
Definition: oofrep1.cpp:1085
oofrpMacCG.h
Definition: oofrpGDIPlus.h:37
Convenient top-level parent band mixing in all the exotic aspects.
Definition: oofrep.h:1256
bool invariant() const
true after full initialisation
Definition: oofrep.h:2633
virtual void VisitBandList(oofRepBandList &)
Definition: oofrep1.cpp:105
Convenient mixin if you want to have a band which iterates and has breaks.
Definition: oofrep.h:918
void pageNumber(unsigned long)
Definition: oofrep.h:1989
virtual oofRepTextStyle * textStyle() const
Definition: oofrep1.cpp:1622
virtual OOF_mixIterableBand * asIterableBand()
Definition: oofrep1.cpp:1547
virtual void drawPageBreak()=0
virtual void draw()
Definition: oofrep1.cpp:1473
virtual unsigned long width() const
Definition: oofrep1.cpp:1444
unsigned long mPageHeight
Definition: oofrep.h:651
unsigned short mNestedIteratingBandLevel
1=in body view as zero allowed for outside the main body view
Definition: oofrep.h:661
virtual bool maybeComplexBand() const
Overall guard flag to simplify checks for capabilities.
Definition: oofrep1.cpp:1526
virtual oofRepTextStyle * textStyle() const
Get the text style owned by this object or a default.
Definition: oofrep1.cpp:1827
oofRepBandList & firstPageHeaders()
Definition: oofrep.h:1887
virtual unsigned long fixedHeight()
Definition: oofrep.h:2222
virtual unsigned long fixedHeight()
Definition: oofrep1.cpp:1274
oofRepBandList & footers()
Definition: oofrep.h:2141
virtual void drawSquished(long &balanceToSave)
Definition: oofrep1.cpp:1540
virtual ~oofRepData()
Definition: oofrep1.cpp:213
#define new
Definition: oofDebugNew.h:11
virtual unsigned long width() const
Definition: oofrep1.cpp:1495
virtual OOF_Selection * clone() const =0
oofRepBreakList & headerBreaks()
Definition: oofrep.h:2117
Specify output to simple spaced text stream.
Definition: oofrptxt.h:31
Abstract base for anything drawn on report.
Definition: oofrep.h:860
oofRepBandList mFirstPageFooters
Definition: oofrep.h:645
unsigned short * mReferences
owned
Definition: oofrep.h:664
Tries to hide the different platforms and version issues with standard IO.
void next()
Definition: oofrep.h:2273
virtual void draw(oofRepEnvironment &)
Definition: oofrep1.cpp:479
Convenient mixin if your band is rendered in columns with custom drawing.
Definition: oofrep.h:980
virtual void startTableWrapper()
Definition: oofrep2.cpp:71
Base class for objects that can be serialised out to XML Serialisation allows you to have custom calc...
Definition: oofxmldb.h:28
bool mFinishedConstruction
Definition: oofrep.h:659
oofRepDrawable(oofRepTextStyle *adoptedStyle=0)
Definition: oofrep1.cpp:1216
oofRepMulti & operator<<(oofRep *adoptedReport)
Definition: oofrep1.cpp:984
virtual unsigned long calcPageHeight()=0
unsigned long fixedHeight()
Definition: oofrep1.cpp:1757
oofRepEnvironment * environment() const
Definition: oofrep.h:1900
bool operator==(const oofRepTextStyle &) const
Definition: oofrep1.cpp:1740
void start()
Definition: oofrep.h:2259
virtual bool isMultiReport() const
Definition: oofrep1.cpp:951
virtual void draw()
Definition: oofrep.h:821
bool mResetPageNumber
Definition: oofrep.h:720
void next()
Definition: oofrep.h:2385
virtual void drawPageBorder(long top, long left, long bottom, long right)
Definition: oofrep2.cpp:1266
static void appendElement(oofDE *adoptedDE)
Definition: oofrep1.cpp:2187
virtual oofString signature() const
Definition: oofrep1.cpp:2149
void drawFirstPageFooters()
Definition: oofrep1.cpp:651
Report that contains list of unrelated other reports as oofRepSection's.
Definition: oofrep.h:677
virtual oofRepRenderT renderType() const =0
Base for specifying Win32 GUI drawing environment.
Definition: oofrpWin.h:46
virtual bool more()=0
oofRepBreakList * clone()
Definition: oofrep1.cpp:2060
oofRepTextStyle * uniqueTextStyle()
Get a style unique to this object, cloning the one we'd normally use if necessary.
Definition: oofrep1.cpp:1842
unsigned long bodyHeight()
Definition: oofrep.h:1961
void extract(std::ostream &) const
Definition: oofrep1.cpp:1765
virtual oofRepBlock * clone() const =0
oofRepBlock * value(unsigned long) const
Definition: oofrep.h:2423
oofRepEnvironment * mDrawingEnv
Definition: oofrep.h:656
abstract base for public interface to selections.
Definition: oof2.h:107
oofRepBandList mPageFooters
Definition: oofrep.h:647
virtual void finishConstruction()
Definition: oofrep1.cpp:1466
void becomeCurrent()
Definition: oofrep1.cpp:446
virtual bool shouldDrawViewColumnHeaders() const
Definition: oofrep1.cpp:726
oofRepTextStyle * mStyle
Definition: oofrep.h:805
oofRepRenderT mLastRenderType
Definition: oofrep.h:660
oofRepIterableTreeBand * body()
Definition: oofrep.h:1933
virtual unsigned int countCells() const
Definition: oofrep1.cpp:1638
unsigned long count() const
Definition: oofarray.h:126
const dbField & field(unsigned int) const
Definition: oofview.h:206
unsigned long count() const
Definition: oofrep.h:2392
Special limited oofReceiver which will only ever listen to one oofBroadcaster at a time...
Definition: oofmsg.h:133
virtual oofRepRender * clone(const oofRepDrawable *newOwner) const =0
virtual void draw(oofRepEnvironment &)
Definition: oofrep1.cpp:1010
blockAlignT align() const
Definition: oofrep.h:2205
bool more() const
Definition: oofrep.h:2450
Most commonly used top band in a report.
Definition: oofrep.h:1283
unsigned long count() const
Definition: oofrep.h:2070
virtual oofRepBreak * clone()
Definition: oofrep1.cpp:2135
unsigned short bottomMargin() const
Definition: oofrep3.cpp:401
oofAdornerList & adorners()
Definition: oofadorn.h:354
oofRepIterableTreeBand * useEmptyBody()
Set the main oofRepViewBand to be an empty band.
Definition: oofrep1.cpp:712
oofRepSettings * mSettings
owned
Definition: oofrep.h:657
oofRepBandList & firstPageFooters()
Definition: oofrep.h:1894
virtual void describeLayout()
central default call like draw() but still able to be overriden in extreme cases. ...
Definition: oofrep1.cpp:1265
unsigned long bodyWidth()
Definition: oofrep.h:1968
virtual bool isLayoutBand() const
Definition: oofrep1.cpp:1533
virtual ~oofRepRenderDecorator()
Definition: oofrep1.cpp:1459
Base rendering class.
Definition: oofrep.h:816
virtual void startTableBody()
Definition: oofrep2.cpp:77
oofRepData * mRepData
owned
Definition: oofrep.h:662
void drawPageBreak()
Definition: oofrep1.cpp:658
virtual bool breaks()
Definition: oofrep1.cpp:2142
unsigned long count() const
Definition: oofrep.h:2285
oofRepBand * band() const
Definition: oofrep.h:2513
const OOFmsgT OOFmsg_BroadcasterClosing
Definition: oofmsg.h:40
Maintain the context of report data to reset dbView's etc.
Definition: oofrep1.cpp:174
unsigned long mStartingPageNumber
Definition: oofrep.h:663
unsigned long mPageFooterHeight
Definition: oofrep.h:651
virtual oofRepBreak * clone()=0
bool mPageBreak
Definition: oofrep.h:720
friend class oofRepSection
Definition: oofrep.h:699
const oofRepBlockList & operator=(const oofRepBlockList &)
Definition: oofrep1.cpp:1971
void start()
Definition: oofadorn.h:371
virtual bool breaks()=0
Finish two-stage report init by visiting all items that have finishConstruction methods.
Definition: oofrep1.cpp:90
virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined)
The default receiveMsg behaviour is to delete yourself when the broadcaster closes.
Definition: oofrep1.cpp:221
Specify or calculate a set of column widths & alignments.
Definition: oofsize.h:51
unsigned long mPageHeaderHeight
Definition: oofrep.h:651
const OOF_Selection * internalSelection() const
Definition: oof2.h:317
void drawFirstPageHeaders()
Definition: oofrep1.cpp:627
unsigned long pageHeight()
Definition: oofrep.h:1982
const oofRepSettings * settings() const
Definition: oofrep1.cpp:469
oofRepTextStyle()
mainly used by subclasses for delayed init, must set fontname & size before valid ...
Definition: oofrep1.cpp:1665
Subclass platform preview environment to intercept for editing hooks.
Definition: oofrepeditx.h:368
void next()
Definition: oofrep.h:2457
oofRepSettings * getLocalSettings()
Definition: oofrep1.cpp:453
void finishConstruction()
Definition: oofrep1.cpp:1924
Specify output to HTML stream.
Definition: oofrpHTM.h:27
oofRepBreak(oofRepBand *adoptedBand, bool newPageEveryTime=false)
Definition: oofrep1.cpp:2087
void deleteAllCells(bool alwaysDeleteStorage=false)
Effectively delete cells by resetting mNextFreeEntry cursor.
Definition: oofarray.cpp:219
bool more() const
Definition: oofrep.h:2378
void append(oofRepBand *adoptedBand)
Definition: oofrep1.cpp:1901
Convenient mixin if you want to have a band with table wrappers.
Definition: oofrep.h:963
void setDimensions(oofRepEnvironment &, oofRepMulti *parentReport)
Definition: oofrep1.cpp:1110
oofRepBandList mFirstPageHeaders
Definition: oofrep.h:644
GUI report-writer layer of OOFILE database.
unsigned long count() const
Definition: oofadorn.h:392
unsigned long mFixedWidth
Definition: oofrep.h:1435
unsigned long mFirstPageHeaderHeight
Definition: oofrep.h:651
virtual void VisitBandList(oofRepBandList &)
Definition: oofrep2.cpp:1612
void append(oofRepBlock *adoptedBlock)
Definition: oofrep1.cpp:1999
bool isRelatedClone() const
Definition: oof1.h:2348
Abstracts a drawing environment.
Definition: oofrep.h:406
Provide an iterable set of fields.
Definition: oofview.h:26
void appendReport(oofRep *adoptedReport)
Definition: oofrep1.cpp:958
void ProcessBreakList(oofRepBreakList &inList, bool beforeRecord)
Definition: oofrep1.cpp:817
unsigned long mFirstPageFooterHeight
Definition: oofrep.h:651
void start()
Definition: oofrep.h:2371
List of bands attached to report or other bands, eg: page headers.
Definition: oofrep.h:292
Setup databases for editing.
Definition: oofrep.h:1820
void useRepContext()
Definition: oofrep1.cpp:248
virtual void VisitDrawable(oofRepDrawable *)
Definition: oofrep1.cpp:69
bool mMoveDownAfter
Definition: oofrep.h:1437
virtual ~oofRep()
Definition: oofrep1.cpp:420
virtual oofString plainText(const dbField *)
Called for non-GUI rendering eg: oofRepViewBand_TSVRender::draw.
Definition: oofrep1.cpp:2207
unsigned long mPageNumber
Definition: oofrep.h:658
unsigned short topMargin() const
Definition: oofrep3.cpp:382
unsigned short bandIndenting() const
Definition: oofrep3.cpp:326
virtual void startEnvironment()
Definition: oofrep2.cpp:1246
virtual void finishConstruction()
Definition: oofrep.h:820
void start()
Definition: oofrep.h:2443
virtual bool newPage()
Definition: oofrep1.cpp:2108
virtual oofRepVisitor * makeRepEditingSetupVisitor()
Overrideable factory for editsetup so you can invoke your own code.
Definition: oofrepedit.cpp:768
Base for specifying Macintosh GUI drawing environment.
Definition: oofrepMac.h:51
OOF_repMakeRenderVisitor(oofRepEnvironment &inEnv)
Definition: oofrep1.cpp:55
virtual void makeRender()
Definition: oofrep.h:420
bool keepTogether() const
Definition: oofrep.h:2347
Top level class for a report.
Definition: oofrep.h:571
Convenient mixin if you want to have a band with sub-bands.
Definition: oofrep.h:944
oofRepBandList(keepTogetherT keepTogether=eDefaultTogether)
Definition: oofrep1.cpp:1856
virtual void setCellText(const oofString &, long row=0, short col=0)
Definition: oofrep1.cpp:1655
virtual void start()
Definition: oofrep.h:925
virtual oofRepTextStyle * clone() const
Definition: oofrep1.cpp:1733
virtual ~oofRepBreak()
Definition: oofrep1.cpp:2101
unsigned long oofRepRenderT
Definition: oofrep.h:113
virtual void finishConstruction()
null base method occasionally overriden
Definition: oofrep1.cpp:1242
AdornerContextCode drawWhen()
Definition: oofadorn.h:43
unsigned long minHeight() const
Definition: oofrep.h:2340
unsigned long mBodyStart
Definition: oofrep.h:651
OOF_ExpandableLongArray mSections
Definition: oofrep.h:697
virtual oofRepEditLink * makeEditLink(const oofRepEditingEnv &)
Make an editor for this drawable - by default return a null link.
Definition: oofrep1.cpp:1421
bool moveDownAfter() const
Indicate if a layout band should start a new row of blocks.
Definition: oofrep.h:2215
oofRepData(dbView &)
Definition: oofrep1.cpp:195
void drawSection(oofRepEnvironment &, oofRepMulti *parentReport, unsigned short inSectionNumber)
Definition: oofrep1.cpp:1145
dbSelection currentSelection()
Definition: oof1.cpp:2674
virtual OOF_mixBandWithTableWrappers * asBandWithTableWrappers()
Definition: oofrep1.cpp:1561
virtual void VisitView(dbView *)
Set buffer mode of main table as well as others associated with fields in the view.
Definition: oofrep1.cpp:120
static oofRepPage * currentlyConstructing()
Definition: oofrep.h:2783
void InitRepData(dbTable *)
Definition: oofrep1.cpp:232
unsigned short rightMargin() const
Definition: oofrep3.cpp:363
void drawPageHeaders()
Definition: oofrep1.cpp:596
oofRepBand * mCurrentBand
Definition: oofrep.h:649
visits all report objects.
Definition: oofrep.h:484
void next()
Definition: oofadorn.h:385
virtual void drawSectionBreak()
Definition: oofrep2.cpp:1273
oofRepIterableTreeBand * mTopBand
owned
Definition: oofrep.h:648
virtual oofString getCellText(bool *outIsEditable=0, oofString *outLocationName=0, long row=0, short col=0) const
Definition: oofrep1.cpp:1645
bool more() const
Definition: oofrep.h:2266
const oofRepBandList & operator=(const oofRepBandList &)
Definition: oofrep1.cpp:1870
virtual unsigned short heightOfTextStyle(oofRepTextStyle *)=0
const oofRepBreakList & operator=(const oofRepBreakList &)
Definition: oofrep1.cpp:2048
bool mFirstPage
Definition: oofrep.h:655
virtual OOF_mixColumnarBand * asColumnarBand()
Definition: oofrep1.cpp:1568
unsigned int count() const
Definition: oof1.h:1498
Base class for persistent tables.
Definition: oof1.h:452
unsigned long mFirstPageFootersStartAt
Definition: oofrep.h:651
virtual oofRepBand * clone() const =0
dbTable * fieldTable() const
Definition: oof3.cpp:308
virtual unsigned long width()
Definition: oofrep1.cpp:1282
virtual void endTableBody()
Definition: oofrep2.cpp:83
Portable highly capable string class.
Definition: oofstr.h:101
void finishConstruction()
public so delayed init can be performed by other classes
Definition: oofrep1.cpp:1715
unsigned long fixedWidth()
Definition: oofrep.h:2229
Cross-platform color specification class.
Definition: oofcolor.h:123
oofRepRender * mWrappedRender
Definition: oofrep.h:851
virtual void describeLayout()
Definition: oofrep1.cpp:1481
virtual unsigned long fixedHeight()
Definition: oofrep1.cpp:1507
virtual oofString serialize() const
Definition: oofrep1.cpp:2173
virtual bool preprocessesPageHeadersAndFooters() const
Definition: oofrep2.cpp:1239
void textStyle(oofRepTextStyle *adoptedStyle)
Set style owned by this object.
Definition: oofrep1.cpp:1804
virtual bool canDraw()
Definition: oofrep2.cpp:1225
void resetIteratingBandLevel()
Quick reset for visitors.
Definition: oofrep.h:2015
void drawPageFooters()
Definition: oofrep1.cpp:620
oofRepBreakList(bool ownsBreaks=true)
Definition: oofrep1.cpp:2035
static oofRepSettings * settings()
Definition: oofrep.h:2530
virtual void draw(oofRepDrawable *drawable, unsigned long height, unsigned long width)
Definition: oofadorn.cpp:147
virtual void makeRender(const oofRepMacEnv &)
Definition: oofrep1.cpp:1334
void setSaveOption(const saveOptionsT)
Definition: oof1.cpp:2752
Settings object for overriding behaviours of an instance of oofRep.
Definition: oofrep.h:173
void append(unsigned long)
Definition: oofarray.cpp:131
Specify a fixed-height band that contains a series of oofRepBlock's.
Definition: oofrep.h:1182
Abstract base for a fixed-size block drawn by an oofRepLayoutBand.
Definition: oofrep.h:1408
void append(oofRepBreak *adoptedBreak)
Definition: oofrep1.cpp:2077
oofRepBandList & defaultPageHeaders() const
Definition: oofrep3.cpp:440
oofRepBlockList * clone()
Definition: oofrep1.cpp:1983
Cross-platform specification of text style.
Definition: oofrep.h:732
Abstract report-writer drawing element.
Definition: oofrep.h:1681
virtual void next()=0
oofRepBandList & headers()
Definition: oofrep.h:2134
oofRepBandList mPageHeaders
Definition: oofrep.h:646
oofRepBandList & defaultPageFooters() const
Definition: oofrep3.cpp:458
oofRepRender * mRender
Definition: oofrep.h:901
virtual ~oofRepTextStylable()
Definition: oofrep1.cpp:1794
virtual long leftDrawMargin() const
Definition: oofrep1.cpp:1431
Report elements that may have text style specified.
Definition: oofrep.h:790
oofRep(dbTable *inTableForDefaultBody, unsigned long startingPageNumber=1)
Definition: oofrep1.cpp:279
unsigned long mVerticalPos
Definition: oofrep.h:651
virtual dbView * view(unsigned short whichView=0) const
Request a dbView which may be the source of data for the item.
Definition: oofrep1.cpp:1253
static void registerSerializable()
Definition: oofrep1.cpp:2156
oofAdorner * current()
Definition: oofadorn.h:407
virtual OOF_mixBandWithSubBands * asBandWithSubBands()
Definition: oofrep1.cpp:1554
virtual void endTableWrapper()
Definition: oofrep2.cpp:89
Base object to derive adorners from.
Definition: oofadorn.h:32
virtual ~oofRepDrawable()
Definition: oofrep1.cpp:1232
void DrawBreakList(oofRepBreakList &inList)
Definition: oofrep1.cpp:844
virtual void startSection()
Definition: oofrep2.cpp:1253
Specify output to XML stream.
Definition: oofrpXML.h:57
virtual oofString copyString() const
Definition: oof3.cpp:472
unsigned long bodyEnd()
Definition: oofrep.h:1955
virtual void describeLayout()
Definition: oofrep.h:822
virtual void finishConstruction()
Definition: oofrep1.cpp:2115
unsigned long mHeadersStartAt
Definition: oofrep.h:651
void DrawBandList(oofRepBandList &, bool inBody=true)
Definition: oofrep1.cpp:735
void DrawComplexBand(oofRepBand *)
Draw a single row of the oofRepViewBand.
Definition: oofrep1.cpp:878
virtual unsigned long minHeight()
Definition: oofrep1.cpp:1515
unsigned long OOFmsgT
Definition: oofmsg.h:31
unsigned short leftMargin() const
Definition: oofrep3.cpp:344
oofRepBand * current()
Definition: oofrep.h:2308
oofRepTextStyle * defaultTextStyle() const
Definition: oofrep3.cpp:497
virtual void VisitDrawable(oofRepDrawable *)
Definition: oofrep1.cpp:152
virtual void VisitDrawable(oofRepDrawable *)
Definition: oofrep1.cpp:98
oofRepBand * value(unsigned long) const
Definition: oofrep.h:2316
static oofRep * currentReport()
Definition: oofrep.h:2003
virtual void VisitAdorner(oofAdorner *)
Definition: oofrep1.cpp:77
oofRepBand * mBand
Definition: oofrep.h:1619
virtual void draw()
central default call for drawing, but still able to be overriden in extreme cases.
Definition: oofrep1.cpp:1296
oofRepSection * section(unsigned long) const
Definition: oofrep.h:2077
bool reportAllowsEditing() const
Definition: oofrep.h:2049
virtual unsigned long calcPageWidth()=0
Specify output to Comma-Separated-Values stream.
Definition: oofrpCSV.h:30
List of blocks in an oofRepLayoutBand.
Definition: oofrep.h:336
Visit every report item that can be rendered to invoke makeRender.
Definition: oofrep1.cpp:53
bool mNewPageEveryTime
Definition: oofrep.h:1620
oofRepBreakEveryRecord(oofRepBand *adoptedBand=0, bool newPageEveryTime=false)
Definition: oofrep1.cpp:2128
void decrementIteratingBandLevel()
Call when visiting tree enters band implementing OOF_mixIterableBand.
Definition: oofrep.h:2035
oofRepBlock(oofRepTextStyle *adoptedStyle=0)
Definition: oofrep1.cpp:1579
unsigned long mBodyWidth
Definition: oofrep.h:651
unsigned long count() const
Definition: oofrep.h:2464
Single page in a report writer preview window.
Definition: oofrep.h:1758
Specify output to Tab-Separated-Values stream.
Definition: oofrpTSV.h:31
void appendElement(oofDE *adoptedElement)
Definition: oofrep.h:2776
static oofRepSettings * defaultSettings()
Definition: oofrep1.cpp:462
Specify output to MS Word-compatible Rich Text stream.
Definition: oofrpRTF.h:31
virtual void visit(oofRep *)
Top-level that iterates all the others, encapsulating report structure.
Definition: oofrep2.cpp:1490
static void registerDefaultMake(const oofString &signature, oofSerializableFactoryFunction)
Definition: oofxmldb.cpp:838
unsigned long mPageWidth
Definition: oofrep.h:651
oofRepBreak * current()
Definition: oofrep.h:2487
dbTable * table() const
Definition: oofview.h:109
Calculation attached to an oofRepBand.
Definition: oofrep.h:1604
virtual bool isMultiReport() const
Definition: oofrep1.cpp:438
void describe(std::ostream &)
Definition: oofrep1.cpp:927
oofRepBlock * current()
Definition: oofrep.h:2415
Base class for persistent fields in dbTable's.
Definition: oof3.h:63
oofRepSection * orphanSection(unsigned long)
Definition: oofrep1.cpp:1001
virtual long leftDrawMargin() const
Definition: oofrep1.cpp:1488
virtual void endEnvironment()
Definition: oofrep2.cpp:1260
unsigned long value(unsigned long index) const
Definition: oofarray.cpp:243
Abstract base for report bands.
Definition: oofrep.h:1026
Wrapper for a report contained within an oofRepMulti.
Definition: oofrep.h:707
Abstract base classes for report renderers.
List of Breaks attached to a report band.
Definition: oofrep.h:368
void describe(std::ostream &)
Definition: oofrep3.cpp:613
oofRepTextStylable(const char *fontName, unsigned short fontSize, unsigned char styleNum=0, short leading=0, oofColor color=oofColor::Black)
Definition: oofrep1.cpp:1780
unsigned long fixedHeight()
Definition: oofrep1.cpp:2006
static oofSerializable * makeBreak(const oofString &)
Definition: oofrep1.cpp:2165