xref: /aoo41x/main/sw/source/ui/inc/srcview.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SRCVIEW_HXX
28 #define _SRCVIEW_HXX
29 
30 #include <sfx2/viewfac.hxx>
31 #include <sfx2/viewsh.hxx>
32 #include <vcl/outdev.hxx>
33 
34 #include "srcedtw.hxx"
35 #include "shellid.hxx"
36 
37 class SwDocShell;
38 class SvxSearchItem;
39 class SfxMedium;
40 
41 /*--------------------------------------------------------------------
42 	Beschreibung:
43  --------------------------------------------------------------------*/
44 
45 class SwSrcView: public SfxViewShell
46 {
47 	SwSrcEditWindow 	aEditWin;
48 
49 	SvxSearchItem*		pSearchItem;
50 
51 	sal_Bool				bSourceSaved	:1;
52     rtl_TextEncoding    eLoadEncoding;
53     void                Init();
54 
55 	// fuer Readonly-Umschaltung
56 	virtual void		Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
57 
58 
59 protected:
60 	sal_uInt16 				StartSearchAndReplace(const SvxSearchItem& rItem,
61 														sal_Bool bFromStart,
62 														sal_Bool bApi,
63 														sal_Bool bRecursive = sal_False);
64 
65 
66 public:
67 
68 	SFX_DECL_VIEWFACTORY(SwSrcView);
69 	SFX_DECL_INTERFACE(SW_SRC_VIEWSHELL)
70 	TYPEINFO();
71 
72 
73 	SwSrcView(SfxViewFrame* pFrame, SfxViewShell*);
74 
75 	~SwSrcView();
76 
77 	SwDocShell*			GetDocShell();
78 	SwSrcEditWindow&    GetEditWin() {return aEditWin;}
79 	void				SaveContent(const String& rTmpFile);
80 	void				SaveContentTo(SfxMedium& rMed);
81 
82 	sal_Bool				IsModified() {return aEditWin.IsModified();}
83 
84 
85 
86 	void			Execute(SfxRequest&);
87 	void			GetState(SfxItemSet&);
88 
89 	SvxSearchItem* 	GetSearchItem();
90 	void 			SetSearchItem( const SvxSearchItem& rItem );
91 
92 	void			Load(SwDocShell* pDocShell);
93 
94     virtual sal_uInt16  SetPrinter( SfxPrinter* pNew, sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false );
95     virtual         SfxPrinter*     GetPrinter( sal_Bool bCreate = sal_False );
96 
97     sal_Int32       PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, bool bCalcNumPagesOnly );
98 
99 	void			SourceSaved() {bSourceSaved = sal_True;}
100 	sal_Bool			HasSourceSaved() const {return bSourceSaved;}
101 
102 };
103 
104 
105 #endif
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127