1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SWCONT_HXX 25cdf0e10cSrcweir #define _SWCONT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/string.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir class SwContentType; 30cdf0e10cSrcweir 31cdf0e10cSrcweir //Reihenfolge und Anzahl mit ResIds abgleichen!! 32cdf0e10cSrcweir #define CONTENT_TYPE_OUTLINE 0 33cdf0e10cSrcweir #define CONTENT_TYPE_TABLE 1 34cdf0e10cSrcweir #define CONTENT_TYPE_FRAME 2 35cdf0e10cSrcweir #define CONTENT_TYPE_GRAPHIC 3 36cdf0e10cSrcweir #define CONTENT_TYPE_OLE 4 37cdf0e10cSrcweir #define CONTENT_TYPE_BOOKMARK 5 38cdf0e10cSrcweir #define CONTENT_TYPE_REGION 6 39cdf0e10cSrcweir #define CONTENT_TYPE_URLFIELD 7 40cdf0e10cSrcweir #define CONTENT_TYPE_REFERENCE 8 41cdf0e10cSrcweir #define CONTENT_TYPE_INDEX 9 42cdf0e10cSrcweir #define CONTENT_TYPE_POSTIT 10 43cdf0e10cSrcweir #define CONTENT_TYPE_DRAWOBJECT 11 44cdf0e10cSrcweir #define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1 45cdf0e10cSrcweir 46cdf0e10cSrcweir 47cdf0e10cSrcweir // Typen fuer das Globaldokument 48cdf0e10cSrcweir #define GLOBAL_CONTENT_REGION 100 49cdf0e10cSrcweir #define GLOBAL_CONTENT_INDEX 101 50cdf0e10cSrcweir #define GLOBAL_CONTENT_TEXT 102 51cdf0e10cSrcweir #define GLOBAL_CONTENT_MAX 3 52cdf0e10cSrcweir 53cdf0e10cSrcweir // Strings fuer Kontextmenue 54cdf0e10cSrcweir #define CONTEXT_COUNT 12 55cdf0e10cSrcweir #define GLOBAL_CONTEXT_COUNT 14 56cdf0e10cSrcweir 57cdf0e10cSrcweir // Modi fuer Drag 'n Drop 58cdf0e10cSrcweir #define REGION_MODE_NONE 0 59cdf0e10cSrcweir #define REGION_MODE_LINK 1 60cdf0e10cSrcweir #define REGION_MODE_EMBEDDED 2 61cdf0e10cSrcweir 62cdf0e10cSrcweir //---------------------------------------------------------------------------- 63cdf0e10cSrcweir //---------------------------------------------------------------------------- 64cdf0e10cSrcweir 65cdf0e10cSrcweir //mini rtti 66cdf0e10cSrcweir class SwTypeNumber 67cdf0e10cSrcweir { 68cdf0e10cSrcweir sal_uInt8 nTypeId; 69cdf0e10cSrcweir 70cdf0e10cSrcweir public: SwTypeNumber(sal_uInt8 nId)71cdf0e10cSrcweir SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){} 72cdf0e10cSrcweir virtual ~SwTypeNumber(); 73cdf0e10cSrcweir 74cdf0e10cSrcweir virtual sal_uInt8 GetTypeId(); 75cdf0e10cSrcweir }; 76cdf0e10cSrcweir //---------------------------------------------------------------------------- 77cdf0e10cSrcweir 78cdf0e10cSrcweir class SwContent : public SwTypeNumber 79cdf0e10cSrcweir { 80cdf0e10cSrcweir const SwContentType* pParent; 81cdf0e10cSrcweir String sContentName; 82cdf0e10cSrcweir long nYPosition; 83cdf0e10cSrcweir sal_Bool bInvisible; 84cdf0e10cSrcweir public: 85cdf0e10cSrcweir SwContent(const SwContentType* pCnt, const String& rName, long nYPos ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual sal_Bool IsProtect() const; GetParent() const88cdf0e10cSrcweir const SwContentType* GetParent() const {return pParent;} GetName() const89cdf0e10cSrcweir const String& GetName() const {return sContentName;} operator ==(const SwContent &) const90cdf0e10cSrcweir int operator==(const SwContent& /*rCont*/) const 91cdf0e10cSrcweir { 92cdf0e10cSrcweir //gleich sind sie nie, sonst fallen sie aus dem Array 93cdf0e10cSrcweir return sal_False; 94cdf0e10cSrcweir } operator <(const SwContent & rCont) const95cdf0e10cSrcweir int operator<(const SwContent& rCont) const 96cdf0e10cSrcweir { 97cdf0e10cSrcweir //zuerst nach Position dann nach Name sortieren 98cdf0e10cSrcweir return nYPosition != rCont.nYPosition ? 99cdf0e10cSrcweir nYPosition < rCont.nYPosition : 100cdf0e10cSrcweir sContentName < rCont.sContentName;; 101cdf0e10cSrcweir } 102cdf0e10cSrcweir GetYPos() const103cdf0e10cSrcweir long GetYPos() const {return nYPosition;} 104cdf0e10cSrcweir IsInvisible() const105cdf0e10cSrcweir sal_Bool IsInvisible() const {return bInvisible;} SetInvisible()106cdf0e10cSrcweir void SetInvisible(){ bInvisible = sal_True;} 107cdf0e10cSrcweir }; 108cdf0e10cSrcweir 109cdf0e10cSrcweir #endif 110