Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/sfx2/sfxbasemodel.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
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/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
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 .
18
 */
19
20
#pragma once
21
22
#include <sal/config.h>
23
#include <sfx2/dllapi.h>
24
#include <sal/types.h>
25
#include <com/sun/star/frame/XModule.hpp>
26
#include <com/sun/star/frame/XTitle.hpp>
27
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
28
#include <com/sun/star/frame/XUntitledNumbers.hpp>
29
#include <com/sun/star/container/XChild.hpp>
30
#include <com/sun/star/document/XCmisDocument.hpp>
31
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
32
#include <com/sun/star/document/XDocumentRecovery2.hpp>
33
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
34
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
35
#include <com/sun/star/document/XShapeEventBroadcaster.hpp>
36
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
37
#include <com/sun/star/document/XEventsSupplier.hpp>
38
#include <com/sun/star/document/XEmbeddedScripts.hpp>
39
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
40
#include <com/sun/star/document/XStorageBasedDocument.hpp>
41
#include <com/sun/star/document/XScriptInvocationContext.hpp>
42
#include <com/sun/star/lang/XEventListener.hpp>
43
#include <com/sun/star/frame/XModel3.hpp>
44
#include <com/sun/star/util/XModifiable2.hpp>
45
#include <com/sun/star/util/XCloseable.hpp>
46
#include <com/sun/star/view/XPrintable.hpp>
47
#include <com/sun/star/view/XPrintJobBroadcaster.hpp>
48
#include <com/sun/star/frame/XStorable2.hpp>
49
#include <com/sun/star/frame/XLoadable.hpp>
50
//#include <com/sun/star/lang/EventObject.hpp>
51
#include <com/sun/star/datatransfer/XTransferable.hpp>
52
#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
53
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
54
#include <com/sun/star/embed/XVisualObject.hpp>
55
#include <com/sun/star/uno/Sequence.hxx>
56
#include <com/sun/star/uno/Reference.hxx>
57
#include <com/sun/star/uno/Any.hxx>
58
#include <cppuhelper/basemutex.hxx>
59
#include <com/sun/star/script/XStarBasicAccess.hpp>
60
61
#include <com/sun/star/document/XViewDataSupplier.hpp>
62
#include <com/sun/star/lang/XUnoTunnel.hpp>
63
#include <cppuhelper/implbase.hxx>
64
#include <svl/lstner.hxx>
65
66
#include <memory>
67
68
class ErrCodeMsg;
69
class SfxMedium;
70
class   SfxObjectShell                      ;
71
class   SfxViewFrame;
72
struct  IMPL_SfxBaseModel_DataContainer     ;   // impl. struct to hold member of class SfxBaseModel
73
74
namespace sfx::intern {
75
    class ViewCreationGuard;
76
}
77
78
namespace com::sun::star::beans { struct PropertyValue; }
79
namespace com::sun::star::document { struct EventObject; }
80
namespace com::sun::star::frame { class XController2; }
81
namespace com::sun::star::ui { class XUIConfigurationManager2; }
82
83
84
85
/**_______________________________________________________________________________________________________
86
    @implements XChild
87
                XComponent
88
                document::XDocumentPropertiesSupplier
89
                rdf::XDocumentMetadataAccess
90
                XEventListener
91
                XModel
92
                XModifiable2
93
                XPrintable
94
                XStorable2
95
                document::XEventBroadcaster
96
                document::XEventsSupplier
97
                document::XEmbeddedScripts
98
                document::XScriptInvocationContext
99
                XCloseable
100
                XCloseBroadcaster
101
102
    @base       cppu::BaseMutex
103
                 SfxListener
104
*/
105
106
typedef ::cppu::WeakImplHelper  <   css::container::XChild
107
                                        ,   css::document::XDocumentPropertiesSupplier
108
                                        ,   css::document::XCmisDocument
109
                                        ,   css::rdf::XDocumentMetadataAccess
110
                                        ,   css::document::XDocumentRecovery2
111
                                        ,   css::document::XUndoManagerSupplier
