Kaydet (Commit) d1660f19 authored tarafından Caolán McNamara's avatar Caolán McNamara

an app can have print options without a print options dialog

e.g. draw and impress have print options, but no print options dialog

(It's plausible that we should merge the print options in the print dialog with
the print options in the options... dialog of the printer settings dialog)

Change-Id: I25c029ad8ba482b1e8d8d5974cc8de99584b9a55
üst 8dd1581a
...@@ -110,7 +110,8 @@ public: ...@@ -110,7 +110,8 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false ); virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
void AddAccessibilityObject( SfxListener& rObject ); void AddAccessibilityObject( SfxListener& rObject );
......
...@@ -353,6 +353,7 @@ public: ...@@ -353,6 +353,7 @@ public:
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter,
sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
void ConnectObject( SdrOle2Obj* pObj ); void ConnectObject( SdrOle2Obj* pObj );
......
...@@ -570,6 +570,11 @@ sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff ...@@ -570,6 +570,11 @@ sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
return pDocShell->SetPrinter( pNewPrinter, nDiffFlags ); return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
} }
bool ScPreviewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{ {
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
......
...@@ -1093,6 +1093,11 @@ sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff ...@@ -1093,6 +1093,11 @@ sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags ); return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
} }
bool ScTabViewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{ {
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
......
...@@ -139,11 +139,6 @@ public: ...@@ -139,11 +139,6 @@ public:
SfxPrinter* pNewPrinter, SfxPrinter* pNewPrinter,
sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false); sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false);
/// Forwarded to the print manager.
virtual SfxTabPage* CreatePrintOptionsPage (
::Window *pParent,
const SfxItemSet &rOptions);
/// Forward methods to main sub shell. /// Forward methods to main sub shell.
virtual void WriteUserDataSequence ( virtual void WriteUserDataSequence (
::com::sun::star::uno::Sequence < ::com::sun::star::uno::Sequence <
......
...@@ -626,18 +626,6 @@ sal_uInt16 ViewShellBase::SetPrinter ( ...@@ -626,18 +626,6 @@ sal_uInt16 ViewShellBase::SetPrinter (
SfxTabPage* ViewShellBase::CreatePrintOptionsPage(
::Window *pParent,
const SfxItemSet &rOptions)
{
(void)pParent;
(void)rOptions;
return NULL;
}
void ViewShellBase::UIActivating( SfxInPlaceClient* pClient ) void ViewShellBase::UIActivating( SfxInPlaceClient* pClient )
{ {
mpImpl->ShowViewTabBar(false); mpImpl->ShowViewTabBar(false);
......
...@@ -214,7 +214,8 @@ public: ...@@ -214,7 +214,8 @@ public:
// Printing Interface // Printing Interface
virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False ); virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=sal_False ); virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=sal_False );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
virtual JobSetup GetJobSetup() const; virtual JobSetup GetJobSetup() const;
Printer* GetActivePrinter() const; Printer* GetActivePrinter() const;
......
...@@ -829,7 +829,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) ...@@ -829,7 +829,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// execute PrinterSetupDialog // execute PrinterSetupDialog
PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() ); PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
if (pImp->m_bHasPrintOptions) if (pImp->m_bHasPrintOptions && HasPrintOptionsPage())
{ {
// additional controls for dialog // additional controls for dialog
pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg ); pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
...@@ -919,6 +919,11 @@ SfxTabPage* SfxViewShell::CreatePrintOptionsPage ...@@ -919,6 +919,11 @@ SfxTabPage* SfxViewShell::CreatePrintOptionsPage
return 0; return 0;
} }
bool SfxViewShell::HasPrintOptionsPage() const
{
return false;
}
JobSetup SfxViewShell::GetJobSetup() const JobSetup SfxViewShell::GetJobSetup() const
{ {
return JobSetup(); return JobSetup();
......
...@@ -266,6 +266,7 @@ protected: ...@@ -266,6 +266,7 @@ protected:
bool Insert( SfxMedium& rMedium ); bool Insert( SfxMedium& rMedium );
bool InsertFrom(SfxMedium &rMedium); bool InsertFrom(SfxMedium &rMedium);
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage *CreatePrintOptionsPage(Window *pParent, virtual SfxTabPage *CreatePrintOptionsPage(Window *pParent,
const SfxItemSet &rOptions); const SfxItemSet &rOptions);
virtual void Deactivate(sal_Bool IsMDIActivate); virtual void Deactivate(sal_Bool IsMDIActivate);
......
...@@ -1381,6 +1381,10 @@ sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlag ...@@ -1381,6 +1381,10 @@ sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlag
return 0; return 0;
} }
bool SmViewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* SmViewShell::CreatePrintOptionsPage(Window *pParent, SfxTabPage* SmViewShell::CreatePrintOptionsPage(Window *pParent,
const SfxItemSet &rOptions) const SfxItemSet &rOptions)
......
...@@ -211,7 +211,8 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell ...@@ -211,7 +211,8 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False ); SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SW_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); SW_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
SW_DLLPRIVATE virtual bool HasPrintOptionsPage() const;
SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions ); const SfxItemSet &rOptions );
......
...@@ -329,13 +329,14 @@ class SW_DLLPUBLIC SwView: public SfxViewShell ...@@ -329,13 +329,14 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 ); SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell ); SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
SW_DLLPRIVATE sal_Bool CheckSpecialCntnt(); SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True) SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
{ bCenterCrsr = bOn; bAllwaysShowSel = bOn; } { bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
// methods for printing // methods for printing
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False ); SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SfxTabPage* CreatePrintOptionsPage( Window* pParent, SW_DLLPRIVATE virtual bool HasPrintOptionsPage() const;
SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window* pParent,
const SfxItemSet& rSet); const SfxItemSet& rSet);
// for readonly switching // for readonly switching
SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
......
...@@ -1759,6 +1759,11 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, ...@@ -1759,6 +1759,11 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
return 0; return 0;
} }
bool SwPagePreView::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent, SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions ) const SfxItemSet &rOptions )
{ {
......
...@@ -141,6 +141,11 @@ sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) ...@@ -141,6 +141,11 @@ sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
return 0; return 0;
} }
bool SwView::HasPrintOptionsPage() const
{
return true;
}
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Beschreibung: TabPage fuer applikationsspezifische Druckoptionen Beschreibung: TabPage fuer applikationsspezifische Druckoptionen
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment