diff options
author | Thomas Lange <tl@openoffice.org> | 2009-08-21 06:14:34 +0000 |
---|---|---|
committer | Thomas Lange <tl@openoffice.org> | 2009-08-21 06:14:34 +0000 |
commit | 9e095aec061c14b180f88bd5d7b2ea6bef19d4f9 (patch) | |
tree | 7bb75a39ed5a1359200e0ce760553683a2cbb498 /sw/inc | |
parent | 00eb1cf049970426333503731f6102909555b484 (diff) |
#i101242# new print UI in sw
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/doc.hxx | 7 | ||||
-rw-r--r-- | sw/inc/printdata.hxx | 73 |
2 files changed, 60 insertions, 20 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d2ec00c8ad0c..b9726a08ee4b 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -219,6 +219,7 @@ class SwChartLockController_Helper; class IGrammarContact; class SwPrintData; class SwPageFrm; +class SwViewOption; namespace sw { namespace mark { class MarkManager; @@ -1336,9 +1337,11 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void CalculatePagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rOptions, + void CalculatePagesForPrinting( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); - void CalculatePagePairsForProspectPrinting( SwPrintUIOptions &rOptions, + void UpdatePagesForPrintingWithPostItData( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, + sal_Int32 nDocPageCount ); + void CalculatePagePairsForProspectPrinting( /* out */ SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 3ff07102733a..ed463a6cb28c 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -41,6 +41,12 @@ #include <utility> class SwPageFrm; +class SwDoc; +class ViewShell; +class _SetGetExpFlds; +class SwViewOption; +class OutputDevice; + //////////////////////////////////////////////////////////// @@ -51,16 +57,28 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper // pages valid for printing (according to the current settings) // and their respective start frames (see getRendererCount in unotxdoc.cxx) // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! - std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) - std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages + std::set< sal_Int32 > m_aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > m_aValidStartFrms; // the map of start frames for those pages // vector of pages and their order to be printed (duplicates and any order allowed!) // (see 'render' in unotxdoc.cxx) - std::vector< sal_Int32 > aPagesToPrint; + std::vector< sal_Int32 > m_aPagesToPrint; + + std::vector< const SwPageFrm * > m_aPostItStartFrame; // for prospect printing: the pairs of pages to be printed together on a single prospect page. // -1 indicates a half page to be left empty. - std::vector< std::pair< sal_Int32, sal_Int32 > > aPagePairs; + std::vector< std::pair< sal_Int32, sal_Int32 > > m_aPagePairs; + + rtl::OUString m_PageRange; + +public: + + // PostIt relevant data + _SetGetExpFlds * m_pPostItFields; + SwDoc * m_pPostItDoc; + ViewShell * m_pPostItShell; + public: SwPrintUIOptions( BOOL bWeb = FALSE ); @@ -68,28 +86,47 @@ public: bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; + + bool HasPostItData() const { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; } + void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); + void DeletePostItData(); + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; - std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } - const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } - ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } - const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + std::set< sal_Int32 > & GetValidPagesSet() { return m_aValidPages; } + const std::set< sal_Int32 > & GetValidPagesSet() const { return m_aValidPages; } + ValidStartFramesMap_t & GetValidStartFrms() { return m_aValidStartFrms; } + const ValidStartFramesMap_t & GetValidStartFrms() const { return m_aValidStartFrms; } // used for 'normal' printing - std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } - const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } + // A page value of 0 as entry indicates that this page is not from the document but + // from the post-it document. (See also GetPostItStartFrame below) + std::vector< sal_Int32 > & GetPagesToPrint() { return m_aPagesToPrint; } + const std::vector< sal_Int32 > & GetPagesToPrint() const { return m_aPagesToPrint; } + + // used for 'normal' printing with post-its + // - if the vector entry will be NULL then the respective page to be printed is from + // the document. In that case use the value from GetPagesToPrint at the same index to + // get the phys. page number to be printed, and then retrieve the start frame to use + // from GetValidStartFrms. + // - If the entry is not NULL it is the start frame of the page from the post-it document + // that is to be printed + std::vector< const SwPageFrm * > & GetPostItStartFrame() { return m_aPostItStartFrame; } + const std::vector< const SwPageFrm * > & GetPostItStartFrame() const { return m_aPostItStartFrame; } // used for prospect printing only - PagePairsVec_t & GetPagePairsForProspectPrinting() { return aPagePairs; } - const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return aPagePairs; } + PagePairsVec_t & GetPagePairsForProspectPrinting() { return m_aPagePairs; } + const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return m_aPagePairs; } - bool IsPrintLeftPages() const; - bool IsPrintRightPages() const; - bool IsPrintEmptyPages( bool bIsPDFExport ) const; - bool IsPrintTables() const; - bool IsPrintGraphics() const; - bool IsPrintDrawings() const; + rtl::OUString GetPageRange() const { return m_PageRange; } + void SetPageRange( const rtl::OUString &rRange ) { m_PageRange = rRange; } }; |