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 : : #ifndef _SRCVIEW_HXX
29 : : #define _SRCVIEW_HXX
30 : :
31 : : #include <sfx2/viewfac.hxx>
32 : : #include <sfx2/viewsh.hxx>
33 : : #include <vcl/outdev.hxx>
34 : :
35 : : #include "srcedtw.hxx"
36 : : #include "shellid.hxx"
37 : :
38 : : class SwDocShell;
39 : : class SvxSearchItem;
40 : : class SfxMedium;
41 : :
42 : : class SwSrcView: public SfxViewShell
43 : : {
44 : : SwSrcEditWindow aEditWin;
45 : :
46 : : SvxSearchItem* pSearchItem;
47 : :
48 : : sal_Bool bSourceSaved :1;
49 : : rtl_TextEncoding eLoadEncoding;
50 : : void Init();
51 : :
52 : : // for read-only switching
53 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
54 : :
55 : :
56 : : protected:
57 : : sal_uInt16 StartSearchAndReplace(const SvxSearchItem& rItem,
58 : : sal_Bool bFromStart,
59 : : sal_Bool bApi,
60 : : sal_Bool bRecursive = sal_False);
61 : :
62 : :
63 : : public:
64 : :
65 : 67 : SFX_DECL_VIEWFACTORY(SwSrcView);
66 : 73 : SFX_DECL_INTERFACE(SW_SRC_VIEWSHELL)
67 : : TYPEINFO();
68 : :
69 : :
70 : : SwSrcView(SfxViewFrame* pFrame, SfxViewShell*);
71 : :
72 : : ~SwSrcView();
73 : :
74 : : SwDocShell* GetDocShell();
75 : : SwSrcEditWindow& GetEditWin() {return aEditWin;}
76 : : void SaveContent(const String& rTmpFile);
77 : : void SaveContentTo(SfxMedium& rMed);
78 : :
79 : 0 : sal_Bool IsModified() {return aEditWin.IsModified();}
80 : :
81 : :
82 : :
83 : : void Execute(SfxRequest&);
84 : : void GetState(SfxItemSet&);
85 : :
86 : : SvxSearchItem* GetSearchItem();
87 : : void SetSearchItem( const SvxSearchItem& rItem );
88 : :
89 : : void Load(SwDocShell* pDocShell);
90 : :
91 : : virtual sal_uInt16 SetPrinter( SfxPrinter* pNew, sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false );
92 : : virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
93 : :
94 : : sal_Int32 PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, bool bCalcNumPagesOnly );
95 : :
96 : 0 : void SourceSaved() {bSourceSaved = sal_True;}
97 : 0 : sal_Bool HasSourceSaved() const {return bSourceSaved;}
98 : :
99 : : };
100 : :
101 : : #endif
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|