112
                                        ,   css::document::XShapeEventBroadcaster
113
                                        ,   css::document::XDocumentEventBroadcaster
114
                                        ,   css::lang::XEventListener
115
                                        ,   css::document::XEventsSupplier
116
                                        ,   css::document::XEmbeddedScripts
117
                                        ,   css::document::XScriptInvocationContext
118
                                        ,   css::frame::XModel3
119
                                        ,   css::util::XModifiable2
120
                                        ,   css::view::XPrintable
121
                                        ,   css::view::XPrintJobBroadcaster
122
                                        ,   css::frame::XStorable2
123
                                        ,   css::frame::XLoadable
124
                                        ,   css::script::XStarBasicAccess
125
                                        ,   css::document::XViewDataSupplier
126
                                        ,   css::util::XCloseable           // => css::util::XCloseBroadcaster
127
                                        ,   css::datatransfer::XTransferable
128
                                        ,   css::document::XDocumentSubStorageSupplier
129
                                        ,   css::document::XStorageBasedDocument
130
                                        ,   css::script::provider::XScriptProviderSupplier
131
                                        ,   css::ui::XUIConfigurationManagerSupplier
132
                                        ,   css::embed::XVisualObject
133
                                        ,   css::lang::XUnoTunnel
134
                                        ,   css::frame::XModule
135
                                        ,   css::frame::XTitle
136
                                        ,   css::frame::XTitleChangeBroadcaster
137
                                        ,   css::frame::XUntitledNumbers
138
                                        >   SfxBaseModel_Base;
139
140
class SFX2_DLLPUBLIC SfxBaseModel   :   protected ::cppu::BaseMutex
141
                                    ,   public SfxBaseModel_Base
142
                                    ,   public SfxListener
143
{
144
145
146
//  public methods
147
148
149
public:
150
151
152
    //  constructor/destructor
153
154
155
    SfxBaseModel( SfxObjectShell *pObjectShell ) ;
156
157
    virtual ~SfxBaseModel() override ;
158
159
160
    //  XInterface
161
162
163
    /**___________________________________________________________________________________________________
164
        @short      give answer, if interface is supported
165
        @descr      The interfaces are searched by type.
166
167
        @seealso    XInterface
168
169
        @param      "rType" is the type of searched interface.
170
171
        @return     Any     information about found interface
172
173
        @onerror    A RuntimeException is thrown.
174
    */
175
176
    virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override ;
177
178
    /**___________________________________________________________________________________________________
179
        @short      increment refcount
180
        @seealso    XInterface
181
        @seealso    release()
182
        @onerror    A RuntimeException is thrown.
183
    */
184
185
    virtual void SAL_CALL acquire() noexcept override
186
9.87M
    { OWeakObject::acquire(); }
187
188
    /**___________________________________________________________________________________________________
189
        @short      decrement refcount
190
        @seealso    XInterface
191
        @seealso    acquire()
192
        @onerror    A RuntimeException is thrown.
193
    */
194
195
    virtual void SAL_CALL release() noexcept override
196
8.12M
    { OWeakObject::release(); }
197
198
199
    //  XTypeProvider
200
201
202
    /**___________________________________________________________________________________________________
203
        @short      get information about supported interfaces
204
        @seealso    XTypeProvider
205
        @return     Sequence of types of all supported interfaces
206
207
        @onerror    A RuntimeException is thrown.
208
    */
209
210
    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override ;
211
212
    /**___________________________________________________________________________________________________
213
        @short      get implementation id
214
        @descr      This ID is necessary for UNO-caching. If there no ID, cache is disabled.
215
                    Another way, cache is enabled.
216
217
        @seealso    XTypeProvider
218
        @return     ID as Sequence of byte
219
220
        @onerror    A RuntimeException is thrown.
221
    */
222
223
    virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override ;
224
225
226
    //  XStarBasicAccess
227
228
229
    /**___________________________________________________________________________________________________
230
        @seealso    XStarBasicAccess
231
    */
232
    virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getLibraryContainer() override;
233
234
    /**___________________________________________________________________________________________________
235
        @seealso    XStarBasicAccess
236
    */
237
    virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password,
238
        const OUString& ExternalSourceURL, const OUString& LinkTargetURL ) override;
