1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SRCVIEW_HXX 24 #define _SRCVIEW_HXX 25 26 #include <sfx2/viewfac.hxx> 27 #include <sfx2/viewsh.hxx> 28 #include <vcl/outdev.hxx> 29 30 #include "srcedtw.hxx" 31 #include "shellid.hxx" 32 33 class SwDocShell; 34 class SvxSearchItem; 35 class SfxMedium; 36 37 /*-------------------------------------------------------------------- 38 Beschreibung: 39 --------------------------------------------------------------------*/ 40 41 class SwSrcView: public SfxViewShell 42 { 43 SwSrcEditWindow aEditWin; 44 45 SvxSearchItem* pSearchItem; 46 47 sal_Bool bSourceSaved :1; 48 rtl_TextEncoding eLoadEncoding; 49 void Init(); 50 51 // fuer Readonly-Umschaltung 52 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 53 54 55 protected: 56 sal_uInt16 StartSearchAndReplace(const SvxSearchItem& rItem, 57 sal_Bool bFromStart, 58 sal_Bool bApi, 59 sal_Bool bRecursive = sal_False); 60 61 62 public: 63 64 SFX_DECL_VIEWFACTORY(SwSrcView); 65 SFX_DECL_INTERFACE(SW_SRC_VIEWSHELL) 66 TYPEINFO(); 67 68 69 SwSrcView(SfxViewFrame* pFrame, SfxViewShell*); 70 71 ~SwSrcView(); 72 73 SwDocShell* GetDocShell(); GetEditWin()74 SwSrcEditWindow& GetEditWin() {return aEditWin;} 75 void SaveContent(const String& rTmpFile); 76 void SaveContentTo(SfxMedium& rMed); 77 IsModified()78 sal_Bool IsModified() {return aEditWin.IsModified();} 79 80 81 82 void Execute(SfxRequest&); 83 void GetState(SfxItemSet&); 84 85 SvxSearchItem* GetSearchItem(); 86 void SetSearchItem( const SvxSearchItem& rItem ); 87 88 void Load(SwDocShell* pDocShell); 89 90 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew, sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false ); 91 virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False ); 92 93 sal_Int32 PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, bool bCalcNumPagesOnly ); 94 SourceSaved()95 void SourceSaved() {bSourceSaved = sal_True;} HasSourceSaved() const96 sal_Bool HasSourceSaved() const {return bSourceSaved;} 97 98 }; 99 100 101 #endif 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123