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 #include <resourcemodel/WW8ResourceModel.hxx> 24 25 namespace writerfilter { 26 class WW8StreamHandler : public Stream 27 { 28 int mnUTextCount; 29 30 public: 31 WW8StreamHandler(); 32 virtual ~WW8StreamHandler(); 33 34 virtual void startSectionGroup(); 35 virtual void endSectionGroup(); 36 virtual void startParagraphGroup(); 37 virtual void endParagraphGroup(); 38 virtual void startCharacterGroup(); 39 virtual void endCharacterGroup(); 40 virtual void text(const sal_uInt8 * data, size_t len); 41 virtual void utext(const sal_uInt8 * data, size_t len); 42 43 virtual void props(writerfilter::Reference<Properties>::Pointer_t ref); 44 virtual void table(Id name, 45 writerfilter::Reference<Table>::Pointer_t ref); 46 47 virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); 48 virtual void endShape( ); 49 50 virtual void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref); 51 52 virtual void info(const string & info); 53 }; 54 55 class WW8PropertiesHandler : public Properties 56 { 57 typedef boost::shared_ptr<Sprm> SprmSharedPointer_t; 58 typedef vector<SprmSharedPointer_t> SprmPointers_t; 59 SprmPointers_t sprms; 60 61 public: WW8PropertiesHandler()62 WW8PropertiesHandler() 63 { 64 } 65 ~WW8PropertiesHandler()66 virtual ~WW8PropertiesHandler() 67 { 68 } 69 70 virtual void attribute(Id name, Value & val); 71 virtual void sprm(Sprm & sprm); 72 73 void dumpSprm(SprmSharedPointer_t sprm); 74 void dumpSprms(); 75 }; 76 77 class WW8BinaryObjHandler : public BinaryObj 78 { 79 public: WW8BinaryObjHandler()80 WW8BinaryObjHandler() 81 { 82 } 83 ~WW8BinaryObjHandler()84 virtual ~WW8BinaryObjHandler() 85 { 86 } 87 88 virtual void data(const sal_uInt8* buf, size_t len, 89 writerfilter::Reference<Properties>::Pointer_t ref); 90 }; 91 92 class WW8TableHandler : public Table 93 { 94 public: WW8TableHandler()95 WW8TableHandler() 96 { 97 } 98 ~WW8TableHandler()99 virtual ~WW8TableHandler() 100 { 101 } 102 103 void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref); 104 }; 105 106 } 107