239
240
    /**___________________________________________________________________________________________________
241
        @seealso    XStarBasicAccess
242
    */
243
    virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName,
244
        const OUString& Language, const OUString& Source ) override;
245
246
    /**___________________________________________________________________________________________________
247
        @seealso    XStarBasicAccess
248
    */
249
    virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName,
250
        const css::uno::Sequence< sal_Int8 >& Data ) override;
251
252
253
    //  XChild
254
255
256
    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override ;
257
258
    virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) override;
259
260
261
    //  XComponent
262
263
264
    virtual void SAL_CALL dispose() override;
265
266
    virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener) override;
267
268
    virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
269
270
    // XDocumentPropertiesSupplier
271
    virtual css::uno::Reference< css::document::XDocumentProperties >
272
        SAL_CALL getDocumentProperties() override;
273
274
275
    //  XEventListener
276
277
278
    virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override;
279
280
281
    //  XModel
282
283
284
    virtual sal_Bool SAL_CALL attachResource(const OUString& sURL,
285
                                             const css::uno::Sequence< css::beans::PropertyValue >& aArgs) override;
286
287
    virtual OUString SAL_CALL getURL() override;
288
289
    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override;
290
291
    virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) override;
292
293
    virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) override;
294
295
    virtual void SAL_CALL lockControllers() override;
296
297
    virtual void SAL_CALL unlockControllers() override;
298
299
    virtual sal_Bool SAL_CALL hasControllersLocked() override;
300
301
    virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override;
302
303
    virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) override;
304
305
    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() override;
306
307
308
    //  XModel2
309
310
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers() override;
311
312
    virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames() override;
313
314
    virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame ) override;
315
316
    virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const OUString&                                 ViewName       ,
317
                                                                                          const css::uno::Sequence< css::beans::PropertyValue >& Arguments      ,
318
                                                                                          const css::uno::Reference< css::frame::XFrame >&       Frame          ) override;
319
320
    virtual void SAL_CALL setArgs(const css::uno::Sequence<css::beans::PropertyValue>& aArgs) override;
321
322
323
    //  XModel3
324
325
    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs2( const css::uno::Sequence< OUString > & requestedArgs ) override;
326
327
    //  XModifiable2
328
329
330
    virtual sal_Bool SAL_CALL disableSetModified(  ) override;
331
    virtual sal_Bool SAL_CALL enableSetModified(  ) override;
332
    virtual sal_Bool SAL_CALL isSetModifiedEnabled(  ) override;
333
334
    virtual sal_Bool SAL_CALL isModified() override;
335
336
    virtual void SAL_CALL setModified( sal_Bool bModified ) override;
337
338
    virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) override ;
339
340
    virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > & xListener) override ;
341
342
343
    //  XCloseable
344
345
346
    virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) override;
347
348
349
    //  XCloseBroadcaster
350
351
352
    virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) override;
353
    virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) override;
354
355
356
    //  XPrintJobBroadcaster
357
358
359
    virtual void SAL_CALL addPrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) override;
360
    virtual void SAL_CALL removePrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) override;
361
362
363
    //  XPrintable
364
365
366
    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() override;
367
368
    virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& seqPrinter ) override;
369
    virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& seqOptions ) override;
370
371
372
    //  XStorable2
373
374
375
    virtual void SAL_CALL storeSelf( const  css::uno::Sequence< css::beans::PropertyValue >&   seqArguments    ) override;
376
377
378
    //  XStorable
379
380
381
    virtual sal_Bool SAL_CALL hasLocation() override;
382
383
    virtual OUString SAL_CALL getLocation() override;
384
385
    virtual sal_Bool SAL_CALL isReadonly() override;
386
387
    virtual void SAL_CALL store() override;
