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 28 #ifndef _SWCONT_HXX 29 #define _SWCONT_HXX 30 31 #include <tools/string.hxx> 32 33 class SwContentType; 34 35 //Reihenfolge und Anzahl mit ResIds abgleichen!! 36 #define CONTENT_TYPE_OUTLINE 0 37 #define CONTENT_TYPE_TABLE 1 38 #define CONTENT_TYPE_FRAME 2 39 #define CONTENT_TYPE_GRAPHIC 3 40 #define CONTENT_TYPE_OLE 4 41 #define CONTENT_TYPE_BOOKMARK 5 42 #define CONTENT_TYPE_REGION 6 43 #define CONTENT_TYPE_URLFIELD 7 44 #define CONTENT_TYPE_REFERENCE 8 45 #define CONTENT_TYPE_INDEX 9 46 #define CONTENT_TYPE_POSTIT 10 47 #define CONTENT_TYPE_DRAWOBJECT 11 48 #define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1 49 50 51 // Typen fuer das Globaldokument 52 #define GLOBAL_CONTENT_REGION 100 53 #define GLOBAL_CONTENT_INDEX 101 54 #define GLOBAL_CONTENT_TEXT 102 55 #define GLOBAL_CONTENT_MAX 3 56 57 // Strings fuer Kontextmenue 58 #define CONTEXT_COUNT 12 59 #define GLOBAL_CONTEXT_COUNT 14 60 61 // Modi fuer Drag 'n Drop 62 #define REGION_MODE_NONE 0 63 #define REGION_MODE_LINK 1 64 #define REGION_MODE_EMBEDDED 2 65 66 //---------------------------------------------------------------------------- 67 //---------------------------------------------------------------------------- 68 69 //mini rtti 70 class SwTypeNumber 71 { 72 sal_uInt8 nTypeId; 73 74 public: 75 SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){} 76 virtual ~SwTypeNumber(); 77 78 virtual sal_uInt8 GetTypeId(); 79 }; 80 //---------------------------------------------------------------------------- 81 82 class SwContent : public SwTypeNumber 83 { 84 const SwContentType* pParent; 85 String sContentName; 86 long nYPosition; 87 sal_Bool bInvisible; 88 public: 89 SwContent(const SwContentType* pCnt, const String& rName, long nYPos ); 90 91 virtual sal_Bool IsProtect() const; 92 const SwContentType* GetParent() const {return pParent;} 93 const String& GetName() const {return sContentName;} 94 int operator==(const SwContent& /*rCont*/) const 95 { 96 //gleich sind sie nie, sonst fallen sie aus dem Array 97 return sal_False; 98 } 99 int operator<(const SwContent& rCont) const 100 { 101 //zuerst nach Position dann nach Name sortieren 102 return nYPosition != rCont.nYPosition ? 103 nYPosition < rCont.nYPosition : 104 sContentName < rCont.sContentName;; 105 } 106 107 long GetYPos() const {return nYPosition;} 108 109 sal_Bool IsInvisible() const {return bInvisible;} 110 void SetInvisible(){ bInvisible = sal_True;} 111 }; 112 113 #endif 114