Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SD_DRAW_DOC_SHELL_HXX
30 : : #define SD_DRAW_DOC_SHELL_HXX
31 : :
32 : : #include <sfx2/docfac.hxx>
33 : : #include <sfx2/objsh.hxx>
34 : :
35 : : #include <vcl/jobset.hxx>
36 : : #include "glob.hxx"
37 : : #include "sdmod.hxx"
38 : : #include "pres.hxx"
39 : : #include "sddllapi.h"
40 : : #include "fupoor.hxx"
41 : :
42 : : class SfxStyleSheetBasePool;
43 : : class FontList;
44 : : class SdDrawDocument;
45 : : class SdPage;
46 : : class SfxPrinter;
47 : : struct SpellCallbackInfo;
48 : : class AbstractSvxNameDialog;
49 : : class SfxUndoManager;
50 : :
51 : : namespace sd {
52 : :
53 : : class FrameView;
54 : : class ViewShell;
55 : :
56 : : // ------------------
57 : : // - DrawDocShell -
58 : : // ------------------
59 : :
60 : : class SD_DLLPUBLIC DrawDocShell : public SfxObjectShell
61 : : {
62 : : public:
63 : : TYPEINFO();
64 : 25 : SFX_DECL_INTERFACE(SD_IF_SDDRAWDOCSHELL)
65 : 13772 : SFX_DECL_OBJECTFACTORY();
66 : :
67 : : DrawDocShell (
68 : : SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
69 : : sal_Bool bSdDataObj=sal_False,
70 : : DocumentType=DOCUMENT_TYPE_IMPRESS);
71 : :
72 : : DrawDocShell (
73 : : const sal_uInt64 nModelCreationFlags,
74 : : sal_Bool bSdDataObj=sal_False,
75 : : DocumentType=DOCUMENT_TYPE_IMPRESS);
76 : :
77 : : DrawDocShell (
78 : : SdDrawDocument* pDoc,
79 : : SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
80 : : sal_Bool bSdDataObj=sal_False,
81 : : DocumentType=DOCUMENT_TYPE_IMPRESS);
82 : : virtual ~DrawDocShell();
83 : :
84 : : void UpdateRefDevice();
85 : : virtual void Activate( sal_Bool bMDI );
86 : : virtual void Deactivate( sal_Bool bMDI );
87 : : virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
88 : : virtual sal_Bool ImportFrom( SfxMedium &rMedium, bool bInsert=false );
89 : : virtual sal_Bool ConvertFrom( SfxMedium &rMedium );
90 : : virtual sal_Bool Save();
91 : : virtual sal_Bool SaveAsOwnFormat( SfxMedium& rMedium );
92 : : virtual sal_Bool ConvertTo( SfxMedium &rMedium );
93 : : virtual sal_Bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
94 : :
95 : : virtual sal_Bool Load( SfxMedium &rMedium );
96 : : virtual sal_Bool LoadFrom( SfxMedium& rMedium );
97 : : virtual sal_Bool SaveAs( SfxMedium &rMedium );
98 : :
99 : : virtual Rectangle GetVisArea(sal_uInt16 nAspect) const;
100 : : virtual void Draw(OutputDevice*, const JobSetup& rSetup, sal_uInt16 nAspect = ASPECT_CONTENT);
101 : : virtual ::svl::IUndoManager*
102 : : GetUndoManager();
103 : : virtual Printer* GetDocumentPrinter();
104 : : virtual void OnDocumentPrinterChanged(Printer* pNewPrinter);
105 : : virtual SfxStyleSheetBasePool* GetStyleSheetPool();
106 : : virtual void SetOrganizerSearchMask(SfxStyleSheetBasePool* pBasePool) const;
107 : : virtual Size GetFirstPageSize();
108 : : virtual void FillClass(SvGlobalName* pClassName, sal_uInt32* pFormat, String* pAppName, String* pFullTypeName, String* pShortTypeName, sal_Int32 nFileFormat, sal_Bool bTemplate = sal_False ) const;
109 : : virtual void SetModified( sal_Bool = sal_True );
110 : :
111 : : using SotObject::GetInterface;
112 : : using SfxObjectShell::GetVisArea;
113 : : using SfxShell::GetViewShell;
114 : :
115 : 3002 : sd::ViewShell* GetViewShell() { return mpViewShell; }
116 : : ::sd::FrameView* GetFrameView();
117 : 972 : ::sd::FunctionReference GetDocShellFunction() const { return mxDocShellFunction; }
118 : : void SetDocShellFunction( const ::sd::FunctionReference& xFunction );
119 : :
120 : : SdDrawDocument* GetDoc();
121 : 411 : DocumentType GetDocumentType() const { return meDocType; }
122 : :
123 : : SfxPrinter* GetPrinter(sal_Bool bCreate);
124 : : void SetPrinter(SfxPrinter *pNewPrinter);
125 : : void UpdateFontList();
126 : :
127 : 12 : sal_Bool IsInDestruction() const { return mbInDestruction; }
128 : :
129 : : void CancelSearching();
130 : :
131 : : void Execute( SfxRequest& rReq );
132 : : void GetState(SfxItemSet&);
133 : :
134 : : void Connect(sd::ViewShell* pViewSh);
135 : : void Disconnect(sd::ViewShell* pViewSh);
136 : : void UpdateTablePointers();
137 : :
138 : : sal_Bool GotoBookmark(const String& rBookmark);
139 : :
140 : : Bitmap GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixel);
141 : :
142 : : /** checks, if the given name is a valid new name for a slide
143 : :
144 : : <p>If the name is invalid, an <type>SvxNameDialog</type> pops up that
145 : : queries again for a new name until it is ok or the user chose
146 : : Cancel.</p>
147 : :
148 : : @param pWin is necessary to pass to the <type>SvxNameDialog</type> in
149 : : case an invalid name was entered.
150 : : @param rName the new name that is to be set for a slide. This string
151 : : may be set to an empty string (see below).
152 : :
153 : : @return sal_True, if the new name is unique. Note that if the user entered
154 : : a default name of a not-yet-existing slide (e.g. 'Slide 17'),
155 : : sal_True is returned, but rName is set to an empty string.
156 : : */
157 : : sal_Bool CheckPageName(::Window* pWin, String& rName );
158 : :
159 : 172 : void SetSlotFilter(sal_Bool bEnable = sal_False, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = NULL) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
160 : : void ApplySlotFilter() const;
161 : :
162 : 2 : sal_uInt16 GetStyleFamily() const { return mnStyleFamily; }
163 : 276 : void SetStyleFamily( sal_uInt16 nSF ) { mnStyleFamily = nSF; }
164 : :
165 : : /** executes the SID_OPENDOC slot to let the framework open a document
166 : : with the given URL and this document as a referer */
167 : : void OpenBookmark( const String& rBookmarkURL );
168 : :
169 : : /** checks, if the given name is a valid new name for a slide
170 : :
171 : : <p>This method does not pop up any dialog (like CheckPageName).</p>
172 : :
173 : : @param rInOutPageName the new name for a slide that is to be renamed.
174 : : This string will be set to an empty string if
175 : : bResetStringIfStandardName is true and the name is of the
176 : : form of any, possibly not-yet existing, standard slide
177 : : (e.g. 'Slide 17')
178 : :
179 : : @param bResetStringIfStandardName if true allows setting rInOutPageName
180 : : to an empty string, which returns true and implies that the
181 : : slide will later on get a new standard name (with a free
182 : : slide number).
183 : :
184 : : @return true, if the new name is unique. If bResetStringIfStandardName
185 : : is true, the return value is also true, if the slide name is
186 : : a standard name (see above)
187 : : */
188 : : bool IsNewPageNameValid( String & rInOutPageName, bool bResetStringIfStandardName = false );
189 : :
190 : :
191 : : /** Return the reference device for the current document. When the
192 : : inherited implementation returns a device then this is passed to the
193 : : caller. Otherwise the returned value depends on the printer
194 : : independent layout mode and will usually be either a printer or a
195 : : virtual device used for screen rendering.
196 : : @return
197 : : Returns NULL when the current document has no reference device.
198 : : */
199 : : virtual OutputDevice* GetDocumentRefDev (void);
200 : :
201 : : DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
202 : :
203 : : // ExecuteSpellPopup now handled by DrawDocShell
204 : : DECL_LINK( OnlineSpellCallback, SpellCallbackInfo* );
205 : :
206 : : void ClearUndoBuffer();
207 : :
208 : : protected:
209 : :
210 : : SdDrawDocument* mpDoc;
211 : : SfxUndoManager* mpUndoManager;
212 : : SfxPrinter* mpPrinter;
213 : : ::sd::ViewShell* mpViewShell;
214 : : FontList* mpFontList;
215 : : ::sd::FunctionReference mxDocShellFunction;
216 : : DocumentType meDocType;
217 : : sal_uInt16 mnStyleFamily;
218 : : const sal_uInt16* mpFilterSIDs;
219 : : sal_uInt16 mnFilterCount;
220 : : sal_Bool mbFilterEnable;
221 : : sal_Bool mbSdDataObj;
222 : : sal_Bool mbInDestruction;
223 : : sal_Bool mbOwnPrinter;
224 : : sal_Bool mbNewDocument;
225 : :
226 : : bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
227 : : void Construct(bool bClipboard);
228 : : virtual void InPlaceActivate( sal_Bool bActive );
229 : : };
230 : :
231 : : #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
232 : : #define SV_DECL_DRAW_DOC_SHELL_DEFINED
233 : 0 : SV_DECL_REF(DrawDocShell)
234 : : #endif
235 : :
236 [ + - # ]: 766 : SV_IMPL_REF (DrawDocShell)
[ + - ][ # # ]
[ + - # # ]
[ - + ][ - + ]
[ # # ]
237 : :
238 : : } // end of namespace sd
239 : :
240 : : #endif
241 : :
242 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|