388
389
    virtual void SAL_CALL storeAsURL(   const   OUString& sURL,
390
                                        const   css::uno::Sequence< css::beans::PropertyValue >&   seqArguments    ) override ;
391
392
    virtual void SAL_CALL storeToURL(   const   OUString& sURL,
393
                                        const   css::uno::Sequence< css::beans::PropertyValue >&   seqArguments    ) override;
394
395
    SAL_DLLPRIVATE void
396
    impl_store(const OUString& sURL,
397
               const css::uno::Sequence<css::beans::PropertyValue>& seqArguments, bool bSaveTo);
398
399
    //  XLoadable
400
401
402
    virtual void SAL_CALL initNew() override;
403
404
    virtual void SAL_CALL load( const   css::uno::Sequence< css::beans::PropertyValue >&   seqArguments ) override;
405
406
407
    //  XDocumentSubStorageSupplier
408
409
410
    virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode ) override;
411
412
    virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override;
413
414
415
    //  XStorageBasedDocument
416
417
418
    virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
419
                                            const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override;
420
421
    virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
422
                                            const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override;
423
424
    virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
425
426
    virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage() override;
427
428
    virtual void SAL_CALL addStorageChangeListener(
429
            const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override;
430
431
    virtual void SAL_CALL removeStorageChangeListener(
432
            const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override;
433
434
435
    //  XVisualObject
436
437
438
    virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const css::awt::Size& aSize ) override;
439
440
    virtual css::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect ) override;
441
442
    virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) override;
443
444
    virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect ) override;
445
446
447
    //  XScriptProviderSupplier
448
449
450
    virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() override;
451
452
453
    //  XUIConfigurationManagerSupplier
454
    virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() override;
455
456
457
    //  XTransferable
458
459
460
    virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor ) override;
461
462
    virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override;
463
464
    virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& aFlavor ) override;
465
466
467
    //  XEventsSupplier
468
469
470
    /**___________________________________________________________________________________________________
471
        @descr      -   offers a list of event handlers which are be bound to events of
472
                        this object.
473
        @return     -   an Events object.
474
    */
475
476
    virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override;
477
478
479
    //  XEmbeddedScripts
480
481
482
    virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() override;
483
    virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() override;
484
    virtual sal_Bool SAL_CALL getAllowMacroExecution() override;
485
486
487
    //  XScriptInvocationContext
488
489
490
    virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override;
491
492
493
    //  document::XEventBroadcaster
494
495
    /**___________________________________________________________________________________________________
496
        @descr      -   registers the given XEventListener.
497
    */
498
    virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override;
499
500
    /**___________________________________________________________________________________________________
501
        @descr      -   unregisters the given XEventListener.
502
    */
503
    virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override;
504
505
506
    //  document::XShapeEventBroadcaster
507
508
    /**___________________________________________________________________________________________________
509
        @descr      -   registers the given XEventListener.
510
    */
511
    virtual void SAL_CALL addShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override;
512
513
    /**___________________________________________________________________________________________________
514
        @descr      -   unregisters the given XEventListener.
515
    */
516
    virtual void SAL_CALL removeShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override;
517
518
519
    //  XDocumentEventBroadcaster
520
521
    virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override;
522
    virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override;
523
    virtual void SAL_CALL notifyDocumentEvent( const OUString& EventName, const css::uno::Reference< css::frame::XController2 >& ViewController, const css::uno::Any& Supplement ) override;
524
525
526
    //  XUnoTunnel
527
528
529
    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
530
531
    // css.frame.XModule
532
    virtual void SAL_CALL setIdentifier(const OUString& sIdentifier) override;
533
534
    // css.frame.XModule
535
    virtual OUString SAL_CALL getIdentifier() override;
536
537
    // css.frame.XTitle
538
    virtual OUString SAL_CALL getTitle() override;
539
540
    // css.frame.XTitle
541
    virtual void SAL_CALL setTitle( const OUString& sTitle ) override;
542
543
    // css.frame.XTitleChangeBroadcaster
544
    virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override;
545
546
    // css.frame.XTitleChangeBroadcaster
547
    virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override;
548
549
    // css.frame.XUntitledNumbers
550
    virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent ) override;
551
552
    // css.frame.XUntitledNumbers
553
    virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) override;
554
555
    // css.frame.XUntitledNumbers
556
    virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent ) override;
557
558
    // css.frame.XUntitledNumbers
559
    virtual OUString SAL_CALL getUntitledPrefix() override;
560
561
    // css.document.XDocumentRecovery
562
    virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() override;
563
    virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override;
564
    virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override;
565
566
    // css.document.XDocumentRecovery2
567
    virtual sal_Int64 SAL_CALL getModifiedStateDuration() override;
568
569
    // css.document.XUndoManagerSupplier
570
    virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL getUndoManager(  ) override;
571
572
573
    // css::rdf::XNode:
574
    virtual OUString SAL_CALL getStringValue() override;
575
576
    // css::rdf::XURI:
577
    virtual OUString SAL_CALL getNamespace() override;
578
    virtual OUString SAL_CALL getLocalName() override;
579
580
    // css::rdf::XRepositorySupplier:
581
    virtual css::uno::Reference<
582
        css::rdf::XRepository > SAL_CALL getRDFRepository() override;
583
584
    // css::rdf::XDocumentMetadataAccess:
585
    virtual css::uno::Reference<
586
                css::rdf::XMetadatable > SAL_CALL
587
        getElementByMetadataReference(
588
            const css::beans::StringPair & i_rReference) override;
589
    virtual css::uno::Reference<
590
                css::rdf::XMetadatable > SAL_CALL
591
        getElementByURI(const css::uno::Reference<
592
            css::rdf::XURI > & i_xURI) override;
593
    virtual css::uno::Sequence< css::uno::Reference<
594
            css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
595
            const css::uno::Reference<
596
                css::rdf::XURI > & i_xType) override;
597
    virtual css::uno::Reference<
598
                css::rdf::XURI> SAL_CALL
599
        addMetadataFile(const OUString & i_rFileName,
600
            const css::uno::Sequence<
601
                css::uno::Reference< css::rdf::XURI >
602
                > & i_rTypes) override;
603
    virtual css::uno::Reference<
604
                css::rdf::XURI> SAL_CALL
605
        importMetadataFile(::sal_Int16 i_Format,
606
            const css::uno::Reference<
607
                css::io::XInputStream > & i_xInStream,
608
            const OUString & i_rFileName,
609
            const css::uno::Reference<
610
                css::rdf::XURI > & i_xBaseURI,
611
            const css::uno::Sequence<
612
                css::uno::Reference< css::rdf::XURI >
613
                > & i_rTypes) override;
614
    virtual void SAL_CALL removeMetadataFile(
615
            const css::uno::Reference<
616
                css::rdf::XURI > & i_xGraphName) override;
617
    virtual void SAL_CALL addContentOrStylesFile(
618
            const OUString & i_rFileName) override;
619
    virtual void SAL_CALL removeContentOrStylesFile(
620
            const OUString & i_rFileName) override;
621
622
    virtual void SAL_CALL loadMetadataFromStorage(
623
            const css::uno::Reference<
624
                css::embed::XStorage > & i_xStorage,
625
            const css::uno::Reference<
626
                css::rdf::XURI > & i_xBaseURI,
627
            const css::uno::Reference<
628
                css::task::XInteractionHandler> & i_xHandler) override;
629
    virtual void SAL_CALL storeMetadataToStorage(
630
            const css::uno::Reference<
631
                css::embed::XStorage > & i_xStorage) override;
632
    virtual void SAL_CALL loadMetadataFromMedium(
633
            const css::uno::Sequence<
634
                css::beans::PropertyValue > & i_rMedium) override;
635
    virtual void SAL_CALL storeMetadataToMedium(
636
            const css::uno::Sequence<
637
                css::beans::PropertyValue > & i_rMedium) override;
