Coverage Report

Created: 2026-10-14 09:33

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