1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: srcview.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <sfx2/viewfac.hxx>
34 #include <sfx2/viewsh.hxx>
35 #include "srcedtw.hxx"
36 #include "shellid.hxx"
42 /*--------------------------------------------------------------------
44 --------------------------------------------------------------------*/
46 class SwSrcView
: public SfxViewShell
48 SwSrcEditWindow aEditWin
;
50 SvxSearchItem
* pSearchItem
;
53 rtl_TextEncoding eLoadEncoding
;
56 // fuer Readonly-Umschaltung
57 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
61 USHORT
StartSearchAndReplace(const SvxSearchItem
& rItem
,
64 BOOL bRecursive
= FALSE
);
69 SFX_DECL_VIEWFACTORY(SwSrcView
);
70 SFX_DECL_INTERFACE(SW_SRC_VIEWSHELL
)
74 SwSrcView(SfxViewFrame
* pFrame
, SfxViewShell
*);
78 SwDocShell
* GetDocShell();
79 SwSrcEditWindow
& GetEditWin() {return aEditWin
;}
80 void SaveContent(const String
& rTmpFile
);
81 void SaveContentTo(SfxMedium
& rMed
);
83 BOOL
IsModified() {return aEditWin
.IsModified();}
87 void Execute(SfxRequest
&);
88 void GetState(SfxItemSet
&);
90 SvxSearchItem
* GetSearchItem();
91 void SetSearchItem( const SvxSearchItem
& rItem
);
93 void Load(SwDocShell
* pDocShell
);
95 virtual USHORT
SetPrinter( SfxPrinter
* pNew
,
96 USHORT nDiff
= SFX_PRINTER_ALL
, bool bIsAPI
=false );
97 virtual ErrCode
DoPrint( SfxPrinter
*pPrinter
, PrintDialog
*pPrintDialog
, BOOL bSilent
, BOOL bIsAPI
);
98 virtual SfxPrinter
* GetPrinter( BOOL bCreate
= FALSE
);
100 void SourceSaved() {bSourceSaved
= TRUE
;}
101 BOOL
HasSourceSaved() const {return bSourceSaved
;}