638
639
    // XCmisDocument
640
641
    virtual css::uno::Sequence< css::document::CmisProperty >
642
            SAL_CALL getCmisProperties() override;
643
    virtual void SAL_CALL setCmisProperties(
644
            const css::uno::Sequence<
645
                css::document::CmisProperty >& _cmisproperties ) override;
646
647
    virtual void SAL_CALL updateCmisProperties(
648
            const css::uno::Sequence<
649
                css::document::CmisProperty >& _cmisproperties ) override;
650
651
    virtual css::uno::Sequence< css::document::CmisVersion > SAL_CALL getAllVersions ( ) override;
652
653
    virtual void SAL_CALL checkOut(  ) override;
654
    virtual void SAL_CALL cancelCheckOut(  ) override;
655
    virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage  ) override;
656
657
    virtual sal_Bool SAL_CALL isVersionable( ) override;
658
    virtual sal_Bool SAL_CALL canCheckOut( ) override;
659
    virtual sal_Bool SAL_CALL canCancelCheckOut( ) override;
660
    virtual sal_Bool SAL_CALL canCheckIn( ) override;
661
662
    /// @throws css::uno::RuntimeException
663
    bool getBoolPropertyValue( const OUString& rName );
664
665
666
    //  SfxListener
667
668
669
    void Notify(            SfxBroadcaster& aBC     ,
670
                    const   SfxHint&        aHint   ) override ;
671
672
673
    //  public IMPL?
674
675
676
    void changing() ;
677
678
    SfxObjectShell* GetObjectShell() const ;
679
680
    SAL_DLLPRIVATE bool impl_isDisposed() const ;
681
    bool IsInitialized() const;
682
    void MethodEntryCheck( const bool i_mustBeInitialized ) const;
683
684
    css::uno::Reference < css::container::XIndexAccess > SAL_CALL getViewData() override;
685
    void SAL_CALL setViewData( const css::uno::Reference < css::container::XIndexAccess >& aData ) override;
686
687
    /** calls all XEventListeners */
688
    void notifyEvent( const css::document::EventObject& aEvent ) const;
689
690
    /** returns true if someone added a XEventListener to this XEventBroadcaster */
691
    bool hasEventListeners() const;
692
693
protected:
694
695
    /* returns a unique id for the model that is valid as long as the document
696
       is loaded. The id is not saved across document close/reload. */
697
    OUString const & getRuntimeUID() const;
698
699
    /* returns true if the document signatures are valid, otherwise false */
700
    bool hasValidSignatures() const;
701
702
    /* GrabBagItem for interim interop purposes */
703
    void getGrabBagItem(css::uno::Any& rVal) const;
704
705
    void setGrabBagItem(const css::uno::Any& rVal);
706
707
708
//  private methods
709
710
711
private:
712
    /// @throws css::uno::RuntimeException
713
    css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2();
714
    void impl_getPrintHelper();
715
    SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage );
716
    SAL_DLLPRIVATE OUString GetMediumFilterName_Impl() const;
717
718
    SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const css::uno::Reference< css::frame::XController2 >& xController = css::uno::Reference< css::frame::XController2 >(), const css::uno::Any& aSupplement = css::uno::Any());
719
720
    SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
721
    SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper ();
722
723
    SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl(
724
                        const css::uno::Reference< css::frame::XFrame >& i_rFrame,
725
                        ::sfx::intern::ViewCreationGuard& i_rGuard
726
                    ) const;
727
728
    SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const;
729
730
    SAL_DLLPRIVATE void loadCmisProperties();
731
732
    SAL_DLLPRIVATE SfxMedium* handleLoadError( const ErrCodeMsg& nError, SfxMedium* pMedium );
733
734
735
//  private variables and methods
736
737
738
private:
739
740
    std::shared_ptr<IMPL_SfxBaseModel_DataContainer> m_pData;
741
    // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
742
    const bool                          m_bSupportEmbeddedScripts;
743
    const bool                          m_bSupportDocRecovery;
744
745
} ; // class SfxBaseModel
746
747
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */