Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / swabstdlg.hxx
blobcb5ec2feb3f564068c7859dbc4d3b4a9247ffe97
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_SWABSTDLG_HXX
20 #define INCLUDED_SW_INC_SWABSTDLG_HXX
22 #include <rtl/ustring.hxx>
23 #include <tools/solar.h>
24 #include <sfx2/sfxdlg.hxx>
25 #include <svx/svxdlg.hxx>
26 #include <vcl/syswin.hxx>
27 #include <globals.hrc>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/uno/Sequence.h>
30 #include <com/sun/star/frame/XModel.hpp>
31 #include <com/sun/star/frame/XController.hpp>
32 #include <com/sun/star/text/XTextCursor.hpp>
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #include <com/sun/star/awt/XControl.hpp>
35 #include <com/sun/star/container/XNamed.hpp>
36 #include "itabenum.hxx"
37 #include <boost/optional.hpp>
38 #include "dbmgr.hxx"
40 class SfxViewFrame;
41 class SfxBindings;
42 class SfxItemSet;
43 class ResId;
44 namespace vcl { class Window; }
45 class SfxItemPool;
46 class SfxStyleSheetBase;
47 class SwGlossaryHdl;
48 class SwField;
50 class SwLabFormatPage;
51 class SwLabRec;
52 class SwAsciiOptions;
53 class SwDocShell;
54 class SvStream;
55 class SwWrtShell;
56 class SfxRequest;
57 class SwView;
58 class SwTableAutoFormat;
59 class SwTOXMgr;
60 class SwForm;
61 struct CurTOXType;
62 class SwTOXDescription;
63 class SwTOXBase;
64 class SwSectionData;
65 struct SwDBData;
66 class SwField;
67 class Printer;
68 class SwLabItem;
69 class SwDBManager;
70 class SwTableFUNC;
71 class SwChildWinWrapper;
72 struct SfxChildWinInfo;
73 class SwTOXMark;
74 struct SwDocStat;
75 enum class SwBorderModes;
76 #include <cnttab.hxx>
78 namespace com{namespace sun{namespace star{
79 namespace frame{
80 class XFrame;
82 namespace sdbcx{
83 class XColumnsSupplier;
85 namespace sdbc{
86 class XDataSource;
87 class XConnection;
88 class XResultSet;
90 }}}
92 typedef void (*SwLabDlgMethod) (::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel, const SwLabItem& rItem);
94 typedef OUString (*GlossaryGetCurrGroup)();
95 typedef void (*GlossarySetActGroup)(const OUString& rNewGroup);
97 class AbstractGlossaryDlg : public VclAbstractDialog
99 public:
100 virtual OUString GetCurrGrpName() const = 0;
101 virtual OUString GetCurrShortName() const = 0;
104 class AbstractFieldInputDlg : public VclAbstractTerminatedDialog
106 public:
107 //from class SalFrame
108 virtual void SetWindowState( const OString & rStr ) = 0;
109 virtual OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0;
110 virtual void EndDialog(long ) SAL_OVERRIDE = 0;
113 class AbstractInsFootNoteDlg : public VclAbstractDialog
115 public:
116 virtual OUString GetFontName() = 0;
117 virtual bool IsEndNote() = 0;
118 virtual OUString GetStr() = 0;
119 //from class Window
120 virtual void SetHelpId( const OString& sHelpId ) = 0;
121 virtual void SetText( const OUString& rStr ) = 0;
124 class AbstractInsTableDlg : public VclAbstractDialog
126 public:
127 virtual void GetValues( OUString& rName, sal_uInt16& rRow, sal_uInt16& rCol,
128 SwInsertTableOptions& rInsTableFlags, OUString& rTableAutoFormatName,
129 SwTableAutoFormat *& prTAFormat ) = 0;
132 class AbstractJavaEditDialog : public VclAbstractDialog
134 public:
135 virtual OUString GetScriptText() const = 0;
136 virtual OUString GetScriptType() const = 0;
137 virtual bool IsUrl() const = 0;
138 virtual bool IsNew() const = 0;
139 virtual bool IsUpdate() const = 0;
142 class AbstractMailMergeDlg : public VclAbstractDialog
144 public:
145 virtual DBManagerOptions GetMergeType() = 0;
146 virtual const OUString& GetSaveFilter() const = 0;
147 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const = 0;
148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const = 0;
149 virtual bool IsSaveSingleDoc() const = 0;
150 virtual bool IsGenerateFromDataBase() const = 0;
151 virtual OUString GetColumnName() const = 0;
152 virtual OUString GetPath() const = 0;
155 class AbstractMailMergeCreateFromDlg : public VclAbstractDialog
157 public:
158 virtual bool IsThisDocument() const = 0;
160 class AbstractMailMergeFieldConnectionsDlg : public VclAbstractDialog
162 public:
163 virtual bool IsUseExistingConnections() const = 0;
166 class AbstractMultiTOXTabDialog : public VclAbstractDialog
168 public:
169 virtual SwForm* GetForm(CurTOXType eType) = 0;
170 virtual CurTOXType GetCurrentTOXType() const = 0;
171 virtual SwTOXDescription& GetTOXDescription(CurTOXType eTOXTypes) = 0;
172 //from SfxTabDialog
173 virtual const SfxItemSet* GetOutputItemSet() const = 0;
176 class AbstractEditRegionDlg : public VclAbstractDialog
178 public:
179 virtual void SelectSection(const OUString& rSectionName) = 0;
181 class AbstractInsertSectionTabDialog : public VclAbstractDialog
183 public:
184 virtual void SetSectionData(SwSectionData const& rSect) = 0;
187 class AbstractSwWordCountFloatDlg : public VclAbstractDialog
189 public:
190 virtual void UpdateCounts() = 0;
191 virtual void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat) = 0;
192 virtual vcl::Window * GetWindow() = 0; //this method is added for return a Window type pointer
195 class AbstractSwInsertAbstractDlg : public VclAbstractDialog
197 public:
198 virtual sal_uInt8 GetLevel() const = 0;
199 virtual sal_uInt8 GetPara() const = 0;
202 class AbstractSwAsciiFilterDlg : public VclAbstractDialog
204 public:
205 virtual void FillOptions( SwAsciiOptions& rOptions ) = 0;
209 class AbstractSwBreakDlg : public VclAbstractDialog
211 public:
212 virtual OUString GetTemplateName() = 0;
213 virtual sal_uInt16 GetKind() = 0;
214 virtual ::boost::optional<sal_uInt16> GetPageNumber() = 0;
218 class AbstractSplitTableDialog : public VclAbstractDialog // add for
220 public:
221 virtual sal_uInt16 GetSplitMode() = 0;
224 class AbstractSwConvertTableDlg : public VclAbstractDialog
226 public:
227 virtual void GetValues( sal_Unicode& rDelim,
228 SwInsertTableOptions& rInsTableFlags,
229 SwTableAutoFormat const*& prTAFormat ) = 0;
232 class AbstractSwInsertDBColAutoPilot : public VclAbstractDialog
234 public:
236 virtual void DataToDoc( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rSelection,
237 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource,
238 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> xConnection,
239 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet) = 0;
242 class AbstractDropDownFieldDialog : public VclAbstractDialog
244 public:
245 virtual OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0; //this method inherit from SystemWindow
246 virtual void SetWindowState( const OString & rStr ) =0;//this method inherit from SystemWindow
249 class AbstractSwLabDlg : public SfxAbstractTabDialog
251 public:
252 virtual const OUString& GetBusinessCardStr() const = 0;
253 virtual Printer *GetPrt() =0;
256 class AbstractSwSelGlossaryDlg : public VclAbstractDialog
258 public:
259 virtual void InsertGlos(const OUString &rRegion, const OUString &rGlosName) = 0; // inline
260 virtual sal_Int32 GetSelectedIdx() const = 0; // inline
261 virtual void SelectEntryPos(sal_Int32 nIdx) = 0; // inline
264 class AbstractSwAutoFormatDlg : public VclAbstractDialog
266 public:
267 virtual void FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const = 0;
270 class AbstractSwFieldDlg : public SfxAbstractTabDialog
272 public:
273 virtual void Start( bool bShow = true ) = 0; //this method from sfxtabdialog
274 virtual void Initialize(SfxChildWinInfo *pInfo) = 0;
275 virtual void ReInitDlg() = 0;
276 virtual void ActivateDatabasePage() = 0;
277 virtual void ShowReferencePage() = 0;
278 virtual vcl::Window * GetWindow() = 0; //this method is added for return a Window type pointer
281 class AbstractSwRenameXNamedDlg : public VclAbstractDialog
283 public:
284 virtual void SetForbiddenChars( const OUString& rSet ) = 0;
285 virtual void SetAlternativeAccess(
286 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xSecond,
287 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xThird ) = 0;
290 class AbstractSwModalRedlineAcceptDlg : public VclAbstractDialog
292 public:
293 virtual void AcceptAll( bool bAccept ) = 0;
296 class AbstractMarkFloatDlg : public VclAbstractDialog
298 public:
299 virtual void ReInitDlg(SwWrtShell& rWrtShell) = 0;
300 virtual vcl::Window * GetWindow() = 0; //this method is added for return a Window type pointer
303 #define RET_LOAD_DOC 100
304 #define RET_EDIT_DOC 101
305 #define RET_EDIT_RESULT_DOC 102
306 #define RET_TARGET_CREATED 103
307 #define RET_REMOVE_TARGET 104
309 class SwView;
310 class SwMailMergeConfigItem;
312 class AbstractMailMergeWizard : public VclAbstractDialog2
314 public:
315 virtual void SetReloadDocument(const OUString& rURL) = 0;
316 virtual OUString GetReloadDocument() const = 0;
317 virtual bool ShowPage( sal_uInt16 nLevel ) = 0;
318 virtual sal_uInt16 GetRestartPage() const = 0;
321 class SwAbstractDialogFactory
323 public:
324 static SwAbstractDialogFactory* Create();
326 virtual SfxAbstractDialog* CreateSfxDialog( vcl::Window* pParent,
327 const SfxItemSet& rAttr,
328 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,
329 sal_uInt32 nResId
330 ) = 0;
331 virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings,
332 SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) = 0;
334 virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg(vcl::Window* pParent) = 0;
335 virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( vcl::Window* pParent, SwDocShell& rDocSh,
336 SvStream* pStream ) = 0;
337 virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId ) = 0;
339 virtual AbstractSwBreakDlg * CreateSwBreakDlg(vcl::Window *pParent, SwWrtShell &rSh) = 0;
340 virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw) = 0;
341 virtual SfxAbstractTabDialog * CreateSwCharDlg(vcl::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
342 sal_uInt8 nDialogMode, const OUString* pFormatStr = 0) = 0;
343 virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0;
344 virtual VclAbstractDialog * CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId) = 0;
346 virtual AbstractSwInsertDBColAutoPilot* CreateSwInsertDBColAutoPilot(SwView& rView,
347 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource,
348 com::sun::star::uno::Reference<com::sun::star::sdbcx::XColumnsSupplier> xColSupp,
349 const SwDBData& rData) = 0;
350 virtual SfxAbstractTabDialog * CreateSwFootNoteOptionDlg(vcl::Window *pParent, SwWrtShell &rSh) = 0;
352 virtual AbstractDropDownFieldDialog * CreateDropDownFieldDialog(vcl::Window *pParent, SwWrtShell &rSh,
353 SwField* pField, bool bNextButton = false) = 0;
354 virtual SfxAbstractTabDialog* CreateSwEnvDlg ( vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, bool bInsert ) = 0;
356 virtual AbstractSwLabDlg* CreateSwLabDlg(vcl::Window* pParent, const SfxItemSet& rSet,
357 SwDBManager* pDBManager, bool bLabel) = 0;
359 virtual SwLabDlgMethod GetSwLabDlgStaticMethod () =0;
361 virtual SfxAbstractTabDialog* CreateSwParaDlg ( vcl::Window *pParent,
362 SwView& rVw,
363 const SfxItemSet& rCoreSet,
364 sal_uInt8 nDialogMode,
365 const OUString *pCollName = 0,
366 bool bDraw = false,
367 const OString& sDefPage = OString() ) = 0;
369 virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(vcl::Window * pParent, const OUString &rShortName) = 0;
371 virtual VclAbstractDialog * CreateVclAbstractDialog ( vcl::Window * pParent, SwWrtShell &rSh, int nResId ) = 0;
372 virtual AbstractSplitTableDialog * CreateSplitTableDialog ( vcl::Window * pParent, SwWrtShell &rSh ) = 0;
374 virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( vcl::Window* pParent, SwWrtShell* pShell,
375 bool bSetAutoFormat = true,
376 const SwTableAutoFormat* pSelFormat = 0 ) = 0;
377 virtual SfxAbstractDialog * CreateSwBorderDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwBorderModes nType, int nResId ) = 0;
378 virtual SfxAbstractDialog * CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, bool bDrawMode, int nResId ) = 0;
380 virtual VclAbstractDialog * CreateSwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rFnc) = 0;
381 virtual SfxAbstractTabDialog* CreateSwTableTabDlg(vcl::Window* pParent, SfxItemPool& Pool,
382 const SfxItemSet* pItemSet, SwWrtShell* pSh) = 0;
384 virtual AbstractSwFieldDlg * CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) = 0;
385 virtual SfxAbstractDialog* CreateSwFieldEditDlg ( SwView& rVw, int nResId ) = 0;
386 virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg(vcl::Window* pParent,
387 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed,
388 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess) = 0;
389 virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) = 0;
391 virtual VclAbstractDialog* CreateTableMergeDialog( vcl::Window* pParent, bool& rWithPrev ) = 0;
392 virtual SfxAbstractTabDialog* CreateFrmTabDialog(const OUString &rDialogType,
393 SfxViewFrame *pFrame, vcl::Window *pParent,
394 const SfxItemSet& rCoreSet,
395 bool bNewFrm = true,
396 bool bFormat = false,
397 const OString& sDefPage = OString(),
398 const OUString* pFormatStr = 0) = 0;
399 /// @param nSlot
400 /// Identifies optional Slot by which the creation of the Template (Style) dialog is triggered.
401 /// Currently used, if nRegion == SFX_STYLE_FAMILY_PAGE in order to activate certain dialog pane
402 virtual SfxAbstractApplyTabDialog* CreateTemplateDialog(
403 vcl::Window* pParent,
404 SfxStyleSheetBase& rBase,
405 sal_uInt16 nRegion,
406 const OString& sPage = OString(),
407 SwWrtShell* pActShell = 0,
408 bool bNew = false) = 0;
409 virtual AbstractGlossaryDlg* CreateGlossaryDlg(SfxViewFrame* pViewFrame,
410 SwGlossaryHdl* pGlosHdl,
411 SwWrtShell *pWrtShell) = 0;
412 virtual AbstractFieldInputDlg* CreateFieldInputDlg(vcl::Window *pParent,
413 SwWrtShell &rSh, SwField* pField, bool bNextButton = false) = 0;
414 virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg(vcl::Window * pParent,
415 SwWrtShell &rSh, bool bEd = false) = 0;
416 virtual VclAbstractDialog* CreateTitlePageDlg ( vcl::Window * pParent ) = 0;
417 virtual VclAbstractDialog * CreateVclSwViewDialog(SwView& rView) = 0;
418 virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0;
419 virtual AbstractJavaEditDialog* CreateJavaEditDialog(vcl::Window* pParent,
420 SwWrtShell* pWrtSh) = 0;
421 virtual AbstractMailMergeDlg* CreateMailMergeDlg( int nResId,
422 vcl::Window* pParent, SwWrtShell& rSh,
423 const OUString& rSourceName,
424 const OUString& rTableName,
425 sal_Int32 nCommandType,
426 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection,
427 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ) = 0;
428 virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
429 virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) = 0;
430 virtual VclAbstractDialog* CreateMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr &rTOXMgr) = 0;
431 virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
432 vcl::Window* pParent,
433 const SfxItemSet* pSwItemSet,
434 SwWrtShell &) = 0;
435 virtual AbstractMultiTOXTabDialog* CreateMultiTOXTabDialog(
436 vcl::Window* pParent, const SfxItemSet& rSet,
437 SwWrtShell &rShell,
438 SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX,
439 bool bGlobal = false) = 0;
440 virtual AbstractEditRegionDlg* CreateEditRegionDlg(vcl::Window* pParent, SwWrtShell& rWrtSh) = 0;
441 virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog(
442 vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) = 0;
443 virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg(
444 SfxBindings* pBindings,
445 SfxChildWindow* pChild,
446 vcl::Window *pParent,
447 SfxChildWinInfo* pInfo,
448 bool bNew=true) = 0;
449 virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg(
450 SfxBindings* pBindings,
451 SfxChildWindow* pChild,
452 vcl::Window *pParent,
453 SfxChildWinInfo* pInfo,
454 bool bNew=true) = 0;
455 virtual VclAbstractDialog * CreateIndexMarkModalDlg(
456 vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) = 0;
458 virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem) = 0;
460 virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc() = 0;
461 virtual GlossarySetActGroup SetGlossaryActGroupFunc() = 0;
463 // for tabpage
464 virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
465 virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
467 protected:
468 ~SwAbstractDialogFactory() {}
471 #endif
473 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */