1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swcont.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <tools/string.hxx>
38 //Reihenfolge und Anzahl mit ResIds abgleichen!!
39 #define CONTENT_TYPE_OUTLINE 0
40 #define CONTENT_TYPE_TABLE 1
41 #define CONTENT_TYPE_FRAME 2
42 #define CONTENT_TYPE_GRAPHIC 3
43 #define CONTENT_TYPE_OLE 4
44 #define CONTENT_TYPE_BOOKMARK 5
45 #define CONTENT_TYPE_REGION 6
46 #define CONTENT_TYPE_URLFIELD 7
47 #define CONTENT_TYPE_REFERENCE 8
48 #define CONTENT_TYPE_INDEX 9
49 #define CONTENT_TYPE_POSTIT 10
50 #define CONTENT_TYPE_DRAWOBJECT 11
51 #define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1
54 // Typen fuer das Globaldokument
55 #define GLOBAL_CONTENT_REGION 100
56 #define GLOBAL_CONTENT_INDEX 101
57 #define GLOBAL_CONTENT_TEXT 102
58 #define GLOBAL_CONTENT_MAX 3
60 // Strings fuer Kontextmenue
61 #define CONTEXT_COUNT 12
62 #define GLOBAL_CONTEXT_COUNT 14
64 // Modi fuer Drag 'n Drop
65 #define REGION_MODE_NONE 0
66 #define REGION_MODE_LINK 1
67 #define REGION_MODE_EMBEDDED 2
69 //----------------------------------------------------------------------------
70 //----------------------------------------------------------------------------
78 SwTypeNumber(BYTE nId
) :nTypeId(nId
){}
79 virtual ~SwTypeNumber();
81 virtual BYTE
GetTypeId();
83 //----------------------------------------------------------------------------
85 class SwContent
: public SwTypeNumber
87 const SwContentType
* pParent
;
92 SwContent(const SwContentType
* pCnt
, const String
& rName
, long nYPos
);
94 virtual BOOL
IsProtect() const;
95 const SwContentType
* GetParent() const {return pParent
;}
96 const String
& GetName() const {return sContentName
;}
97 int operator==(const SwContent
& /*rCont*/) const
99 //gleich sind sie nie, sonst fallen sie aus dem Array
102 int operator<(const SwContent
& rCont
) const
104 //zuerst nach Position dann nach Name sortieren
105 return nYPosition
!= rCont
.nYPosition
?
106 nYPosition
< rCont
.nYPosition
:
107 sContentName
< rCont
.sContentName
;;
110 long GetYPos() const {return nYPosition
;}
112 BOOL
IsInvisible() const {return bInvisible
;}
113 void SetInvisible(){ bInvisible
= TRUE
;}