LibreOffice Module basctl (master) 1
basdoc.cxx
Go to the documentation of this file.
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#include <sal/config.h>
21
22#include <sfx2/app.hxx>
23#include <sfx2/printer.hxx>
24#include <sfx2/objface.hxx>
25
26#include "unomodel.hxx"
27
28#include "basdoc.hxx"
29#define ShellClass_basctl_DocShell
30#include <basslots.hxx>
32#include <svl/itemset.hxx>
33#include <svx/svxids.hrc>
34#include <tools/globname.hxx>
35#include <tools/debug.hxx>
36
37namespace basctl
38{
39
40
41SFX_IMPL_OBJECTFACTORY( DocShell, SvGlobalName(), "sbasic" )
42
44
46{
47 GetStaticInterface()->RegisterStatusBar(StatusBarId::BasicIdeStatusBar);
48}
49
52{
53 SetPool( &SfxGetpApp()->GetPool() );
54 SetBaseModel( new SIDEModel(this) );
55}
56
58{
60}
61
63{
64 if ( !pPrinter && bCreate )
66 <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN>>(GetPool())
67 ));
68
69 return pPrinter.get();
70}
71
73{
74 if (pPr != pPrinter.get())
75 {
77 }
78}
79
80void DocShell::FillClass( SvGlobalName*, SotClipboardFormatId*, OUString*, sal_Int32, bool bTemplate) const
81{
82 DBG_ASSERT( !bTemplate, "No template for Basic" );
83}
84
85void DocShell::Draw( OutputDevice *, const JobSetup &, sal_uInt16, bool )
86{}
87
88} // namespace basctl
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
void disposeAndReset(reference_type *pBody)
void SetBaseModel(SfxBaseModel *pModel)
SfxItemPool & GetPool() const
void SetPool(SfxItemPool *pNewPool)
void disposeAndClear()
reference_type * get() const
ScopedVclPtr< SfxPrinter > pPrinter
Definition: basdoc.hxx:33
static void InitInterface_Impl()
SfxInterface initializer.
SfxPrinter * GetPrinter(bool bCreate)
Definition: basdoc.cxx:62
void SetPrinter(SfxPrinter *pPrinter)
Definition: basdoc.cxx:72
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pFormat, OUString *pFullTypeName, sal_Int32 nVersion, bool bTemplate=false) const override
Definition: basdoc.cxx:80
virtual ~DocShell() override
Definition: basdoc.cxx:57
virtual void Draw(OutputDevice *, const JobSetup &rSetup, sal_uInt16 nAspect, bool bOutputForScreen) override
Definition: basdoc.cxx:85
#define DBG_ASSERT(sCon, aError)
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
SotClipboardFormatId
SFX_IMPL_OBJECTFACTORY(DrawDocShell, SvGlobalName(SO3_SIMPRESS_CLASSID), "simpress") void DrawDocShell
SfxModelFlags
@ DISABLE_DOCUMENT_RECOVERY
@ DISABLE_EMBEDDED_SCRIPTS