xref: /trunk/main/sfx2/inc/sfx2/sfxdlg.hxx (revision 353d8f4d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SFX2_DIALOG_HXX
24 #define _SFX2_DIALOG_HXX
25 
26 #include "sal/config.h"
27 #include "sfx2/dllapi.h"
28 
29 #include <vcl/abstdlg.hxx>
30 #include <com/sun/star/embed/XEmbeddedObject.hpp>
31 #include <com/sun/star/embed/XStorage.hpp>
32 #include <com/sun/star/frame/XFrame.hpp>
33 
34 #include <sot/exchange.hxx>
35 #include <sfx2/lnkbase.hxx>
36 #include <com/sun/star/uno/Any.hxx>
37 #include <com/sun/star/uno/Reference.h>
38 
39 class SfxTabPage;
40 class SfxViewFrame;
41 class SfxBindings;
42 class SfxItemSet;
43 class ResId;
44 class Window;
45 class String;
46 class SfxItemPool;
47 class SvObjectServerList;
48 class TransferableDataHelper;
49 struct TransferableObjectDescriptor;
50 
51 #include <sfx2/tabdlg.hxx>
52 //typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
53 //typedef sal_uInt16*		(*GetTabPageRanges)();
54 
55 namespace sfx2
56 {
57     class LinkManager;
58 }
59 
60 namespace com { namespace sun { namespace star { namespace frame {
61     class XModel;
62 } } } }
63 
64 class SfxAbstractDialog : public VclAbstractDialog
65 {
66 public:
67 	virtual const SfxItemSet* 	GetOutputItemSet() const = 0;
68 	virtual void				SetText( const XubString& rStr ) = 0;
69     virtual String   			GetText() const = 0;
70 };
71 
72 class SfxAbstractTabDialog : public SfxAbstractDialog
73 {
74 public:
75 	virtual void				SetCurPageId( sal_uInt16 nId ) = 0;
76 	virtual const sal_uInt16*		GetInputRanges( const SfxItemPool& ) = 0;
77 	virtual void				SetInputSet( const SfxItemSet* pInSet ) = 0;
78 };
79 
80 class SfxAbstractInsertObjectDialog : public VclAbstractDialog
81 {
82 public:
83     virtual com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()=0;
84 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType )=0;
85     virtual sal_Bool IsCreateNew()=0;
86 };
87 
88 class SfxAbstractPasteDialog : public VclAbstractDialog
89 {
90 public:
91     virtual void Insert( SotFormatStringId nFormat, const String & rFormatName ) = 0;
92     virtual void SetObjName( const SvGlobalName & rClass, const String & rObjName ) = 0;
93     virtual sal_uIntPtr GetFormat( const TransferableDataHelper& aHelper,
94                         const DataFlavorExVector* pFormats=0,
95                         const TransferableObjectDescriptor* pDesc=0 ) = 0;
96 };
97 
98 class SfxAbstractLinksDialog : public VclAbstractDialog
99 {
100 };
101 
102 class AbstractScriptSelectorDialog : public VclAbstractDialog
103 {
104 public:
105 	virtual String				GetScriptURL() const = 0;
106 	virtual void				SetRunLabel() = 0;
107 };
108 
109 namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
110 
111 class SFX2_DLLPUBLIC SfxAbstractDialogFactory : virtual public VclAbstractDialogFactory
112 {
113 public:
114 										virtual ~SfxAbstractDialogFactory();	// needed for export of vtable
115 	static SfxAbstractDialogFactory* 	Create();
116     virtual VclAbstractDialog*          CreateSfxDialog( Window* pParent, const SfxBindings& rBindings, sal_uInt32 nResId ) = 0;
117     virtual VclAbstractDialog*          CreateFrameDialog( Window* pParent, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, sal_uInt32 nResId, const String& rParameter ) = 0;
118 	virtual SfxAbstractTabDialog*		CreateTabDialog( sal_uInt32 nResId,
119 											Window* pParent,
120 											const SfxItemSet* pAttrSet,
121 											SfxViewFrame* pViewFrame,
122 											bool bEditFmt=false,
123 											const String *pUserButtonText=0 ) = 0;
124 	virtual SfxAbstractTabDialog*		CreateTabDialog( sal_uInt32 nResId,
125 											Window* pParent,
126 											const SfxItemSet* pAttrSet,
127 											const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xViewFrame,
128 											bool bEditFmt=false,
129 											const String *pUserButtonText=0 ) = 0;
130 	virtual CreateTabPage				GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
131 	virtual GetTabPageRanges			GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
132     virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, const rtl::OUString& rCommand,
133             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStor,
134             const SvObjectServerList* pList = 0 )=0;
135     virtual VclAbstractDialog*          CreateEditObjectDialog( Window* pParent, const rtl::OUString& rCommand,
136             const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj )=0;
137     virtual  SfxAbstractPasteDialog*         CreatePasteDialog( Window* pParent )=0;
138     virtual  SfxAbstractLinksDialog*         CreateLinksDialog( Window* pParent, sfx2::LinkManager* pMgr, sal_Bool bHTML=sal_False, sfx2::SvBaseLink* p=0 )=0;
139     virtual VclAbstractDialog *         CreateSvxScriptOrgDialog( Window* pParent,  const String& rLanguage ) = 0;
140 
141     virtual AbstractScriptSelectorDialog*
142 		CreateScriptSelectorDialog(
143 			Window* pParent,
144             sal_Bool bShowSlots,
145             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
146         ) = 0;
147 
148     virtual VclAbstractDialog* CreateScriptErrorDialog(
149 		Window* pParent, com::sun::star::uno::Any aException ) = 0;
150 
151     virtual VclAbstractDialog*  CreateOptionsDialog(
152         Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext ) = 0;
153 };
154 
155 #endif
156 
157